Question

SQL

1--> List slPax.PaxID, slPax.PaxFirstName, slPax.PaxLastName, and slCensus.PaxOrder for passengers with the lastname 'lozano'.
Order the list by slCensus.PaxOrder in ascending order.

2-->List slShip.Make, slMaintenance.MaintenanceDate, and slSupplier.SupplierName for maintenance items with cost between 50 and 75.
Order the list by slMaintenance.MaintenanceDate in ascending order.

3-->List slShip.Model, slTrip.TripStart, and slWayPoint.WayPoint for TripID = 118.
Order the list by slFloatPlan.FloatPlanID in descending order.

4-->List slTrip.TripID, slTrip.TripStart, slLaunch.Launch, Passenger, and slShip.Make for TripID 100. This query provides the list of passengers and the launch for a given trip.
Passenger is the concatenation of first and last name with a blank in between.
Order the list by slCensus.PaxOrder in ascending order.

5-->List slTrip.TripID, slTrip.TripEnd, slTrip.WaterTemp, slLaunch.Launch, slShip.Make, and CaptainName for trips with a water temperature greater than 88 and for which the trip ended in the afternoon.
CaptainName is the concatenation of first and last name with a blank in between.
Derive the hour from slTrip.TripEnd using DATEPART() and the HOUR interval. A trip that ends in the afternoon will have a DATEPART() value greater than or equal to 12.
Order the list by slTrip.TripID in ascending order.

Schema for help

slMaintenance sIRepair lGearPurchase Column Name Column Nme Data Type Column N.. Data Type RepairlD int RepairDate datetime R

0 0
Add a comment Improve this question Transcribed image text
Answer #1

1-->List slPax.PaxID, slPax.PaxFirstName, slPax.PaxLastName, and slCensus.PaxOrder for passengers with the lastname 'lozano'.
Order the list by slCensus.PaxOrder in ascending order.

Query: select slPax.PaxID, slPax.PaxFirstName, slPax.PaxLastName, slCensus.PaxOrder from slPax, slCensus where slPax.PaxID = scCensor.PaxID AND slPax.PaxLastName = 'lozano' order by slCensor.PaxOrder;

2-->List slShip.Make, slMaintenance.MaintenanceDate, and slSupplier.SupplierName for maintenance items with cost between 50 and 75.
Order the list by slMaintenance.MaintenanceDate in ascending order.

Query: select slShip.Make, slMaintenance.MaintenanceDate, slSupplier.SupplierName from slShip, slMaintenance, slSupplier where slShip.ShipID = slMaintenance.ShipID and slMaintenance.SupplierID = slSupplier.SupplierID AND sl.MaintenanceCost BETWEEN 50 AND 75 order by slMaintenance.MaintenanceDate;

3-->List slShip.Model, slTrip.TripStart, and slWayPoint.WayPoint for TripID = 118.
Order the list by slFloatPlan.FloatPlanID in descending order.

Query: select slShip.Model, slTrip.TripStart, slWayPoint.WayPoint from slShip, slTrip, slWayPoint, slFloatPlan where slShip.ShipID = slTrip.ShipID and slTrip.TripID = slFloatPlan.TripID and slFloatPlan.WayPointID = slWayPoint.WayPointID where slTrip.TripID = 118 order by slFloatPlan.FloatPlanID desc;

4-->List slTrip.TripID, slTrip.TripStart, slLaunch.Launch, Passenger, and slShip.Make for TripID 100. This query provides the list of passengers and the launch for a given trip.
Passenger is the concatenation of first and last name with a blank in between.
Order the list by slCensus.PaxOrder in ascending order.

Query: slTrip.TripID, slTrip.TripStart, slLaunch.Launch, concat(slPax.PaxFirstName, ' ', slPax.PaxLastName) as Passenger, slShip.Make from slTrip, slLaunch, slPax, slCensus where slPax.PaxID = slCensus.PaxID and slCensus.TripID = slTrip.TripID and slTrip.LaunchID = slLaunch.LaunchID where slTrip.TripID = 100 order by slCensus.PaxOrder;

NOTE: As per HOMEWORKLIB POLICY, I am allowed to answer only 4 questions (including sub-parts) on a single post. Kindly post the remaining questions separately and I will try to answer them. Sorry for the inconvenience caused.

