PostgreSQL Quiz
Check what you have learned in the PostgreSQL tutorial. Each question has one correct answer and a short explanation.
Topics in This Quiz
- psql and databases
- Data types and tables
- Inserting, updating and upserting
- Queries, joins and window functions
- JSONB, views and transactions
Question 1
Exercise
Which psql command connects to the database named institute?
Question 2
Exercise
Which type should you use for a "created at" column that must store the exact moment in time?
Question 3
Exercise
What does 'Urdu' = ANY(languages) check, when languages is a TEXT[] column?
Question 4
Exercise
Which clause gives you the new row's id straight after an INSERT?
Question 5
Exercise
What does INSERT ... ON CONFLICT (title) DO NOTHING do when the title already exists?
Question 6
Exercise
In PostgreSQL, which keeps every row from both tables in a join?
Question 7
Exercise
Which function joins the names of all students in a group into one text value?
Question 8
Exercise
What does RANK() OVER (PARTITION BY city ORDER BY marks DESC) calculate?
Question 9
Exercise
Which statement about PostgreSQL transactions is true?
What Next?
Well done on finishing the PostgreSQL tutorial. Use it from a real back-end with Node.js, or explore a document database in the MongoDB tutorial.
