MultipleChoice
The 'sample' table consists of the data below. The column 'x' is of type INTEGER.
How many rows are returned by executing the following SQL statement? SELECT
6 / x FROM sample WHERE CASE WHEN x = 0 THEN FALSE ELSE TRUE END;
OptionsMultipleChoice
In the 'customer' table, you want to change the 'email' values which have an 'id' value of 10000 or less, to NULL. Select the correct SQL statement to achieve this task.
OptionsMultipleChoice
The table 'tbl' is defined below such that it could only store non-negative integers in the column 'nn'. Select the keyword that is applicable for the underlined blank. CREATE _______ natural_number AS DECIMAL CHECK (VALUE >= 0); CREATE TABLE tbl(nn natural_number);
OptionsMultipleChoice
The tables 't1' and 't2' are defined below. Tables 't1' and 't2' have columns 'id' that are of INTEGER type, and columns 'name' that are of TEXT type. t1 t2 The following SQL command was executed. Select the number of rows in the result. SELECT * FROM t1 RIGHT OUTER JOIN t2 ON t1.id = t2.id;
OptionsMultipleChoice
The 'sample' table consists of the following data. How many rows are returned by executing the following SQL statement? SELECT i FROM sample GROUP BY i;
OptionsMultipleChoice
There is a table 'tb1' that has a column 'c1' defined as type TEXT. The following SQL is executed while client 'A' is connected. BEGIN; LOCK TABLE tb1 IN ACCESS EXCLUSIVE MODE; SELECT * FROM tb1; While the above 'SELECT' statement is being executed, client 'B' connects to the same database and executes the following SQL. Select two correct statements describing the behavior of PostgreSQL. INSERT INTO tb1 (c1) VALUES ('new line'); Note: the default transaction isolation level is set to 'read committed'.
OptionsMultipleChoice
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.
Options