MultipleChoice
The tables 't1' and 't2' are defined below. The tables 't1' and 't2' have columns 'id' which are type of INTEGER and column 'name's which are type of TEXT. t1 t2 The following SQL command was executed. Select the number of rows in the result. SELECT * FROM t1 NATURAL FULL OUTER JOIN t2;
OptionsMultipleChoice
The 'animal' table consists of the following data: Select the correct result returned by executing the following SQL statement: SELECT name FROM animal ORDER BY weight DESC LIMIT 2 OFFSET 1;
OptionsMultipleChoice
The 'sample' table consists of the following data: How many rows are returned by executing the following SQL statement? SELECT * FROM sample WHERE v ~ 'ab';
OptionsMultipleChoice
The table 'custom' is defined below. The 'id' column and 'introducer' column are of
INTEGER type, and the 'email' column is of TEXT type.
id | email | introducer ---- +-----------------+-----------2 |
aaa@example.com | 1 3 |
bbb@example.com | 2 4 |
ccc@example.com | 2
Three SQL statements were executed in the following order:
INSERT INTO custom SELECT max(id) + 1, 'ddd@example.com', 4
FROM custom; UPDATE custom SET introducer = 999 WHERE email = 'bbb@example.com'; DELETE FROM custom WHERE introducer NOT IN (SELECT id FROM custom); Select the number of rows in the 'custom' table after the execution.
OptionsMultipleChoice
Table 't1' is defined below. Table 't1' has a column 'id' of type INTEGER, and a column 'name' of type TEXT. t1: The following SQL is executed while client 'A' is connected. BEGIN;
SELECT * FROM t1 WHERE id = 2 FOR UPDATE; SELECT * FROM t1 WHERE id = 1 FOR UPDATE; -- (*) While the second 'SELECT' statement, shown with (*), is being executed, a separate client 'B' connects and executes the following SQL. Select the correct statement about the execution results. UPDATE t1 SET name = 'turtle' WHERE id = 2; Note: the default transaction isolation level is set to 'read committed'.
OptionsMultipleChoice
The 'sample' table consists of the following data: How many rows are returned by executing the following SQL statement? SELECT DISTINCT ON (data) * FROM sample;
OptionsMultipleChoice
Table 't1' is defined as follows: CREATE TABLE t1 (value VARCHAR(5)); A set of SQL statements were executed in the following order. Select the number of rows that table 't1' has after execution. BEGIN; INSERT INTO t1 VALUES ('AA'); SAVEPOINT point1; INSERT INTO t1 VALUES ('BB'); SAVEPOINT point2; INSERT INTO t1 VALUES ('CC'); ROLLBACK TO point1; INSERT INTO t1 VALUES ('DD'); END;
Options