Question: 6. Define and execute SQL commands to insert, update, and delete table records: You need to complete the following: Define and execute a SQL command
6. Define and execute SQL commands to insert, update, and delete table records:
You need to complete the following:
- Define and execute a SQL command to insert a new state entry for Michigan with the state abbreviation 'MI'. Create a new city named 'Detroit' and CityID 'C011' in Michigan and add an airport named 'Detroit Airport (DTW)' to this city. Lastly, insert a flight with the flight number '3851' originating from DTW and arriving at SFO, covering 2079 miles, and display FlightRoute table in your output to show the newly added record.
Define and execute a SQL command to update the status of scheduled flights with flight number 3310 to D (Delayed)
- Define and execute a SQL command to delete all the canceled flights with a departure date less than 16-OCT-2021.
- Commit the changes.
What is the importance of these SQL commands? Why would the business apply these SQL commands?
7. Joining data from tables:
- Define and execute a SQL query to display all flights which were canceled or delayed. You need to display the flight Aircraft Type ID, Aircraft purchase date, flight depart DateTime, and statusID. What business question do you think this SQL query answers?
Define and execute a SQL query to display all flights that are delayed leaving from Boston. You need to display the flight number, departure airport, arrival airport and flight depart Date/Time. What business question do you think this SQL query answers?
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
