Font size
WorksheetsLearning SQL
Total questions: 15
Worksheet time: 19mins
A database is needed to store the video game rentals for a store.
Write the SQL command to create the database "Game_Rental".
(a)
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)
Insert a record into the Cus_info table:
CID - A004, DOB- 2002/03/15
(a)
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)
Look at the DB picture, and write a SQL query to show the ID#, Name from the Student_Info Table
(a)
Using the DB picture, Write a SQl query to show the Name and Class for male students
(a)
Using the picture, write an SQL update query to change John Mark's class to '5C'.
(a)
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
SELECT ID#.Student_Info
SELECT ID#.Payment_Info
SELECT ID#
SELECT Student_info.ID#
Which of the following is the SQL keyword to make changes to a database table or field
SELECT
SET
INSERT INTO
ALTER
To sort the results in a query, which is the correct SQL keyword to use
GROUP BY
SORT BY
ORDER BY
GROUP WHERE
Which SQL keywords are used when using data from multiple tables
SELECT
FROM
WHERE
ON
UPDATE
SET
JOIN
WHERE
SELECT
FROM
INNER JOIN
ON
WHERE
SELECT
FROM
WHERE
ALTER
JOIN
What SQL constraint is used to indicate that a field should not be EMPTY
(a)
What is the SQL keyword used to set a field to the datatype TEXT or ALPHANUMERIC?
(a)
In SQL ascending order keyword is ____ while descending order keyword ____
Asc, Des
ASC, DESC
ASCENDING, DESCENDING
ASCN, DESN
THE ' * ' symbol in a query does what?
select fields with * in the data from the table
Select the fields written after it from the table
Select all fields from the table
This symbol is Not used in SQL
