Answers To Exercises: Pattern Matching with SQL
Find all Employees that have marketing in their title
SELECT NationalIDNumber, JobTitle From HumanResources.Employee Where JobTitle like '%Marketing%'
Select all addresses that are on drives.
SELECT AddressID, AddressLine1, City FROM Person.Address WHERE AddressLine1 LIKE '%Dr.' OR Addressline1 LIKE '%Drive'
Select all products whose product number’s numeric portion starts with 7. Hint – The product number’s format is AA-9999
SELECT ProductID, Name, ProductNumber FROM Production.Product WHERE ProductNumber LIKE '__-7___'