L10

.docx

School

Algonquin College *

*We aren’t endorsed by this school

Course

2

Subject

Computer Science

Date

Dec 6, 2023

Type

docx

Pages

3

Uploaded by EarlRam3624

-- Shanghao Li -- 040903008 -- Question 01 Provide a query that will create a view for task 8 from Lab 9. create view task8 as select countries.name, count(distinct airlines.id) from airports join routes on airports.id=routes.destination_airport_id join airlines on routes.airline_id=airlines.id join countries on airports.country_id=countries.id where countries.name in ('France','Germany','Spain','Italy') group by countries.name -- Question 02: Provide a query that lists all routes that have a source airport of “Lester B Pearson Intl. Display the name of the airport, the airline id and codeshare. create index performance_improve on airports(elevation) -- Question 03:Provide a query that would create an index that would improve the performance of searches against both the source and destination airport field. create index source_destination on routes(source_airport_id,destination_airport_id) -- Question 04: How many rows are in the countries table. Provide the actual number select count(*) from countries -- Question 05:Open a second connection to your local MySQL server. Open a new local instance database at the home page -- Question 06: Start a transaction in the first connection and insert a row in the countries table. begin; insert into countries(id,name)values(0,'Chnia'); select* from countries
-- Question 07:In the first connection, how many rows are in the countries table now? select count(*) from countries 241 rows -- Question 08: In the second connection, how many rows are reported in the countries table? select count(*) from countries 240 rows -- Question 09: Commit the transaction in the first connection. commit -- Question 10: I n the second connection, how many rows are reported in the countries table? select count(*) from countries 241 rows -- Question 11: Again, start a transaction in the first connection. Begin -- Question 12: Delete the row you just added begin; delete from countries where id=0 and name='Chnia'; select * from countries -- Question 13: In the first connection, how many rows are in the countries table now? select count(*) from countries 240 rows
Your preview ends here
Eager to read complete document? Join bartleby learn and gain access to the full version
  • Access to all documents
  • Unlimited textbook solutions
  • 24/7 expert homework help