Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Need help witht hese SQL commands here are the schema provided NEED HELP ASAP! G

ID: 3705052 • Letter: N

Question

Need help witht hese SQL commands here are the schema provided NEED HELP ASAP!

Guide GuideNum LastName FirstName Address AM01 Abrams Miles 54 Quest Ave. BR01 DH01 GZ01 KS01 KS02 MR01 RH01 SLO1 UG01 State PostalCode PhoneNum HireDate 617-555-6032 6/3/2012 603-555-2134 3/4/2012 781-555-7767 1/8/2012 603-555-8765 11/4/2012 603-555-1230 4/8/2013 603-555-0003 6/10/2013 781-555-2323 9/14/2015 207-555-9009 6/2/2014 802-555-3339 9/5/2014 203-555-8534 2/2/2015 City Williamsburg MA 01096 Jaffrey 140 Oakton Rd. NH 03452 DevonHarley 25 Old Ranch Rd. Sunderland MA 01375 NH 03588 NH 03452 NH 03580 01101 ME 04660 VT 05825 CT 06810 Boyers Rita 7 Moose Head Rd. Dummer GregoryZach KileySusan 943 Oakton Rd. Jaffrey Kelly Marston Ray Rowan Hal StevensLori 9 Congaree Ave. Fraconia 24 Shenandoah Rd. Springfield MA 12 Heather Rd. Mount Desert 15 Riverton Rd. Coven Sam try UnserGlory 342 Pineview St. Danbury

Explanation / Answer

1. Select R.ReservationID, T.TripID, R.CustomerNum, C.LastName from Reservation R, Customer C, Trip T where

R.CustomerNum = C.CustomerNum and

R.TripID = T.TripID

order by LastName

group by ReservationID.

2. Select R.ReservationID, T.TripID, R.NumPersons from Reservation R, Customer C, Trip T where

C.FirstName = 'Ryan' and C.LastName = 'Goff' and

R.CustomerNum = C.CustomerNum and

R.TripID = T.TripID

group by ReservationID.

3. Select T.Tripname from Trip T, Guide G where

G.LastName = 'Abrams' and G.FirstName = 'Miles' and

G.State = T.state

group by TripID.

4. Select T.Tripname from Trip T, Guide G where

G.LastName = 'Boyers' and G.FirstName = 'Rita' and

T.Type = 'Biking' and

G.State = T.state

group by TripID.

5. Select C.LastName, T.TripName, T.StartLocation from Reservation R, Customer C, Trip T where

R.TripDate = '7/23/2016' and

R.CustomerNum = C.CustomerNum and

R.TripID = T.TripID

group by ReservationID.

6. Select R.ReservationID, T.TripID, R.TripDate where

R.TripID = T.TripID and

T.State = 'ME'.

In the last query 'IN operator' can not be used because 'IN' is used for multiple OR conditions, but in our case state specified in the question is only one that is, 'ME'.

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote