For the questions below, consider the following schema
BusRoutes (RNo, from, to, distance, price)
Bus (BID, BusName, TravelRange)
Allowed (EID, BID)
Employees (EID, EName, Salary)
BusRoutes table gives the information for bus routes (RNo), where the bus leaves from, where it is going to, the distance between the two points, and the price for this route (end to end).
Employees table contains information on Bus Drivers, and other employees. Every driver is allowed to drive for some Bus (or he/she won't be a driver ;), and only drivers can drive a bus (not other employees).
Write the following queries in SQL:
a. Find the Employee ID and the maximum travel range of the Bus for each Driver who is certified for that bus and at least two other Buses.
b. Find the drivers (i.e. their names) whose salary is less than the price of the cheapest route from Boston to LA.
Recently Asked Questions
- A researcher claims the proportion of adults who live in a household without landline phones is greater than 50%. A survey showed that 850 of the 1600 adult
- Which of the following is NOT a feature that distinguishes futures contracts from forward contracts ? Futures contracts :
- Which of the following is a difference between futures and forward contracts ? Futures contracts are :