Question: write a SQL query Table Structure: flight COLUMN NAME DATA TYPE SIZE Constraint Fid Number 3 Primary key Fname Varchar 2 10 Splace Varchar 2

write a SQL query

write a SQL query Table Structure: flight COLUMN NAME DATA TYPE SIZE

Constraint Fid Number 3 Primary key Fname Varchar 2 10 Splace Varchar

Table Structure: flight COLUMN NAME DATA TYPE SIZE Constraint Fid Number 3 Primary key Fname Varchar 2 10 Splace Varchar 2 8 Dplace Varchar 2 8 Tdate date Seats Number 3 Note: Fid is Fight ID, Fname is Flight Name, Splace is a source place where the flight starts Dplace is destination place where the flight will reach, Tdate is tremel date of the flight and seats are the number of seats awilable in the flight Records inserted in to the flight table Fid Fname Splace Dplace Tdate Seats 101 Oman Air Muscat Delhi 20-Jan-2021 78 102 Air India Muscat Chennai 31-Dec-2020 null 201 Indigo Dubai Muscat 12-Feb-2021 93 103 Oman Air Chennai Dubai 23-Dec-2020 82 205 Air India Delhi Muscat 14-Feb-2021 115 202 Indigo Chennai Delhi 23-Jan-2021 null 4. Write an SQL query to display the source place and how many flights in each source place group, average number of seats available in each source place group only which source place group has less than two records and the number of seats available is in the range from 50 to 150. [4 Marks] 5. Write an SQL query to display the destination place, number of seats available in the flight, customer id and the number of tickets booked using natural join. Arrange your result in descending order based on number of seats available in the flight. [3 Marks] 6. Write an SQL query to display the customer name, number of tickets booked, flight name and number of seats available in the flight using right outer join.[3 Marks]

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!