BIS 345 Course Great Wisdom / tutorialrank.com BIS 345 Course Great Wisdom / tutorialrank.com | Page 14

36.( TCO 2) Refer to the tblCustomer table below. As a data analyst, you have been requested to select rows that meet the following requirements: For each city, list the city name in all upper case characters along with the exchange part of the customer phone number( the first 3 digits). Include only preferred
Part 1: Write the complete SQL statement needed to return the rows that meet these requirements.
Part 2: What rows will be returned from this query? List the customer ID only of the rows to be returned.
Part 3: What function did you use to extract the three-digit exchange? Why did you select this function? Rewrite the SQL using a different function to extract these characters.( Points: 25)
Part 3: To extract the three-digit exchange I used the LEFT( Phone, 3) funcion.
37.( TCO 3) Refer to the tblCustomer table below. As a data analyst, you have been requested to select rows that meet the following requirements. For each city, list the name of the city, and the number of customers in that city. Include only those cities that have more than 1 customer in them. Order the data by city in descending order.
tblCustomer: Part 1: SELECT City, COUNT(*) FROM tblCustomer GROUP BY City HAVING COUNT(*)> 1 ORDER BY City DESC;
Part 2: Did you select any filter clause( s)?( WHERE, HAVING) Justify your choice of filter( s).( Points: 25)