Question

In: Computer Science

For this project, following assumptions have been made:   The booking is only open for the next...

For this project, following assumptions have been made:  

  1. The booking is only open for the next seven days from the current date.

  1. Only two categories of the plane can be booked i.e. Economy and Business.

  1. The total number of tickets that can be booked in each category is 10 only.

  1. By ‘user’, we mean the person who is booking the ticket for the passenger(s). For example, an employee of Saudi Airline.

Your project should include information about the following entities and their respective attributes:

Entities

Attributes

User

User_id

User_password

First_name

Last_name

Age

Gender

Email_address

Contact_number

City

Passenger

Passenger_ID

Name

Gender

Age

Phone_num

BookingRef_num

Seat_no

Status

Flight

Flight_number

Flight_name

Departure_airport

Arrival_airport

Departure_time

Arrival_time

Availabilty_of_seats

Airport

Number

Name

Flight_number

Arrival_time

Departure_time

Ticket

Ticket_id

Flight_number

Booked_user

Status

Number_of_passengers

Required SQL Queries:

  1. Write a query that displays the User_id and names of all those passengers who booked ticket on any particular flight.

  1. Write a query to display details (ex. Passenger_ID, name, etc.) of all passengers travelling under a particular ticket.

  1. Write a query to display the time at which any Flight_number reaches any Airport_name. For example, EK233, Dammam.

  1. Write a query to display all flights in ascending order of their departure time.

  1. Write a query to display the flight_number that stops for the longest time at any airport (e.g., Dammam).

questions:

Design & ER Model

Normalize the Tables (in 3NF at least)

Create the Normalized Tables and Populate them with at least 5 Rows

Write the sample requested Queries & Execute them

Solutions

Expert Solution

SOLUTION:

Given details:

Table Design and Details:

Relation between tables and key:

SQL Queries:

1. Write a query that displays the User_id and names of all those passengers who booked ticket on any particular flight.

Syntax:

SELECT *

FROM Table_name
WHERE condition;

Answer: Assuming to obtain details of Flight_number = ‘EK233’

SELECT u.User_id, p.Name
FROM Passenger p, Ticket t, User u
WHERE Flight_number = ‘EK233’ AND t.BookingRef_num=p.BookingRef_num AND t.Booked_user=u.User_id;

2. Write a query to display details (ex. Passenger_ID, name, etc.) of all passengers travelling under a particular ticket.

Answer: Assuming to obtain passenger details of BookingRef_num = ‘XYZ123’

SELECT *
FROM Passenger
WHERE BookingRef_num = ‘XYZ123’;

3. Write a query to display the time at which any Flight_number reaches any Airport_name. For example, EK233, Dammam.

Answer:

SELECT Arrival_time
FROM Airport

WHERE Flight_number= EK233 AND Name= Dammam;

4. Write a query to display all flights in ascending order of their departure time.

ORDER_BY Syntax: Use ‘ASC’ for ascending, ‘DESC’ for descending

SELECT *
FROM table_name
ORDER BY column_name ASC | DESC;

SELECT *
FROM Flight
ORDER BY Departure_time ASC;

5. Write a query to display the flight_number that stops for the longest time at any airport (e.g., Dammam).

Answer:

SELECT Flight_number

FROM Airport

WHERE Max(Departure_time - Arrival_time) = Departure_time - Arrival_time AND Name= Dammam;

***************************************************************************************

Please comment for any further help on this question


Related Solutions

