Suppose you have a table called D with the schema/header (c1 TEXT, c2 TEXT, dist REAL). c1 and c2 represent the names of cities and dist represents the distance between them in miles. Below are several attempts to write a SQL query to get the distances of all three-city trips. (That means they start in one city, travel to second city, and then end in a third city.) Which of the following queries will work to retrieve this information? (Select all correct answers; there may be more than one.) SELECT D.c1,D.c2,E.c2,D.dist FROM D , D as E WHERE D.c2=E.c1 SELECT c1,c2,c2, dist+dist FROM D,D WHERE c1=c2 SELECT D.c1,D.c2,E.c2,D.dist+E.dist FROM D , D as E WHERE D.c2%3DE.c1 SELECT D.c1,D.c2,E.c2,x FROM D, D as E WHERE x=D.dist+E.dist O SELECT D.c1,D.c2%3DE.c1,E.c2 FROM D, D as E WHERE D.dist+E.dist This is not a task that can be solved with a SQL query. You have to use Python code. O This can be done with a SQL query, but none of the above queries will work.
Suppose you have a table called D with the schema/header (c1 TEXT, c2 TEXT, dist REAL). c1 and c2 represent the names of cities and dist represents the distance between them in miles. Below are several attempts to write a SQL query to get the distances of all three-city trips. (That means they start in one city, travel to second city, and then end in a third city.) Which of the following queries will work to retrieve this information? (Select all correct answers; there may be more than one.) SELECT D.c1,D.c2,E.c2,D.dist FROM D , D as E WHERE D.c2=E.c1 SELECT c1,c2,c2, dist+dist FROM D,D WHERE c1=c2 SELECT D.c1,D.c2,E.c2,D.dist+E.dist FROM D , D as E WHERE D.c2%3DE.c1 SELECT D.c1,D.c2,E.c2,x FROM D, D as E WHERE x=D.dist+E.dist O SELECT D.c1,D.c2%3DE.c1,E.c2 FROM D, D as E WHERE D.dist+E.dist This is not a task that can be solved with a SQL query. You have to use Python code. O This can be done with a SQL query, but none of the above queries will work.
Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
Related questions
Question

Transcribed Image Text:Question 18
Suppose you have a table called D with the schema/header (c1 TEXT, c2 TEXT, dist REAL).c1 and
c2 represent the names of cities and dist represents the distance between them in miles. Below
are several attempts to write a SQL query to get the distances of all three-city trips. (That means
they start in one city, travel to second city, and then end in a third city.)
Which of the following queries will work to retrieve this information?
(Select all correct answers; there may be more than one.)
SELECT D.c1,D.c2,E.c2,D.dist FROM D , D as E WHERE D.c2=E.c1
SELECT c1,c2,c2,dist+dist FROM D,D WHERE c1=c2
SELECT D.c1,D.c2,E.c2,D.dist+E.dist FROM D, D as E WHERE D.c2=E.c1
SELECT D.c1,D.c2,E.c2,x FROM D, D as E WHERE x=D.dist+E.dist
SELECT D.c1,D.c2%3DE.c1,E.c2 FROM D, D as E WHERE D.dist+E.dist
O This is not a task that can be solved with a SQL query. You have to use Python code.
This can be done with a SQL query, but none of the above queries will work.
Expert Solution

This question has been solved!
Explore an expertly crafted, step-by-step solution for a thorough understanding of key concepts.
Step by step
Solved in 3 steps

Recommended textbooks for you

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON

Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science

Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning

Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning

Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education

Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY