Question

Please generate the queries in SQL given the following: Problem: Analyzing Santa’s Bike Service (20%) The...

Please generate the queries in SQL given the following: Problem: Analyzing Santa’s Bike Service (20%) The Santa Bike Service provides rental bicycles in San Francisco. It distributes these bikes through several completely automated stations, each with a number of bike docks for securely parking a rental bike. Users can rent these bicycles by visiting Santa’s website, choosing their preferred station for pick-up, and paying for their rental. The website will generate a reservation code for their use. They can head to the station, enter the code at a bike’s dock and the bicycle will be released. Once users are done with the bicycle, they can return it to any Santa’s station, as long as there is an empty dock for them to park and lock the bicycle.

Santa captures this data, together with some weather data, in a database using the following 4 relations and associated attributes:

TRIP DATA Stores information about a particular trip taken on a bike.

trip_id : an ID created for each trip

duration: duration of the trip (in seconds)

start_station : the name of the station where the bike was rented

end_station : the name of the station where the bike was returned

bike_number : the ID of the bike that was rented for the trip

subscriber_type : the type of customers (“Subscriber” or “Customer”)

zip_code: the home address zip code of the customer who rented the bike for the trip start_date: the start time and date of the trip

end_date: the end time and date of the trip

DAILY WEATHER

mean_temperature : average temperate in a day, in that area

mean_humidity: average humidity in a day, in that area

mean_visibility : a visible viewing distance in kilometres, in that area

precipitation: a measurement of how much rain fell that day, on a scale of 0-10, in that area

cloud_cover: a measurement of how cloudy it was on a day, on a scale of 0-10, in that area

zip: a zip code for some area of San Francisco

date: the date

STATION STATUS

station_id : an ID for the station

bikes_available : the number of available bikes at a particular time, given by the Time attribute

dock_available : the number of available docks for bikes at a particular time, given by the Time attribute

date_time : a time stamp

STATION INFORMATION

station_id : an ID for the station

name : the name of the station

lat : latitude of the station

long : longitude of the station

dock_count : the total number of docks at this station

landmark: landmark of the station

4 Based on the schema above, what SQL queries would you use to retrieve the following information? Please check the BikeStation database on our MySQL server to see the values of each field. 6. Retrieve all the start times and associated end times for all trips with a duration that is less than 1 hour. (2%) 7. Retrieve the list of station names. (2%) 8. Retrieve the list of trips made in June 2016. (2%) 9. Retrieve the list of trips not made in June 2016. (2%) 10. Retrieve the list of all the stations that have available bikes, but no available docks on 2016-01-29. (2%) 11. Retrieve the list of areas (zip code) where the temperature was 50 or lower in January 2016. (2%) 12. Retrieve the list of trips started by customers from these areas where the temperature was 50 or lower in January 2016. (2%) 13. Retrieve the list of the IDs of stations that have bikes available but no available docks on 2016-01-29 between the 6:00 am and 9:00 am. (2%) 14. Retrieve the list of the names of stations that have bikes available but no available docks on 2016-01-29 between the 6:00 am and 9:00 am. (2%) 15. Retrieve the list of all trips where customers started their rides in stations that have more than 30 available docks. (2%) ***Note i only need 10-15***

0 0
Add a comment Improve this question Transcribed image text
Know the answer?
Add Answer to:
Please generate the queries in SQL given the following: Problem: Analyzing Santa’s Bike Service (20%) The...
Your Answer:

Post as a guest

Your Name:

What's your source?

Earn Coins

Coins can be redeemed for fabulous gifts.

