codejump

PostgreSQL Basics — Series 2

Preview — 3 of 10 questions

What does \du show in psql?

ALists all database roles/users, along with their attributes (superuser, can login, etc.)
BLists all user-defined functions
CLists all UPDATE statements in the query history
DShows disk usage per table

What does \c mydb do in psql?

ACreates a new database named mydb
BSwitches the current psql session's connection to the database named mydb
CCopies the current database to a new one named mydb
DChecks if a database named mydb exists, without connecting

What does \x toggle in psql?

AWhether SQL keywords are highlighted in a different color
BWhether query execution time is shown after each query
CExtended (vertical) display mode, where each column of a row is printed on its own line instead of the default wide tabular format — useful for wide rows with many columns
DWhether NULL values are shown as empty strings or the literal text NULL

Sign up free to play

Answer all 10 questions (7 more), see explanations for every answer, and track your score.