✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.
Suppose we have the following schema:
,
,
describing, respectively, people, types of cars, and cars and their owners. The data corresponding to these tables is as follows:
| ID | NAME |
| 1 | Madeleine |
| 2 | Alice |
| 3 | Nalini |
| CarTypeId | Type |
| 1 | Small |
| 2 | Medium |
| 3 | Large |
| CarId | OwnerId | CarTypeId | CarName |
| 1 | 1 | 1 | Nano |
| 2 | 2 | 2 | Santro |
Select the correct returned tuple of the following SQL query:
select distinct Q.name from (select P.name, C.carName, CT.carTypeId from Person P left outer join Car C on (C.ownerId = P.id) inner join CarType CT on (C.carTypeId = CT.carTypeId)) as Q