View the step-by-step solution to:

For the questions below, consider the following schema BusRoutes (RNo, from, to, distance, price) Bus (BID, BusName, TravelRange) Allowed (EID, BID)

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

Why Join Course Hero?

Course Hero has all the homework and study help you need to succeed! We’ve got course-specific notes, study guides, and practice tests along with expert tutors.

-

Educational Resources
  • -

    Study Documents

    Find the best study resources around, tagged to your specific courses. Share your own to gain free Course Hero access.

    Browse Documents
  • -

    Question & Answers

    Get one-on-one homework help from our expert tutors—available online 24/7. Ask your own questions or browse existing Q&A threads. Satisfaction guaranteed!

    Ask a Question