Microsoft SQL Server Database Quiz Questions

Chapter Name:Chapter 7 - DQL (Data Query Language)
Lesson Content Link:NOT LIKE Operator
Current Quiz Count:45
Progress
0%
Q1
True / False

The NOT LIKE operator can be used to exclude patterns in a column.

Q2
True / False

The NOT LIKE operator is case-insensitive by default in Microsoft SQL Server.

Q3
True / False

Using NOT LIKE '%a%' will exclude all rows where the column contains the letter 'a'.

Q4
True / False

The NOT LIKE operator can be used with wildcards such as '%' and '_'.

Q5
True / False

NOT LIKE can be used in combination with other operators like AND and OR.

Q6
True / False

The NOT LIKE operator cannot be used with numeric columns.

Q7
True / False

The NOT LIKE operator will include rows where the column is NULL.

Q8
True / False

Using NOT LIKE 'A%' will exclude rows starting with the letter 'A'.

Q9
True / False

The NOT LIKE operator is faster than the LIKE operator.

Q10
True / False

Using NOT LIKE '%test%' will exclude all rows where the column contains 'test' anywhere in the string.

Q11
True / False

The NOT LIKE operator can be used to exclude multiple patterns using the OR operator.

Q12
True / False

Using NOT LIKE '_a%' will exclude rows where the second character is 'a'.

Q13
True / False

NOT LIKE can be used in the WHERE clause of an UPDATE statement.

Q14
True / False

The NOT LIKE operator can be used with the ESCAPE keyword to exclude patterns with special characters.

Q15
True / False

Using NOT LIKE '%%' will exclude all rows.

Q16
Single Choice

Which query excludes all rows where the name contains 'John'?

SQL Code
SELECT Name
FROM Users
WHERE Name NOT LIKE '%John%';
Q17
Single Choice

How would you exclude all products starting with 'Pro'?

SQL Code
SELECT ProductName
FROM Products
WHERE ProductName NOT LIKE 'Pro%';
Q18
Single Choice

Which query excludes all email addresses containing 'gmail'?

SQL Code
SELECT Email
FROM Contacts
WHERE Email NOT LIKE '%gmail%';
Q19
Single Choice

How would you exclude all cities ending with 'ville'?

SQL Code
SELECT City
FROM Locations
WHERE City NOT LIKE '%ville';
Q20
Single Choice

Which query excludes all phone numbers starting with '123'?

SQL Code
SELECT PhoneNumber
FROM Directory
WHERE PhoneNumber NOT LIKE '123%';
Q21
Single Choice

How would you exclude all rows where the first name starts with 'A'?

SQL Code
SELECT FirstName
FROM Employees
WHERE FirstName NOT LIKE 'A%';
Q22
Single Choice

Which query excludes all last names containing 'Smith'?

SQL Code
SELECT LastName
FROM Employees
WHERE LastName NOT LIKE '%Smith%';
Q23
Single Choice

How would you exclude all countries starting with 'A'?

SQL Code
SELECT CountryName
FROM Countries
WHERE CountryName NOT LIKE 'A%';
Q24
Single Choice

Which query excludes all book titles containing 'Guide'?

SQL Code
SELECT Title
FROM Books
WHERE Title NOT LIKE '%Guide%';
Q25
Single Choice

How would you exclude all cities ending with 'ville'?

SQL Code
SELECT City
FROM Locations
WHERE City NOT LIKE '%ville';
Q26
Single Choice

Which query excludes all email addresses containing 'yahoo'?

SQL Code
SELECT Email
FROM Contacts
WHERE Email NOT LIKE '%yahoo%';
Q27
Single Choice

How would you exclude all phone numbers ending with '789'?

SQL Code
SELECT PhoneNumber
FROM Directory
WHERE PhoneNumber NOT LIKE '%789';
Q28
Single Choice

Which query excludes all product names containing 'Ultra'?

SQL Code
SELECT ProductName
FROM Products
WHERE ProductName NOT LIKE '%Ultra%';
Q29
Single Choice

How would you exclude all usernames starting with 'admin'?

SQL Code
SELECT Username
FROM Users
WHERE Username NOT LIKE 'admin%';
Q30
Single Choice

Which query excludes all last names containing 'Doe'?

SQL Code
SELECT LastName
FROM Employees
WHERE LastName NOT LIKE '%Doe%';
Q31
Multiple Choice

Which of the following queries excludes all rows where the product name contains 'Test'?

SQL Code
SELECT ProductName
FROM Products
WHERE ProductName NOT LIKE '%Test%';
Q32
Multiple Choice

Which queries exclude all rows where the username starts with 'user'?

SQL Code
SELECT Username
FROM Users
WHERE Username NOT LIKE 'user%';
Q33
Multiple Choice

Which queries exclude all rows where the email contains 'example'?

SQL Code
SELECT Email
FROM Contacts
WHERE Email NOT LIKE '%example%';
Q34
Multiple Choice

Which of the following queries excludes all rows where the phone number ends with '000'?

SQL Code
SELECT PhoneNumber
FROM Directory
WHERE PhoneNumber NOT LIKE '%000';
Q35
Multiple Choice

Which queries exclude all rows where the city name contains 'New'?

SQL Code
SELECT City
FROM Locations
WHERE City NOT LIKE '%New%';
Q36
Multiple Choice

Which queries exclude all rows where the last name starts with 'M'?

SQL Code
SELECT LastName
FROM Employees
WHERE LastName NOT LIKE 'M%';
Q37
Multiple Choice

Which of the following queries excludes all rows where the company name contains 'Tech'?

SQL Code
SELECT CompanyName
FROM Companies
WHERE CompanyName NOT LIKE '%Tech%';
Q38
Multiple Choice

Which queries exclude all rows where the department name starts with 'Sales'?

SQL Code
SELECT DepartmentName
FROM Departments
WHERE DepartmentName NOT LIKE 'Sales%';
Q39
Multiple Choice

Which queries exclude all rows where the order ID contains '123'?

SQL Code
SELECT OrderID
FROM Orders
WHERE OrderID NOT LIKE '%123%';
Q40
Multiple Choice

Which queries exclude all rows where the employee ID ends with '456'?

SQL Code
SELECT EmployeeID
FROM Employees
WHERE EmployeeID NOT LIKE '%456';
Q41
Multiple Choice

Which of the following queries excludes all rows where the first name contains 'John'?

SQL Code
SELECT FirstName
FROM Employees
WHERE FirstName NOT LIKE '%John%';
Q42
Multiple Choice

Which queries exclude all rows where the city name starts with 'San'?

SQL Code
SELECT City
FROM Locations
WHERE City NOT LIKE 'San%';
Q43
Multiple Choice

Which of the following queries excludes all rows where the email ends with 'domain.com'?

SQL Code
SELECT Email
FROM Contacts
WHERE Email NOT LIKE '%domain.com';
Q44
Multiple Choice

Which queries exclude all rows where the country name contains 'land'?

SQL Code
SELECT CountryName
FROM Countries
WHERE CountryName NOT LIKE '%land%';
Q45
Multiple Choice

Which of the following queries exclude all rows where the job title starts with 'Manager'?

SQL Code
SELECT JobTitle
FROM Jobs
WHERE JobTitle NOT LIKE 'Manager%';