WHERE Clause Practice Problems

Download as pdf or txt
Download as pdf or txt
You are on page 1of 1

WHERE Clause Practice Problems

1) Return the FirstName and LastName columns from Person.Person where the FirstName column
is equal to “Mark”

2) Find the top 100 rows from Production.Product where the ListPrice is not equal to 0.00

3) Return all rows and columns from the view HumanResources.vEmployee where the employee’s
last name starts with a letter less than “D”

4) Return all rows and columns from Person.StateProvince where the CountryRegionCode column
is equal to “CA”

5) Return the FirstName and LastName columns from the view Sales.vIndividualCustomer where
the LastName is equal to “Smith”. Give the column alias “Customer First Name” and “Customer
Last Name” to the FirstName and LastName columns respectively.

6) Using the Sales.vIndividualCustomer view, find all customers with a CountryRegionName equal
to “Australia” or all customers who have a PhoneNumberType equal to “Cell” and an
EmailPromotion column value equal to 0. (Hint: the correct query requires the use of parentheses
in your WHERE clause)

7) Find all employees from the view HumanResources.vEmployeeDepartment who have a


Department column value in the list of: “Executive”, “Tool Design”, and “Engineering”. Complete
this query twice – once using the IN operator in the WHERE clause and a second time using
multiple OR operators.

You might also like