Question: 3. SQL queries (40 points total, 5 points each query) Write SQL query statements to query the following Uber like Rideshare database Tables Customers makes

3. SQL queries (40 points total, 5 points each
3. SQL queries (40 points total, 5 points each query) Write SQL query statements to query the following Uber like Rideshare database Tables Customers makes an order to ride with a driver. "id" is Customer 10. "did" is the ID of a driver. Trid" is the ID of a ride "Rating" is the customer's satisfaction rate with a driver on a certain ride Rating is a numerical value from 1 to 10 with 10 representing most satisfactory "cost" is the total cost of this ride. Requires a single SQL statement as answer to each question unless otherwise noted. Customers cid fname Iname phone zipcode Drivers did fname Iname Rides rid cid did RideFrom RideTo cost Rating 1. Show customers' first and last names whose zip codes start with number 41 2. Show did and RideFrom location where the Ride ratings are less than 6. 3. Show total cost of rides for cid 101 assuming a customer took rides using the company multiple times. 4. Show the total number of drivers who has received ratings more than & grouped by ratings. 5. Show drivers first and last names who received more than $100 in a single ride 6. Show customers' first and last names who rode from the same location. 7. Find customers' first and last names who spent more than $30 in single rides and left rating scores more than 8 to the drivers in the same rides 8. Using SQL, add a foreign key constraint to the Rides table. If a Driver's idis deleted in the Driver's table, the Driver's id is also deleted in the Rides table

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related General Management Questions!