CodingNic

Database and PostgreSQL Foundations

Exercises

Database and PostgreSQL Foundations 15 min read

Exercises

Objectives

This lesson introduces no new concepts. It’s a chance to practice everything from this module: data, databases, DBMSs, RDBMSs, SQL, PostgreSQL, and creating a database with pgAdmin and psql.

Exercises 4-6 are runnable against a real PostgreSQL database. The rest are conceptual, reason through them and write your answer down.

Exercises

  1. Explain, in your own words, the difference between “data” and “a database.”
  2. Explain the difference between a DBMS and an RDBMS.
  3. Name three RDBMSs other than PostgreSQL, and one thing each is commonly known for.
  4. Create a database named practice_db, using either psql or pgAdmin.
  5. Confirm practice_db exists (\l, a query against pg_database, or pgAdmin’s tree).
  6. Connect into practice_db and run SELECT version(); to confirm you’re connected to a real PostgreSQL server.
  7. Explain what schema a brand-new database starts with automatically, and why that matters for the next module.
  8. In your own words, explain the difference between using pgAdmin and using psql to talk to the same PostgreSQL server. Name one situation where you might prefer each.

Recap

You can now explain what a database, a DBMS, and an RDBMS are, why this course uses PostgreSQL, connect to it two different ways, and create a real database of your own. That’s the entire foundation the rest of this course builds on.

Next module: SQL Basics, where you’ll write your first real SQL statements and start reading data back with SELECT.