Add a comment
Know the answer?
Add Answer to:
SQL 1--> List slPax.PaxID, slPax.PaxFirstName, slPax.PaxLastName, and slCensus.PaxOrder for passengers with the lastname 'lozano'. Order 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
  • SQL Homework 1. For each reservation, list the reservation ID, trip ID, customer number, and customer...

    SQL Homework 1. For each reservation, list the reservation ID, trip ID, customer number, and customer last name. Order the results by customer last name. 2. For each reservation for customer Ryan Goff, list the reservation ID, trip ID, and number of persons. 3. List the trip name of each trip that has Miles Abrams as a guide. 4. List the trip name of each trip that has the type Biking and that has Rita Boyers as a guide. 5....

  • can you finish implementing the functions below ********************************************************************************************************** import urllib.request from typing import List, TextIO #...

    can you finish implementing the functions below ********************************************************************************************************** import urllib.request from typing import List, TextIO # Precondition for all functions in this module: Each line of the url # file contains the average monthly temperatures for a year (separated # by spaces) starting with January. The file must also have 3 header # lines. DATA_URL = 'http://robjhyndman.com/tsdldata/data/cryer2.dat' def open_temperature_file(url: str) -> TextIO: '''Open the specified url, read past the three-line header, and return the open file. ''' ... def avg_temp_march(f:...

  • A guide to SQL 9th edition Colonial Adventure Tours chapter 3 page 90-92 Odd numbered exercises...

    A guide to SQL 9th edition Colonial Adventure Tours chapter 3 page 90-92 Odd numbered exercises only figure 3-39(Guide, trip, customer, reservation and Trip_Guides) figure 1-5 chapter 1: 7. Review me on TUI UTILIVUDIJ types used to create the ITEM table in Figure 3-34. Suggest alternate data types for the DESCRIPTION, ON HAND. and STOREHOUSE fields and explain your recommendation Colonial Adventure Tours Use SQL to complete the following exercises 1. Create a table named ADVENTURE TRIP. The table has...

  • Overview: Database management plays an integral role in nearly every area of business. Databases house customer, accoun...

    Overview: Database management plays an integral role in nearly every area of business. Databases house customer, accounting, and employee data, and these different data sets must all be efficiently managed in order to make the data accessible. Companies rely on database engineers to ensure that their records are accurate, updated, and tracked in real time. This course covers structured query language (SQL) and how it can be used to manage database schemas, manipulate data, and analyze data. For your final...

  • SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do...

    SQL problem solving help; First 3 tables are finnished; Need help understanding on how to do steps after. First 3 tables are after the first 2 images for reference if needed. //1// CREATE TABLE kr_customer ( Name VARCHAR(40) NOT NULL PRIMARY KEY, City VARCHAR(20), Status CHAR(1) ); //2// CREATE TABLE kr_salesperson ( Name VARCHAR(40) NOT NULL PRIMARY KEY, Age INT, Salary DECIMAL(8, 2) ); //3// CREATE TABLE kr_order ( Order_Number number(3) NOT NULL PRIMARY KEY, Customer_Name VARCHAR(40), Salesperson_Name VARCHAR(40), Amount...

  • Create a single list that contains the following collection of data in the order provided: [1121,...

    Create a single list that contains the following collection of data in the order provided: [1121, "Jackie Grainger", 22.22, 1122, "Jignesh Thrakkar", 25.25, 1127, "Dion Green", 28.75, False, 24.32, 1132, "Jacob Gerber", "Sarah Sanderson", 23.45, 1137, True, "Brandon Heck", 1138, 25.84, True, 1152, "David Toma", 22.65, 23.75, 1157, "Charles King", False, "Jackie Grainger", 1121, 22.22, False, 22.65, 1152, "David Toma"] The data above represents employee information exported from an Excel spreadsheet. Whomever typed the data in originally didn't give much...

  • 1. What is the output when you run printIn()? public static void main(String[] args) { if...

    1. What is the output when you run printIn()? public static void main(String[] args) { if (true) { int num = 1; if (num > 0) { num++; } } int num = 1; addOne(num); num = num - 1 System.out.println(num); } public void addOne(int num) { num = num + 1; } 2. When creating an array for primitive data types, the default values are: a. Numeric type b. Char type c. Boolean type d. String type e. Float...

  • For C++ This is the information about the meal class 2-1. (24 marks) Define and implement...

    For C++ This is the information about the meal class 2-1. (24 marks) Define and implement a class named Dessert, which represents a special kind of Meal. It is to be defined by inheriting from the Meal class. The Dessert class has the following constructor: Dessert (string n, int co) // creates a meal with name n, whose type // is "dessert" and cost is co The class must have a private static attribute static int nextID ; which is...

  • Lab Exercise #15 Assignment Overview This lab exercise provides practice with Pandas data analysis library. Data...

    Lab Exercise #15 Assignment Overview This lab exercise provides practice with Pandas data analysis library. Data Files We provide three comma-separated-value file, scores.csv , college_scorecard.csv, and mpg.csv. The first file is list of a few students and their exam grades. The second file includes data from 1996 through 2016 for all undergraduate degree-granting institutions of higher education. The data about the institution will help the students to make decision about the institution for their higher education such as student completion,...

  • Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C -...

    Question 1 An array is NOT: A - Made up of different data types. B - Subscripted by integers. C - A consecutive group of memory chunks. D - None of the choices. Question 2 How many times is the body of the loop executed? int i=1; while(true) { cout << i; if(++i==5) break; } A - Forever B - 4 C - 5 D - 6 E - 0 Question 3 What is wrong with the following piece of...

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