A. Write a query that returns the name of all persons that like
at least two people with green eyes. Eliminate duplicates from your
query result.
B. Write a query that returns the name of all male persons
that play soccer with a female player. Eliminate duplicates from
your result.
Persons id name address age eyeColor gender Likes id personA_id > Persons - personB_id → Persons -> Che semantics of the Likes table is that personA likes personB.
Persons id name address age eyeColor gender SportTogether personA_id id -> sport Persons personB_id - Persons he semantics of the Sport table is that persona does sport with persons Note that the table does not contain redundancies. The table may contain a row (id, sport, personA, personB) without containing the symmetric row (id, sport, personB, personA). Nevertheless, the relation is to be understood as symmetric: if persona does sport with persons , then of course personB also does sport with persona ! You need to take this into account in your query!
Persons id name address age eyeColor gender Likes id personA_id > Persons - personB_id → Persons -> Che semantics of the
-
answerhappygod
- Site Admin
- Posts: 899604
- Joined: Mon Aug 02, 2021 8:13 am
Persons id name address age eyeColor gender Likes id personA_id > Persons - personB_id → Persons -> Che semantics of the
Join a community of subject matter experts. Register for FREE to view solutions, replies, and use search function. Request answer by replying!