SQL Assessment Test
SQL Assessment Test
Time: 60 minutes
Q1: We need to find users who were tagged with the tag ‘magic’ on 2021-11-10.
Q2: Query to show supply hours and trips for drivers based on Country.
Select country,sum(‘minutes Online’/60.0),’ sum(trips ID)
From drivers as di
Inner join supply as sup
On di.id = sup.Driver ID
Inner join trips
On di.id = trips.driver id
Group by di.country
country,
SUM(supply_hours) AS total_supply_hours,
SUM(trips) AS total_trips
FROM
driver_data
GROUP BY
country
Q3: Disney World is having a fun holiday getaway for all those people who stayed for the entire
duration of their Star Wars extravaganza.
a) Query for those individuals eligible for the holiday getaway.
Hint: duration of Star Wars extravaganza was 3 days
Table: Disney
Q4: Given the data below, query for supply hours of all those drivers who paid during the months of
July to August. The drivers’ paid status should be indicated clearly in a separate column.
Note a driver is considered to have paid if they have the tag ‘zippo’, ‘bolt’ tag means partial
payment, and ‘light’ means non-payment.