Wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

sql lab

Total questions: 20

Worksheet time: 10mins

Name
Class
Date
1.

How could we choose only unique values in a query?

a)

SELECT UNIQUE

b)

SELECT DISTINCT

c)

SELECT SPECIAL

d)

SELECT WITH NO DUPLICATE

2.

What is the syntax to enter a new record into the "Sales" table?

a)

INSERT INTO Sales VALUES

b)

ALTER SALES NEW VALUES

c)

SALES = SALES + NEW VALUES

d)

SALES.ALTER.EDIT.CHANGE

3.

What is the syntax to create a new table?

a)

CREATE TABLE

b)

MAKE TABLE

c)

GENERATE TABLE

d)

NEW TABLE

4.

Which command is used for removing a table and all its data from the database:

a)

Create command

b)

Drop table command

c)

Alter table command

d)

All of the mentioned

5.

SELECT * FROM Students WHERE Gender="Female" AND Class=2.2

would return how many records?

a)

1

b)

2

c)

3

d)

4

6.

SELECT * FROM cars WHERE Doors > 3

would return how many records?

a)

1

b)

2

c)

3

d)

4

7.

A primary key can be NULL in the table? TRUE or FALSE

a)

TRUE

b)

FALSE

8.

What is a ‘tuple’?

a)

A row or record in a database table

b)

Another name for the key linking different tables in a database.

c)

An attribute attached to a record.

d)

Another name for a table in an RDBMS.

9.

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

a)

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

b)

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

c)

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

10.

A keyword that use in sql syntax that gives a temporary name in the table column?

a)

US

b)

AS

c)

ALIASES

d)

SQL SYNTAX

11.

Records that generate the matching values in both table

a)

Right join

b)

Inner join

c)

Cross join

d)

Case Statement

12.

What does SQL stand for?

a)

Structured Query Language   

b)

Strong Question Language

c)

Structured Question Language

13.

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

a)

SELECT 

b)

EXTRACT

c)

GET

d)

OPEN

14.

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

a)

SELECT * FROM Persons  

b)

SELECT *.Persons

c)

SELECT Persons

d)

SELECT [all] FROM Persons

15.

What is the difference between WHERE and HAVING?

a)

HAVING only applies to aggregate functions like GROUP BY

b)

There are interchangeable

c)

WHERE specifies a GEOGRAPHIC location for a database server

d)

WHERE has limited use

16.

Why make views?

a)

It is faster, safer and better practice to not allow general access to the production database

b)

You should not, they are slow

c)

You should not, they are inefficient

d)

"View" is simply a synonym for the return of the SELECT function

17.

A database management system (DBMS) is a collection of programs that enables users to

a)

create a database

b)

manipulate a database

c)

both create and manipulate a database

d)

for storing data only

18.

Data in a database is stored in a .......... .

a)

Tables

b)

Fields

c)

single flat file

19.

ORDER BY specifies ...................................

a)

the criteria you need to find the information

b)

the table(s) that contain(s) the information

c)

the information you want to find within the database

d)

how the data is organized (sorted) when it is retrieved.

20.

The SQL DELETE statement has the following structure:

a)

DELETE FROM

Table

WHERE

Condition

b)

DELETE FROM

Table

WHERE

Record

c)

DELETE FROM

Field

WHERE

Table