Academic Integrity: tutoring, explanations, and feedback — we don’t complete graded work or submit on a student’s behalf.

Still considering the World War II database. Assume someone wants to write a que

ID: 3700025 • Letter: S

Question

Still considering the World War II database. Assume someone wants to write a query that returns for each ship the date it was launched and when it was sunk. What is the problem with the following query?

            SELECT S.name, S.launched, B.date

            FROM Battles AS B, Ships AS S

            WHERE S.name=(SELECT ship FROM Outcomes WHERE results=’sunk’) AND

    B.name=(SELECT battle FROM Outcomes WHERE results=’sunk’) ;

Write this query in MySQL , run the query and submit the screenshots of :

1. the query

2. database error message

(5) Correct the query and run it on the database. Submit the screenshot of:

1. the correct query

2. database answer

Explanation / Answer

Hi

The problem with your query is "your suplying multiple values to a uniary operator equals(=) in the where condition."

Could you please try the below query(As I don't have the World War II database with me), I'm sure that the below query will work .

SELECT S.name, S.launched, B.date

FROM Battles AS B, Ships AS S

WHERE S.name IN (SELECT ship FROM Outcomes WHERE results=’sunk’) AND

B.name IN (SELECT battle FROM Outcomes WHERE results=’sunk’) ;

Hire Me For All Your Tutoring Needs
Integrity-first tutoring: clear explanations, guidance, and feedback.
Drop an Email at
drjack9650@gmail.com
Chat Now And Get Quote