Not the answer you're looking for? Ask your own homework help question. Our experts will answer your question WITHIN MINUTES for Free.
Similar Homework Help Questions
  • python 3 beginner top question please In Boilerville, a bicycle can be rented between 8:00 am...

    python 3 beginner top question please In Boilerville, a bicycle can be rented between 8:00 am unti 9.0 0 are prot hour from 8:00 am until 3:30 pm. From 3:30 pm until 9:00o Partial ho bike, and they do not rent bikes before 8:00 am or Define a function named q50 that prm. The charge for each bike is $1 75p pm the rate is $2.50 an hour. These rates are per after 9:00 pm. Partial hours accepts the number...

  • Here are the data needed for the program. SanFrancisco.csv station_id,name,lat,long,dockcount,landmark,installation 41,Clay at Battery,37.795001,-122.39997,15,San Francisco,8/19/2013 42,Davis at Jac...

    Here are the data needed for the program. SanFrancisco.csv station_id,name,lat,long,dockcount,landmark,installation 41,Clay at Battery,37.795001,-122.39997,15,San Francisco,8/19/2013 42,Davis at Jackson,37.79728,-122.398436,15,San Francisco,8/19/2013 45,Commercial at Montgomery,37.794231,-122.402923,15,San Francisco,8/19/2013 46,Washington at Kearney,37.795425,-122.404767,15,San Francisco,8/19/2013 47,Post at Kearney,37.788975,-122.403452,19,San Francisco,8/19/2013 48,Embarcadero at Vallejo,37.799953,-122.398525,15,San Francisco,8/19/2013 49,Spear at Folsom,37.790302,-122.390637,19,San Francisco,8/20/2013 50,Harry Bridges Plaza (Ferry Building),37.795392,-122.394203,23,San Francisco,8/20/2013 SanJose.csv station_id,name,lat,long,dockcount,landmark,installation 2,San Jose Diridon Caltrain Station,37.329732,-121.901782,27,San Jose,8/6/2013 3,San Jose Civic Center,37.330698,-121.888979,15,San Jose,8/5/2013 4,Santa Clara at Almaden,37.333988,-121.894902,11,San Jose,8/6/2013 5,Adobe on Almaden,37.331415,-121.8932,19,San Jose,8/5/2013 6,San Pedro Square,37.336721,-121.894074,15,San Jose,8/7/2013 7,Paseo de San Antonio,37.333798,-121.886943,15,San Jose,8/7/2013 8,San Salvador at 1st,37.330165,-121.885831,15,San Jose,8/5/2013...

  • Database HW help!!!!!!! Provide the SQL statements for the following queries. (1) Provide the names and...

    Database HW help!!!!!!! Provide the SQL statements for the following queries. (1) Provide the names and phones of all swimmers currently in level (of id) 3. +-------+---------+---------------------------+ | FName | LName   | EMail                     | +-------+---------+---------------------------+ | Bobby | Khan    | theBKhan1 | | Clara | Johnson | ClaraJohnson_11 | +-------+---------+---------------------------+ 2 rows in set (0.00 sec) (2) Provide the names of swimmers who have signed up to participate in the event '100M Butterfly' of Meet id 1. +-------+---------+ | FName...

  • Python programming- Download the following two files you will need for this activity: customerData.csv This file...

    Python programming- Download the following two files you will need for this activity: customerData.csv This file contains randomly generated fictitious customer data. customer_regex.py This is a Python script that imports the customer data into a list of customer details. In your personal playground in Codio, upload the two files and investigate the contents before considering the task you will pose to your peers. Assume the position of a manager of an online retailer. Pose a question to your IT expert...

  • 23. What is the total net amount of capital gain reported on Form 1040? OA. $308...

    23. What is the total net amount of capital gain reported on Form 1040? OA. $308 OB. $2,411 C. $2,719 OD. $2,900 Advanced Scenario 7: Mark and Barbara Matthews Directions Using the tax software, complete the tax return, including Form 1040 and all appropri- ate forms, schedules, or worksheets. Answer the questions following the scenario. Note: When entering Social Security numbers (SSNs) or Employer Identification Numbers (EINS), replace the Xs as directed, or with any four digits of your choice....

  • Super stuck on a couple of questions on this scenario. Advanced Scenario 7: Mark and Barbara...

    Super stuck on a couple of questions on this scenario. Advanced Scenario 7: Mark and Barbara Matthews Directions Using the tax software, complete the tax retum, including Form 1040 and all appropri- ate forms, schedules, or worksheets. Answer the questions following the scenario. Note: When entering Social Security numbers (SSNS) or Employer identification Numbers (EINS), replace the Xs as directed, or with any four digits of your choice. Interview Notes • Mark and Barbara are married and want to file...

  • Can you please provide the formula for the worksheet also. CASE PROBLEMS Level 1- Analyzing Sales...

    Can you please provide the formula for the worksheet also. CASE PROBLEMS Level 1- Analyzing Sales for Crèmes Ice Cream Judd Hemming is the eastern regional marketing manager for Crèmes Ice Cream. Eac quarter, he completes two separate analyses: an analysis comparing ice cream flavor sale volumes from all regional locations with the same quarter sales volumes from the previou year and an analysis comparing total sales in dollars, including mean, median, mode, and standard deviation, of sales by store....

  • In your judgement, and given only the facts described in this case, should the management of...

    In your judgement, and given only the facts described in this case, should the management of Massey energy Company be held morally responsible for the deaths of the 29 miners? Explain in detail. Suppose that nothing more is learned about the explosion other than what is described in this case. Do you think Don Blankership should be held morally responsible for the deaths of the 29 miners? Explain in detail. Given only the facts described in this case, should the...

  • Please read the article and answer about questions. You and the Law Business and law are...

    Please read the article and answer about questions. You and the Law Business and law are inseparable. For B-Money, the two predictably merged when he was negotiat- ing a deal for his tracks. At other times, the merger is unpredictable, like when your business faces an unexpected auto accident, product recall, or government regulation change. In either type of situation, when business owners know the law, they can better protect themselves and sometimes even avoid the problems completely. This chapter...

ADVERTISEMENT
Free Homework Help App
Download From Google Play
Scan Your Homework
to Get Instant Free Answers
Need Online Homework Help?
Ask a Question
Get Answers For Free
Most questions answered within 3 hours.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT