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
- Explain, in your own words, the difference between “data” and “a database.”
- Explain the difference between a DBMS and an RDBMS.
- Name three RDBMSs other than PostgreSQL, and one thing each is commonly known for.
- Create a database named
practice_db, using eitherpsqlor pgAdmin. - Confirm
practice_dbexists (\l, a query againstpg_database, or pgAdmin’s tree). - Connect into
practice_dband runSELECT version();to confirm you’re connected to a real PostgreSQL server. - Explain what schema a brand-new database starts with automatically, and why that matters for the next module.
- In your own words, explain the difference between using pgAdmin and using
psqlto 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.