Decide whether a booking must be made for the following business transactions and enter the account...
Decide whether a booking must be made for the following business transactions and enter the account name and amount. The sales tax (VAT) may have to be taken into account with 18%. If no booking record has to be formed, please make this clear with "No booking record". Info: Elektrovolt A.Ş., an industrial company, produces sockets and mainly supplies them to Cereyan A.Ş., a trading company. Unless otherwise stated, create the posting records for the following business transactions as of...
In comparing traditional low-speed chairlifts with high-speed chairlifts, assumptions have been made (efficiency) by the two...
In comparing traditional low-speed chairlifts with high-speed chairlifts, assumptions have been made (efficiency) by the two chairlifts is the same if they travel same distance. a) Does high-speed chairlift experience more frictoon than low speed chairlift due to air resistance and friction? b) Could you please explain why this assumption is false? Thank you so much!!
Assume you are buying an existing apartment complex and have made the following assumptions: Data Acquisition...
Assume you are buying an existing apartment complex and have made the following assumptions: Data Acquisition Cost $5,000,000 Project Length 5 Year 1 Rental Income $560,000 Rental Income Annual Growth 3% Year 1 Expenses $200,000 Expenses Annual Growth 2% Ordinary Tax Rate 28% Capital Gains Tax Rate 15% Annual Appreciation Rate of Property Market Value 3% 30-year Fixed Fully Amortizing Loan (monthly payments) Term in Years 30 Interest Rate (Annualized) 6% LTV 75% The proceeds of the loan are received...
What assumptions do you have about unemployment? Have those assumptions been challenged by readings or videos...
What assumptions do you have about unemployment? Have those assumptions been challenged by readings or videos that further discuss unemployment, lay-offs, outsourcing, etc.? Why? Do you think that there can be positive outcomes for the unemployed after layoffs, downsizing, and outsourcing? You may look at a specific region (like Detroit, for example), or a specific industry, but you should find some examples to back your argument. Be sure to cite your sources while you write a post in the discussion...
Beech’s managers have made the following additional assumptions and estimates: 1. Estimated sales for July, August,...
Beech’s managers have made the following additional assumptions and estimates: 1. Estimated sales for July, August, September, and October will be $310,000, $330,000, $320,000, and $340,000, respectively. 2. All sales are on credit and all credit sales are collected. Each month’s credit sales are collected 45% in the month of sale and 55% in the month following the sale. All of the accounts receivable at June 30 will be collected in July. 3. Each month’s ending inventory must equal 20%...
Beech’s managers have made the following additional assumptions and estimates: 1. Estimated sales for July, August,...
Beech’s managers have made the following additional assumptions and estimates: 1. Estimated sales for July, August, September, and October will be $240,000, $260,000, $250,000, and $270,000, respectively. 2. All sales are on credit and all credit sales are collected. Each month’s credit sales are collected 45% in the month of sale and 55% in the month following the sale. All of the accounts receivable at June 30 will be collected in July. 3. Each month’s ending inventory must equal 15%...
You are considering the purchase of an apartment complex. The following assumptions are made: • The...
You are considering the purchase of an apartment complex. The following assumptions are made: • The purchase price is $1,150,000. • Potential gross income (PGI) for the first year of operations is projected to be $195,000. • PGI is expected to increase at 4 percent per year. • 3% vacancies are expected. • Operating expenses are estimated at 30 percent of effective gross income. Capital expenditures are estimated at 10 percent of effective gross income. • The market value of...
You are considering the purchase of an apartment complex. The following assumptions are made: •           The...
You are considering the purchase of an apartment complex. The following assumptions are made: •           The purchase price is $1,250,000. •           Potential gross income (PGI) for the first year of operations is projected to be $191,000. •           PGI is expected to increase at 4.5 percent per year. •           5% vacancies are expected. •           Operating expenses are estimated at 35 percent of effective gross income. Capital expenditures are estimated at 15 percent of effective gross income. •           The market value of...
Assuming assumptions have been met (e.g., sample sizes, similar variances), for each of the following scenarios,...
Assuming assumptions have been met (e.g., sample sizes, similar variances), for each of the following scenarios, determine whether a single mean z test, single mean t test, paired means t test, independent means t test, one-way between groups ANOVA, or one-way within groups ANOVA should be used. Explain why that procedure is appropriate. A. Are the mean sale prices of two-bedroom homes different in Oregon, Washington, and Idaho? Data are collected from random samples of two-bedroom homes from each state....
Discuss a scenario that focuses on assumptions and observations that anyone may have made about you....
Discuss a scenario that focuses on assumptions and observations that anyone may have made about you. Discuss how other’s assumptions have impacted how you view yourself and whether this has contributed to any trauma in your life. Discuss some strategies that you have developed to cope with your situation, and how you can use your life experience to develop self-care strategies.
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT