Question

In: Computer Science

List all cities that cannot be reached from Seattle through a direct flight nor with one...

List all cities that cannot be reached from Seattle through a direct flight nor with one stop (i.e., with any two flights that go through an intermediate city). Warning: this query might take a while to execute. We will learn about how to speed this up in lecture. Name the output column city. Order the output ascending by city.

Solutions

Expert Solution

Here , We are given a Table named FLIGHT (let),

And asked to write a query which will output the names of the cities which cannot be reached through a direct or indirect flight . And also to name it as City and then display the output in ascending order.

    Example Table:                     

FLIGHT

Serial no source_city destination_city
1 Seattle Moscow
2 frankfurt London
3 seattle silicon valley
4 washington DC paris
5 Paris frankfurt
6 Moscow washington DC

now, according to the given statement, we need to first get city names which cannot be traveled through the direct or indirect flight through Seattle hence for that the SQL query is :

SELECT   destination_city   FROM flight AS   City WHERE   source_city < > Seattle.

After we execute the above query the OUTPUT will be as shown below screenshot :

Now, we need to make the displayed output as ordered in ascending order :

for that the previous query needs some modification as below :

SELECT * FROM City (SELECT   destination_city   FROM flight AS   City WHERE   source_city < > Seattle) GROUP BY ASC.

for OUTPUT of the above query please refer the below screenshot :

SO, the above output is the desired output .


Related Solutions

It is believed that the mean flight time from Seattle to New York City is 310...
It is believed that the mean flight time from Seattle to New York City is 310 minutes. You want to test to determine if it is different from this. The population standard deviation is 10 minutes. You randomly sample 50 flights and the sample average is 313 minutes. State your hypotheses, calculate and state the test statistic, calculate and state the p-value, state whether you reject the Ho or fail to reject the Ho, and state your final conclusion (i.e....
Provide a list of all structures that glomerular filtrate will pass through from the time it...
Provide a list of all structures that glomerular filtrate will pass through from the time it leaves the bloodstream in the glomerular capsule to the time it leaves the body. Ensure that your structure list is in order.
Destination Departing Flight Numbers (list all departing flight segments) Distance (round to nearest mile) Amount Miami...
Destination Departing Flight Numbers (list all departing flight segments) Distance (round to nearest mile) Amount Miami Delta 3899/ Delta 951 993 $328 San Diego Delta 3899/ Delta 1909 2,321 $609 New York City Delta 3899/ Delta 2021 555 $508 Chicago Delta 3899/ Delta 1608 516 $205 Seattle Delta 3899/Delta 3642 2,568 $491 Salt Lake City Delta 2899/ Delta 2611 1,831 $475 Boston Delta 2109/ Delta 665 744 $579 Honolulu Delta 876/ Delta 1559 4,594 $1,168 Denver Delta 3899/ Delta 2871...
Write SQL queries below for each of the following: List the names and cities of all...
Write SQL queries below for each of the following: List the names and cities of all customers List the different states the vendors come from (unique values only, no duplicates) Find the number of customers in California List product names and category descriptions for all products supplied by vendor Proformance List names of all employees who have sold to customer Rachel Patterson
If one? three-digit number? (0 cannot be a left? digit) is chosen at random from all...
If one? three-digit number? (0 cannot be a left? digit) is chosen at random from all those that can be made from the following set of? digits, find the probability that the one chosen is not a multiple of 5 . (0,1,2,3,4,5,6)
List the order of all structures and locations through which light passes to get from the...
List the order of all structures and locations through which light passes to get from the outside world to where rods and cones receive light waves to depolarize.
A record of violent crimes for a random sample of cities from the list of U.S....
A record of violent crimes for a random sample of cities from the list of U.S. cities with the fewest crimes is shown below. At significance level 0.05, is there sufficient evidence to indicate a relationship between the city and the type of crime committed? (Contingency table ) Forcible Rape Robbery Aggravated assault Cary, NC 14 35 70 Amherst, NY 10 33 76 Simi Valley, CA 14 37 77 Norman, OK 47 36 53
a. What is the difference between atoms and molecules? b. List all elements that cannot have...
a. What is the difference between atoms and molecules? b. List all elements that cannot have an "expanded octet."
part 1) One weakness of CPI is that it cannot be calculated until all the costs...
part 1) One weakness of CPI is that it cannot be calculated until all the costs for a specific analysis period have been entered into the accounting system. Because suppliers and subcontractors usually bill the project at the end of the month, the CPI can only be calculated monthly, limiting its use as a cost control tool. Group of answer choices true false part 2) A LCPI greater than 1.0 does not necessarily mean the project cost is under the...
Evaluate the statement that one city should provide all the electricity for both cities, while the...
Evaluate the statement that one city should provide all the electricity for both cities, while the other provides all the water
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT