• Courses
  • Tutorials
  • Jobs
  • Practice
  • Contests

GATE | Sudo GATE 2020 Mock III (24 January 2019) | Question 61

Consider the following schema:
Person(SSN, name, address)
Car(license, year, model)
Accident(license, accident_date, driver, damage_amount)
Owns(SSN, license) 
Primary keys are underlined. Note that the driver involved in a car accident may not always be the owner of the car. Assume that accident_date is of type integer, and represents a year (e.g. 1980). Year is also of type integer. Also, assume that a car cannot get involved in more than one accident at a certain date. Which of the following query is correct to find the SSN of every person who owns one or more cars, none of which has ever been involved in a car accident.

(A)

SELECT O.SSN
FROM Owns O
WHERE O.license NOT IN (SELECT A.license
                        FROM Accident A) 

(B)

πSSN(Owns) - πSSN(Owns ⨝ Accident) 

(C)

{ O | ∃O1 ∈ Owns( O.SSN = O1.SSN ∧ ¬∃A∈ Accident( O1.license = A.license )) } 

(D)

All of the above.

Answer

Please comment below if you find anything wrong in the above post
Feeling lost in the world of random DSA topics, wasting time without progress? It's time for a change! Join our DSA course, where we'll guide you on an exciting journey to master DSA efficiently and on schedule.
Ready to dive in? Explore our Free Demo Content and join our DSA course, trusted by over 100,000 geeks!

Last Updated :
Share your thoughts in the comments