wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

SQL Fundamentals_Amr

Total questions: 50

Worksheet time: 24mins

Name
Class
Date
1.

What does SQL stand for?

a)

Structured Query Language

b)

Standard Query Language

c)

Strong Query Langauge

2.

Which SQL statement is used to extract data from a database?

a)

EXTRACT

b)

Get

c)

OPEN

d)

SELECT

3.

Which SQL statement is used to update data in a database?

a)

MODIFY

b)

SAVE AS

c)

UPDATE

d)

SAVE

4.

Which SQL statement is used to delete data from a database?

a)

Modify

b)

DELETE

c)

MOVE

5.

Which SQL statement is used to insert new data in a database?

a)

ADD RECORD

b)

INSERT NEW

c)

INSERT INTO

d)

ADD NEW

6.

_______used to Create, Manage database objects in the database.

a)

DDL

b)

DML

c)

DCL

d)

DQL

7.

You issue the following query: SELECT empno, ename FROM emp WHERE empno = 7782 OR empno = 7876;   Which other operator can replace the OR condition in the WHERE clause

a)

IN

b)

BETWEEN.. AND..

c)

LIKE

8.

Roll Back segment is not used in case of:

a)

DCL

b)

DDL

c)

DQL

d)

All of the above

9.

You query the table with this commandSELECT nameFROM employeeWHERE name LIKE '_a%'; Which names are displayed? 

a)

Names starting with “a”

b)

Names containing “a” as any letter except the first

c)

Names containing “a” as second character

d)

Names starting with “a” or “A”

10.

How does a TRUNCATE TABLE statement differ from an unrestricted DELETE? Select all that apply.

a)

Using TRUNCATE all the values in the table will be deleted but not the structure whereas as In Delete a particular row can be deleted but not the structure

b)

Using TRUNCATE all the values in the table will be deleted and the structure as well but whereas as In Delete a particular row can be deleted but not the structure

c)

Using TRUNCATE all the values in the table will be deleted but not the structure whereas as In Delete a particular row can be deleted and the structure as well

d)

None of the Above

11.

How many columns are retrieved from this query: SELECT address1||','||address2||','||address2 "Address" FROM  employee;

a)

1

b)

2

c)

3

d)

4

12.

The following are clauses of the SELECT statement:1. WHERE 2. FROM 3. ORDER BY In which order should they appear in a query? 

a)

1, 3, 2

b)

2, 1, 3

c)

2, 3, 1

13.

With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?

a)

DELETE FROM Persons WHERE FirstName = 'Peter'

b)

DELETE FirstName='Peter' FROM Persons

c)

DELETE ROW FirstName='Peter' FROM Persons

d)

DELETE Persons WHERE FirstName = 'Peter'

14.

With SQL, how do you select a column named "FirstName" from a table named "Persons"?

a)

SELECT Persons. FirstName

b)

SELECT First Name FROM persons

c)

SELECT FirstName FROM Persons

d)

EXTRACT FirstName FROM Persons

15.

Which command will delete all data from a table and will not write to the rollback segment?

a)

Drop

b)

Cascade

c)

Truncate

d)

Delete

16.

Which of the following are parts of a SELECT statement? Choose all that apply. 

a)

FROM

b)

DEFINE

c)

WHERE

d)

DESELECT

17.

Which of the following statements contains an error?

a)

SELECT * FROM emp WHERE empid = 493945;

b)

SELECT empid FROM emp;

c)

SELECT empid FROM emp WHERE empid= 493945;

d)

SELECT empid WHERE empid = 56949 AND lastname = ‘SMITH’;

18.

How can you change "Hansen" into "Nilsen" in the "LastName" column in the Persons table? 

a)

UPDATE Persons SET LastName='Nilsen' WHERE LastName='Hansen'

b)

MODIFY Persons SET LastName='Hansen' INTO LastName='Nilsen

c)

UPDATE Persons SET LastName='Hansen' INTO LastName='Nilsen'

d)

MODIFY Persons SET LastName='Nilsen' WHERE LastName='Hansen'

19.

Choose correct syntax to insert values into r4r_team table 

a)

INSERT INTO r4r_team (id, username, exp) VALUES (1, ‘r4r01’, ‘2’);

b)

INSERT IN r4r_team VALUES (1, ‘r4r01’, ‘2’);

c)

INSERT INTO r4r_team (id, username, exp) VALUE (1, ‘r4r01’, ‘2’);

d)

INSERT INTO table r4r_team (id, username, exp) VALUE (1, ‘r4r01’, ‘2’);

20.

With SQL, how do you select all the columns from a table named "Persons"?  

a)

SELECT [all] FROM Persons

b)

SELECT * FROM Persons

c)

SELECT *.Persons

d)

SELECT Persons

21.

With SQL, how can you insert "Olsen" as the "LastName" in the "Persons" table?

a)

INSERT INTO Persons ('Olsen') INTO LastName

b)

INSERT INTO Persons (LastName) VALUES ('Olsen')

c)

INSERT ('Olsen') INTO Persons (LastName)

d)

INSERT IN Persons ('Olsen') INTO LastName

22.

With SQL, how can you insert a new record into the "Persons" table?

a)

INSERT ('Jimmy', 'Jackson') INTO Persons

b)

INSERT Persons values ('Jimmy', 'Jackson')

c)

