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

Database 1. What command would return all the rows and columns in the Products t

ID: 671017 • Letter: D

Question

Database

1. What command would return all the rows and columns in the Products table?

2. What command would you type and execute to return only the ProductID, ProductName and Price columns from the Products table?

3. What command would you type and execute to return rows where the word “tofu” appears somewhere in the ProductName column?

4. What command would you use to return all rows and columns, with the ProductName column heading appearing as “Name”?

5. What command would you use to return all rows and columns, sorted alphabetically by the ProductName field?

Explanation / Answer

1. What command would return all the rows and columns in the Products table?
select *from Products
2. What command would you type and execute to return only the ProductID, ProductName and Price columns from the Products table?
select ProductID, ProductName,Price Products
3. What command would you type and execute to return rows where the word “tofu” appears somewhere in the ProductName column?
select *from Products where ProductName like '%tofu%'
4. What command would you use to return all rows and columns, with the ProductName column heading appearing as “Name”?
select *from Products where ProductName like 'Name%'
5. What command would you use to return all rows and columns, sorted alphabetically by the ProductName field?
select *from Products order by ProductName asc