wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

PostgreSQL Refresher

Total questions: 13

Worksheet time: 13mins

Name
Class
Date
1.

Which of the listed items can not be used for interacting with PostgreSQL?

a)

DBeaver

b)

pgAdmin

c)

Psql

d)

Google Data Studio

2.

Which options are not correctly describing the following Psql commands?

a)

\q

exit the Psql 

b)

\l

list available tables

c)

\g

execute previous command

d)

\x

make display experience better

3.

Which SQL statement we can use to create a namespace?

a)

CREATE DATABASE

b)

CREATE SCHEMA

c)

CREATE TABLE

d)

CREATE NAMESPACE

4.

Which SQL statement we can use to change an existing value of a field

a)

UPDATE

b)

SELECT

c)

DELETE

d)

COUNT

5.

Which of the following is not a valid SQL type?

a)

FLOAT

b)

NUMERIC

c)

REAL PRECISION

d)

CHARACTER

6.

Which one of the following items is a valid SQL constraint?

a)

Primary-key

b)

Foreign-key

c)

Not null

d)

Check

7.

Which statement is used to delete all rows in a table without having the action logged?

a)

TRUNCATE

b)

DELETE

c)

REMOVE

d)

DROP

8.

What operator tests columns for absence of data?

a)

NOT

b)

EXISTS

c)

IS NULL

d)

None of above

9.

_________ command makes the updates performed by the transaction permanent in the database?

a)

ROLLBACK

b)

COMMIT

c)

TRUNCATE

d)

DELETE

10.

Which one will update the "Thomas" last names to "Michel" in the Users table?

a)

UPDATE User SET LastName = 'Thomas' INTO LastName = 'Michel'

b)

MODIFY Users SET LastName = 'Michel' WHERE LastName = 'Thomas'

c)

MODIFY Users SET LastName = 'Thomas' INTO LastName = 'Michel'

d)

UPDATE Users SET LastName = 'Michel' WHERE LastName = 'Thomas'

11.

Which option will delete all the cities called CyberJaya from City table in Sales schema?

a)

DELETE FROM city where name=’'CyberJaya'

b)

DELETE FROM sales.city where true

c)

DELETE FROM sales.city where name=’'CyberJaya'

d)

DELETE FROM city where name is CyberJaya

12.

Which option describes LEFT JOIN better?

a)

Rows that have matches from both side

b)

All from the left, matches from the right

c)

All from the right, matches from the left

d)

All rows that have match in either side

13.

Please select the Incorrect statement about CTEs?

a)

CTE makes code maintainability easier

b)

the WITH clause declares virtual tables which exist only for the duration of the statement

c)

Not everything that can be done with normal, non-recursive CTE can be done with sub-queries 

d)

CTE improves the code readability