wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Database Quiz 4 SQL

Total questions: 21

Worksheet time: 20mins

Name
Class
Date
1.

SQL is a declarative programming language

a)

True

b)

False

2.

The syntax for INSERT INTO statement is:

INSERT INTO table_name (column1, column2, …) (a)   (value1, value2, …)

3.

Which statement involve syntax of SET?

(a)  

4.

The syntax for a SELECT query in SQL is:

a)

SELECT table_names FROM field_name WHERE condition ORDER BY field_name

b)

SELECT field_names FROM table_name WHERE condition ORDER BY table_name

c)

SELECT table_names FROM field_name WHERE condition ORDER BY table_name

d)

SELECT field_names FROM table_name WHERE condition ORDER BY field_name

5.

The query to print the complete table Student is: SELECT * FROM Student

a)

True

b)

False

6.

The syntax for deleting a field using an ALTER TABLE statement is:

ALTER TABLE table_name

(a)   field_name

7.

The ORDER BY clause by default orders in (a)   order.

8.

Operator for Not equal to is:

(a)  

9.

The syntax for modifying the data type of a field using an ALTER TABLE statement is:

ALTER TABLE table_name

(a)  

10.

A (a)   symbol is used for field_names if all columns are to be displayed.

11.

Wildcard characters substitute other characters in a string. These characters are used with a (a)   operator.

12.

How to write condition to select people who was born in 2023:

SELECT * FROM Student

WHERE DateOfBirth (a)  

13.

(a)   represents zero or more characters

14.

(a)   represents a single character

15.

Which of the following query can have the result shown in the picture?

a)

SELECT * FROM Student WHERE DateOfBirth>=01/01/1999 ORDER BY Major,  StudentName DESC

b)

SELECT * FROM Student WHERE DateOfBirth>=#01/01/1999# ORDER BY Major,  StudentName

c)

SELECT * FROM Student WHERE DateOfBirth>=#01/01/1999# ORDER BY Major,  StudentName DESC

d)

SELECT * FROM Student WHERE DateOfBirth>=#01/01/1999# ORDER BY Major DESC,  StudentName

16.

DELETE statement is used to remove data from a table. The syntax for using this statement is:

(a)   table_name WHERE condition

17.

DELETE statement is used to remove data from a table. The syntax for using this statement is:

(a)   table_name WHERE condition

18.

Which  statement is used to combine two or more tables and the tables are combined based on a field that is common for both tables.

(a)  

19.

To add new records, (a)   statement is used.

20.

The numbers in the brackets of CHAR represent (a)   of digits a data type can hold.

21.

The SQL query to create the table ‘CourseGrade’ is:

CREATE TABLE CourseGrade (

FOREIGN KEY CourseID ________ Course (CourseID),

FOREIGN KEY StudentID ________ Student (StudentID),

Grades CHAR(1))

(a)