You should be able to:
- Explain what a database is, and why you would use one
- Write SQL queries using some common keywords (SELECT, FROM, WHERE, ORDER BY, JOIN, etc)
- Articulate what a primary key is
- Articulate what a foreign key is, and why you would use one
- Explain the differences between a 1-to-1, 1-to-many, and many-to-many relationship
- A column of one table that stores primary keys of another table ☑️
- A unique identifier for each row in a table: This is a primary key not a foreign key
One-to-one | One-to-many | Many-to-many | Explanation | |
---|---|---|---|---|
A person and his/her/their passport | ☑️ | |||
An album and its songs | ☑️ | A song can be part of multiple albums (i.e., released in the original album but also be part of a greatest hits album) | ||
An author and their books | ☑️ |
- Social Security Numbers ☑️
- Birthdates
- Phone Numbers ☑️
- Fingerprints ☑️
Explanation: For SSN and Phone Numbers, these would be good but we can also think about how not everyone has these and perhaps the format of these identifiers may be different depending upon where the person is from. Fingerprints are great because they are unique to everyone and everyone has fingerprints
Choose the correct keywords to fill in the blanks in the following query to list everyone and their RSVP to dinner: ____ name, response ____ friends ____ responses ____ response DESC
- SELECT, FROM, LEFT JOIN, ORDER BY