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

----Please complete the following setup tasks before attempting the assignment S

ID: 3854434 • Letter: #

Question

----Please complete the following setup tasks before attempting the assignment

Start MySQL Workbench

Double click on the Sakila (sample) database

Take note of the CITY and ADDRESS tables

Next, please answer the questions

1) What is the SQL to find the city name for the address “1913 Hanoi Way”?

2) What is the SQL to return all addresses for the city “Woodridge”?

3) What is the SQL to return the count of addresses that end in “Drive”?

4) What is the SQL to return all city names that have addresses that end in “Drive”?

5) What is the SQL to return all addresses that start with “1” and are in cities that begin with an “S”?

------------ - - - -- - - -- -- - -

Explanation / Answer

1) select city from City where address = '1913 Hanoi Way';

2) select * from Address where city = "Woodridge';

3) select count(*) from Address where address = 'Drive';

4) select cityid, city from city where city like'%(Drive');

5) select Address.address, City.city
from Address
inner join City
where (Address like '0%') OR (Address like '1%') OR (Address like '2%') OR (Address like '3%') OR (Address like '4%') OR (Address like '5%') OR (Address like '5%') OR (Address like '5%') OR (Address like '6%') OR (Address like '7%') OR (Address like '8%') OR (Address like '9%') and (city like 'S%');