Practice: Data Modeling
💡 This is your chance to put what you’ve learned into action.
Try solving these practice challenges to check that you understand the concepts.
Submission
To log your practice for credit:
- Practice exercises will be graded for completion not correctness. You have to document that you did the work, but we won't be checking if you got it right.
- You are encouraged to engage with all the exercises listed on the practice page.
- You are expected to submit only the details requested on the Gradescope submission.
JOIN practice
If you have not already, practice JOINs on SQLBolt.
You can get more JOIN practice with the exercises on SQLZoo:
SQLBolt also has lessons on other kinds of queries, like aggregations. If you have time, it's good to get more SQL practice.
Many to many relationships: Restaurants
Practice working with many-to-many relationships by reading, running, and writing queries in the restaurant, tags, and reviews domain.
- Fork the Restaurant Reviews replit
- Read the files there, and run the queries
- Practice writing queries, following the instructions in the comments
Draw a data model
Using a drawing tool like Figma, Lucidchart, Excalidraw, or Visual Paradigm, draw an ERD to match the following description and features:
Ubolter is a phone-based taxi application. Customers can request rides, and drivers can accept them. A ride has a destination and a pickup location, a start time and end time. Each ride has an associated payment, which has a base cost that depends on the time and distance, as well as surcharges for service fees and taxes. The customer may also add a tip. After each ride, customers and drivers can leave a rating and review.
- Riders
- Drivers
- Rides
- Payments
- Ratings
After you've drawn the ERD, write the CREATE TABLE statements that would create the tables in your design.