MultipleChoice
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 ('A'); SAVEPOINT sp; INSERT INTO t1 VALUES ('B'); ROLLBACK TO sp; INSERT INTO t1 VALUES ('C'); COMMIT;
OptionsMultipleChoice
Select two correct statements about the command shown below.
Note: $ is the command prompt. $ pg_ctl reload
OptionsMultipleChoice
Select the most suitable statement about the PostgreSQL license from below.
OptionsMultipleChoice
The table 't1' is defined below. The column 'id'
for table 't1' is of INTEGER type.
id | name ----
+-----------1 |
mammoth 2 |
tortoise 3 |
coelacanth
The following SQL statements were executed. Select the correct statement about the execution result. BEGIN; DECLARE c SCROLL CURSOR FOR SELECT name FROM t1 ORDER BY id;
MOVE FORWARD 2 FROM c; FETCH FORWARD ALL FROM c; COMMIT;
OptionsMultipleChoice
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);
Options