MultipleChoice
Select two incorrect statements related to the command below.
Note: $ is the command prompt. $ psql -U foo -c 'COPY company TO stdout;' bar
OptionsMultipleChoice
The tables 't1' and 't2' are defined in the same way (they have the same data types and column names). You want to select rows in 't1' which are not in 't2'. Select a correct keyword to fill in the blank below. SELECT * FROM t1 ______ SELECT * FROM t2;
OptionsMultipleChoice
The table 't1' is defined by the following SQL statement: CREATE TABLE t1 (id integer, name varchar(20)); You want to increase the execution speed of the SQL statement below: SELECT id, name FROM t1 WHERE id < 123 AND upper(name) = 'MAMMOTH'; Select the most suitable SQL statement to create an index.
OptionsMultipleChoice
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;
Options