wayground logo

Free Printable Worksheets

Font size

S
M
L
XL
Worksheets

Learning SQL

Total questions: 15

Worksheet time: 19mins

Name
Class
Date
1.

A database is needed to store the video game rentals for a store.

Write the SQL command to create the database "Game_Rental".

(a)  

2.

The Game_Rental Database has a table for customer information with the fields

CID :field size: 4, data type: text

DOB: data type: date

Write the SQL command to create the "Cus_Info" table



(a)  

3.

Insert a record into the Cus_info table:

CID - A004, DOB- 2002/03/15

(a)  

4.

Write SQL to create the "Games" table with GID as the primary key. No field should be empty

GID - field size: 5, Datatype: text

cost - Datatype: float

(a)  

5.

Look at the DB picture, and write a SQL query to show the ID#, Name from the Student_Info Table

(a)  

6.

Using the DB picture, Write a SQl query to show the Name and Class for male students

(a)  

7.

Using the picture, write an SQL update query to change John Mark's class to '5C'.

(a)  

8.

A query is written to show ID#, Name, Receipt number and Balance for all students. Because ID# is in both tables, identify the correct way to write this in the SELECT statement

a)

SELECT ID#.Student_Info

b)

SELECT ID#.Payment_Info

c)

SELECT ID#

d)

SELECT Student_info.ID#

9.

Which of the following is the SQL keyword to make changes to a database table or field

a)

SELECT

b)

SET

c)

INSERT INTO

d)

ALTER

10.

To sort the results in a query, which is the correct SQL keyword to use

a)

GROUP BY

b)

SORT BY

c)

ORDER BY

d)

GROUP WHERE

11.

Which SQL keywords are used when using data from multiple tables

a)

SELECT

FROM

WHERE

ON

b)

UPDATE

SET

JOIN

WHERE

c)

SELECT

FROM

INNER JOIN

ON

WHERE

d)

SELECT

FROM

WHERE

ALTER

JOIN

12.

What SQL constraint is used to indicate that a field should not be EMPTY

(a)  

13.

What is the SQL keyword used to set a field to the datatype TEXT or ALPHANUMERIC?

(a)  

14.

In SQL ascending order keyword is ____ while descending order keyword ____

a)

Asc, Des

b)

ASC, DESC

c)

ASCENDING, DESCENDING

d)

ASCN, DESN

15.

THE ' * ' symbol in a query does what?

a)

select fields with * in the data from the table

b)

Select the fields written after it from the table

c)

Select all fields from the table

d)

This symbol is Not used in SQL