For SQL Database Development For this query you will need to
For SQL Database Development
For this query, you will need to copy and paste, or upload your sql query that will solve this question.
1.Make sure you put the USE command on the first line to show what database is used.
2.An SQL comment with your name, quiz number and question number.
3.The complete SQL statement
Query #2: Display both rows returned of the following fields:
1) Customers.CustomerID,
2) An e-mail address which is made up of the Customers.ContactName, an “@” symbol ,and the Customers.CompanyName,
3) Customers.Contact Title
Only display the above information if ALL of the following criterion are met:
1) The Ship City is Madrid Spain
2) The Freight cost is greater that $50
3) The title of the contact person is “owner”
Solution
--use DB2
-- Your name
SELECT CUSTOMER_ID, (CUSTOMER_NAME+\'@\'+COMPANY_NAME) AS EMAIL, CONTACT_TITLE
FROM TABLE_NAME
WHERE SHIP_CITY = \'Madrid Spain\'
AND FREIGHT_COSE > 50
AND CUSTOMER_TITLE = \'owner\'
Note: These are all assumed column names of the table. please modify accordingly
