Question: Language: SQL / Database Management The following four data tables describe the available items, orders, users, and deliveries for a certain restaurants online delivery service:
Language: SQL / Database Management The following four data tables describe the available items, orders, users, and deliveries for a certain restaurants online delivery service:
Question: List all foreign keys in the database and the keys they reference, and then identify any compound keys in the database.
items
| code | description | price |
|---|---|---|
| HAMBGR | Hamburger | 4.29 |
| CHZBGR | Cheeseburger | 4.99 |
| FRYSML | Small fries | 1.99 |
| FRYLRG | Large fries | 2.99 |
| FNCOLA | Coke | 1.49 |
orders
| order_id | item | quantity |
|---|---|---|
| 0001 | CHZBGR | 2 |
| 0001 | FRYLRG | 1 |
| 0002 | HAMBGR | 1 |
| 0002 | FNCOLA | 1 |
| 0003 | CHZBGR | 3 |
users
| login | name | address |
|---|---|---|
| john123@geemail.com | John | 123 Number St |
| alice89@h0tmail.edu | Alice | 88 Infinity Rd |
| jdepp@pirates.com | Johnny | 21 Jump St |
| kat22@yah000.net | Kathryn | 65 Leonin Ln |
deliveries
| order_id | user | delivered |
|---|---|---|
| 0001 | alice89@h0tmail.edu | Yes |
| 0002 | john123@geemail.com | Yes |
| 0003 | alice89@h0tmail.edu | No |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
