Introduction to SQL - Technical MCQs

Q1:

The SQL keyword(s) ________ is used with wildcards.

A LIKE only

B IN only

C NOT IN only

D IN and NOT IN

ANS:A - LIKE only

A wildcard character can be used to substitute for any other character(s) in a string. SQL wildcards are used to search for data within a table.

For Example1:
SELECT * FROM Customers
WHERE City LIKE 'ber%';
//Displays table containing city starting with Ber...//

For Example2:
SELECT * FROM Customers
WHERE City LIKE '%es%';
//Displays table containing city ending with es...//