- Explain what an entity relationship diagram is.
- Explain why an entity relationship diagram is useful.
- Explain what PostgreSQL column constraints are.
- Use PostgreSQL column constraints to implement an entity relationship diagram.
- Explain what a join clause is.
- Explain why a join clause is useful.
- Use an INNER JOIN clause to combine rows from different tables.
With your neighbors, draw an ERD to represent the relationship between pet entities and species entities.
Once you're satisfied with this, add owner entities to the diagram and draw their relationship with pet entities.
Once you're satisfied with this, add one more entity of your choosing to the diagram and draw their relationship with the other entities as appropriate.
Turn to your neighbor and discuss why entity relationship diagrams are useful? Be prepared to share with the class.
Turn to your neightbor and define the following PostgreSQL column constraints:
- Not-null constraints
- Unique constraints
- Primary key constraints
- Foreign key constraints
With your neighbors, add some attributes to the pet-based ERD that you created earlier.
Once you're satisfied with the diagram, write a CREATE TABLE SQL command for each entity.
Once you're satisfied with the tables, write some INSERT SQL commands to populate each table.
Turn to your neightbor and explain what a join clause is and why they are useful?
Lets practice using inner joins with the movie_junkies example:
dropdb movie_junkies_dev
createdb movie_junkies_dev
curl -fsSL https://git.io/voXVD | psql movie_junkies_dev
psql movie_junkies_dev