wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Quiz#1 - SQL Part 1 (Information Management)

Total questions: 20

Worksheet time: 5mins

Name
Class
Date
1.

What does SQL stand for?

a)

Structured Query Logic

b)

Simple Query Language

c)

Structured Query Language

d)

Systematic Query Language

2.

Which of the following is a correct SQL command to create a database?

a)

NEW DATABASE myDB;

b)

CREATE DATABASE myDB;

c)

MAKE DATABASE myDB;

d)

INIT DATABASE myDB;

3.

Which SQL command would you use to remove all data from a table without deleting the table itself?

a)

DELETE TABLE Students;

b)

REMOVE Students;

c)

TRUNCATE TABLE Students;

d)

DROP TABLE Students;

4.

Which data type category includes varchar and text?

a)

Numeric

b)

Date and Time

c)

Binary Strings

d)

Character Strings

5.

Which of the following is a logical operator in SQL?

a)

+

b)

=

c)

AND

d)

%

6.

Which SQL command modifies a column’s data type in an existing table?

a)

CHANGE COLUMN

b)

ALTER COLUMN

c)

MODIFY COLUMN

d)

UPDATE COLUMN

7.

Which constraint ensures that a column cannot contain duplicate values?

a)

NOT NULL

b)

PRIMARY KEY

c)

DAFAULT

d)

UNIQUE

8.

What does the FOREIGN KEY constraint do?

a)

Prevents NULL values

b)

Links records to another table

c)

Sets a default value

d)

Ensures a value is within a range

9.

Which is the correct syntax to create a PRIMARY KEY during table creation?

a)

PRIMARY (StudentID);

b)

UNIQUE KEY StudentID;

c)

StudentID PRIMARY KEY;

d)

KEY StudentID PRIMARY;

10.

Which command is used to add a CHECK constraint on an existing table?

a)

MODIFY TABLE ADD CHECK (condition);

b)

CHECK ON TABLE (condition);

c)

ALTER TABLE ADD CHECK (condition);

d)

ALTER TABLE CHECK ADD (condition);

11.

A query is a specific request for data manipulation issued by the end-user or an application.

a)

TRUE

b)

FALSE

12.

The command DROP TABLE Students; removes all the data from the table but keeps the table structure.

a)

TRUE

b)

FALSE

13.

The DEFAULT constraint is used to ensure all values in a column are unique.

a)

TRUE

b)

FALSE

14.

varchar, nchar, and nvarchar are examples of character string data types in SQL.

a)

TRUE

b)

FALSE

15.

The ALTER TABLE command can be used to both add and drop columns in an existing table.

a)

TRUE

b)

FALSE

16.

SQL commands are case-sensitive, meaning SELECT and select are treated differently.

a)

TRUE

b)

FALSE

17.

The CHECK constraint is used to enforce a condition on the values in a column.

a)

TRUE

b)

FALSE

18.

The EXISTS and BETWEEN operators are types of arithmetic operators in SQL.

a)

TRUE

b)

FALSE

19.

A column defined with the NOT NULL constraint must always have a value.

a)

TRUE

b)

FALSE

20.

SQL is only compatible with Microsoft SQL Server and not with other databases like MySQL or Oracle.

a)

TRUE

b)

FALSE