A sequence has the following definition: CREATE SEQUENCE seq1 CACHE 10 CYCLE; Select the value that is returned by executing the following SQL. SELECT nextval('seq1');
Answer : B
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.
Answer : C
Select the correct SQL statement which concatenates strings 'ABC' and 'abc' to form 'ABCabc'.
Answer : E
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;
Answer : A
Select the most appropriate statement about the initdb command.
Answer : A
What does the following command do? Select the correct description from below.
Note: "text=#" is the command prompt for psql. test=# ANALYZE foo;
Answer : B
Select the most suitable statement about the creation of a new database.
Answer : E