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

1) Write a query that uses the CONCAT function to concatenate the last name with

ID: 3755872 • Letter: 1

Question

1) Write a query that uses the CONCAT function to concatenate the last name with the first_name from the Customers table so that a customer name appears in the format example: Frese, Robert. That is: show the last name and separate the last name from the firs name with a comma and a space. Write your Select statement below: 2) Write a Query that joins four tables and Selects the following columns: Select columns: product_name, quantity, order_date, ship_date, shipping address_id. The four tables to join are products, order_items, orders, and customers See the attached Diagram for reference. Write your SELECT query below:

Explanation / Answer

1. Select statement with CONCAT syntax,
SELECT CONCAT (last_name,","," ",first_name)
FROM Customers;

2. Select statement with multiple tables
Select p.product_name, oi.quantity, o.order_date,c.shipping_address
From product p, order_items oi, orders o, customers c;

3. Create Index on table
Create INDEX mail_index
On customers(email_address)

4. Select using the Greater than function
Select * from products where list_price > 20;