INSERT INTO Persons VALUES ('Jimmy', 'Jackson')

d)

INSERT VALUES ('Jimmy', 'Jackson') INTO Persons

23.

Which Operators combine the results of two-component queries into a single result?

a)

Character Operators

b)

Comparison Operators

c)

Set Operators

d)

Miscellaneous Operators

24.

With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?

a)

SELECT FROM Persons WHERE FirstName='%a%'

b)

SELECT FROM Persons WHERE FirstName LIKE '%a'

c)

SELECT FROM Persons WHERE FirstName='a'

d)

SELECT FROM Persons WHERE FirstName LIKE 'a%'

25.

The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true

a)

True

b)

False

26.

Which SQL statement is used to return only different values?

Next ❯

a)

SELECT DIFFERENT

b)

SELECT UNIQUE

c)

SELECT DISTINCT

27.

Which SQL keyword is used to sort the result-set?

a)

ORDER BY

b)

SORT BY

c)

ORDER

d)

SORT

28.

With SQL, how can you delete the records where the "FirstName" is "Peter" in the Persons Table?

a)

DELETE FirstName='Peter' FROM Persons

b)

DELETE ROW FirstName='Peter' FROM Persons

c)

DELETE FROM Persons WHERE FirstName = 'Peter'

29.

With SQL, how can you return the number of records in the "Persons" table?

a)

SELECT LEN(*) FROM Persons

b)

SELECT COUNT(*) FROM Persons

c)

SELECT COLUMNS(*) FROM Persons

d)

SELECT NO(*) FROM Persons

30.

What is the most common type of join?

a)

JOINED TABLE

b)

INSIDE JOIN

c)

JOINED

d)

INNER JOIN

31.

Which operator is used to select values within a range?

a)

RANGE

b)

BETWEEN

c)

WITHIN

32.

Which operator is used to search for a specified pattern in a column?

a)

GET

b)

LIKE

c)

FROM

33.

Which SQL function is used to count the number of rows in a SQL query?

a)

COUNT()

b)

NUMBER()

c)

SUM()

34.

The FROM SQL clause is used to…

a)

Specify range for search condition

b)

Specify search condition

c)

Specify what table we are selecting or deleting data from.

35.

Which of the following is NOT a SQL keyword or SQL clause?

a)

INSERT

b)

SELECT

c)

UPDATE

d)

INVERT

36.

The UNION SQL clause can be used with…

a)

The SELECT clause only

b)

The DELETE and UPDATE clauses

c)

The UPDATE clause only

d)

None of the other three

37.

What does DML stand for?

a)

Data Mode Lane

b)

Data Model Language

c)

Data Manipulation language

d)

Different Mode Level

38.

Which SQL keyword is used to retrieve a maximum value?

a)

MOST

b)

MAX

c)

TOP

d)

UPPER

39.

Which of the following SQL clauses is used to enter data into a SQL table?

a)

INSERT INTO

b)

WRITE

c)

SELECT

d)

ENTER

40.

Which of the following SQL clauses is used to DELETE data from a database table?

a)

DELETE

b)

REMOVE

c)

DROP DATA

d)

CLEAR

41.

Which of the following SQL statements is correct?

a)

SELECT CustomerName, COUNT(CustomerName) FROM Orders

b)

SELECT CustomerName, COUNT(CustomerName) FROM Orders GROUP BY CustomerName

c)

SELECT CustomerName, COUNT(CustomerName) FROM Orders ORDER BY CustomerName

42.

If you don't specify ASC or DESC after a SQL ORDER BY clause, the following is used by default:

a)

ASC

b)

DESC

c)

There is no default value.

43.

When inserting data in a table do you always have to specify a list of all column names you are inserting values for?

a)

No

b)

Yes

44.

Which of the following 3 SQL statements is correct?

a)

SELECT Username, Password FROM Users

b)

SELECT Username AND Password FROM Users

c)

SELECT Username, Password WHERE Username = 'user1'

45.

What does follow after the SQL WHERE clause?

a)

Definition of the condition to be met for the rows to be returned.

b)

A list of columns to be selected.

c)

The name of the table we are selecting from.

46.

What does the ALTER TABLE clause do?

a)

The SQL ALTER TABLE clause modifies a table definition by altering, adding, or deleting table columns and/or constraints.

b)

The SQL ALTER TABLE clause is used to insert data into database table.

c)

THE SQL ALTER TABLE deletes data from database table.

d)

The SQL ALTER TABLE clause is used to delete a database table.

47.

What is the purpose of the SQL AS clause?

a)

The AS SQL clause is used change the name of a column in the result set

b)

The AS clause is used with the JOIN clause only.

c)

The AS clause defines a search condition.

48.

The IN SQL keyword…

a)

Is used with the DISTINCT SQL keyword only.

b)

Determines if a value matches any of the values in a list or a sub-query.

c)

Defines the tables we are selecting or deleting data from

49.

The UPDATE SQL clause can…

a)

Update only one row at a time.

b)

Update more than one row at a time.

c)

Delete more than one row at a time.

d)

Delete only one row at a time..

50.

Which of the following statements gets the total value of the column 'Price' in the 'Sales' table?

a)

SELECT ADD(Price) FROM Sales

b)

SELECT SUM(Price) FROM Sales

c)

SELECT TOTAL(Price) FROM Sales

d)

SELECT SUM(Price) WHERE Sales