The following two tables are called rentalinfo and rentalcost. Rental info gives
ID: 3810156 • Letter: T
Question
The following two tables are called rentalinfo and rentalcost. Rental info gives the customer name, the make of the car that the customer rented, the date rented, the city and the id.
Write the SELECT query that returns the names of all customers who rented a hyundai.
customer
make
date_out
city
id
SMITH
FORD
10-20-2012
NY
1
SMITH
HYUNDAI
10-20-2012
NY
2
SMITH
VOLVO
10-20-2012
SI
3
JONES
NISSAN
10-20-2012
SI
4
WHITE
FORD
10-20-2012
NY
5
WHITE
HYUNDAI
10-20-2012
NEWARK
6
DOE
FORD
10-20-2012
SI
7
SIMMS
HYUNDAI
10-20-2012
NEWARK
8
MARCY
HONDA
10-20-2012
NY
9
make
cost
FORD
30
HYUNDAI
20
NISSAN
30
HONDA
40
VOLVO
50
customer
make
date_out
city
id
SMITH
FORD
10-20-2012
NY
1
SMITH
HYUNDAI
10-20-2012
NY
2
SMITH
VOLVO
10-20-2012
SI
3
JONES
NISSAN
10-20-2012
SI
4
WHITE
FORD
10-20-2012
NY
5
WHITE
HYUNDAI
10-20-2012
NEWARK
6
DOE
FORD
10-20-2012
SI
7
SIMMS
HYUNDAI
10-20-2012
NEWARK
8
MARCY
HONDA
10-20-2012
NY
9
make
cost
FORD
30
HYUNDAI
20
NISSAN
30
HONDA
40
VOLVO
50
Explanation / Answer
MYSQL:
Below query will extract all the customers who rented hyndai from rentalinfo table:
SELECT customer FROM rentalinfo WHERE make="HYUNDAI" ;
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.