Consider the following passenger table:
Passenger_Id Passenger_name Date_of_arrival Ticket_cost Airlines Destination
001 Shamik 12/2/21 35000 GoAir Bhopal
002 Anamika 30/12/20 30000 IndiGo Goa
003 Manju 15/5/20 15000 GoAir Jaipur
004 Anukriti 18/9/20 32000 SpiceJet Bhopal
Give SQL Commands/Query for the following:
1)Display Passenger ID, Passenger name and Airlines whose destination is Bhopal.
2) Modify the Airlines to Vistara for the record whose Passenger Id is 002.
3) Find the total of the ticket cost for the ‘GoAir’ Airlines.
4) Display Passenger Id, Date of arrival and Destination for the records whose passenger
name has ‘n’ in second place.!!
Answers
Answered by
12
Given:
Passenger_Id Passenger_name Date_of_arrival Ticket_cost Airlines Destination
001 Shamik 12/2/21 35000 GoAir Bhopal
002 Anamika 30/12/20 30000 IndiGo Goa
003 Manju 15/5/20 15000 GoAir Jaipur
004 Anukriti 18/9/20 32000 SpiceJet Bhopal
Explanation:
1) Select Passenger_Id, Passenger name, Airlines where Destination = "Bopal"
2) Modify Airlines = "Vistara" where Passenger_Id = "002".
4) Display Passenger_Id, Date of Arrival, Destination where passenger name = "*n".
Similar questions