NEW
Font size
S
M
L
XL
WorksheetsAdvanced SQL
Total questions: 10
Worksheet time: 10mins
Name
Class
Date
1.
Which of the term is used to describe fields in a database?
a)
Information
b)
Rows
c)
Properties
d)
Entity
2.
Trigger is invoked before/after data row is:
a)
deleted
b)
updated
c)
inserted
d)
all answers are correct
3.
Below are the Data Definition Command, EXCEPT
a)
CREATE
b)
ALTER
c)
MERGE
d)
SELECT
4.
The SQL command to create a new user with password is: CREATE USER
‘YJChin’@’localhost’ IDENTIFIED BY ‘password123’
a)
FALSE
b)
TRUE
5.
Which of the following is the correct command to create a view?
a)
CREATE VIEW Inv_1 AS
b)
SELECT VIEW Inv_1 FROM
c)
CREATE TABLE VIEW Inv_1 AS
d)
CREATE VIEW TABLE Inv_1 FROM
6.
What command to use if I want to execute the stored procedure through Xampp?
a)
EXECUTE
b)
EXEC
c)
CALL
d)
CALLING
7.
Below are the procedural SQL that can be used to enhance the power of SQL, EXCEPT:
a)
Triggers
b)
Stored procedures
c)
Function
d)
View
8.
Assume that you have the following:
CREATE FUNCTION totalPaidByCust(custID INT)
........
END
If you want to query the function, the command will be:
CREATE FUNCTION totalPaidByCust(custID INT)
........
END
If you want to query the function, the command will be:
a)
CALL totalPaidByCust(3);
b)
SELECT totalPaidByCust(3);
c)
EXECUTE totalPaidByCust(3);
d)
None of the answer is correct
9.
Which SQL statement can eliminate duplicate rows?
a)
SELECT UNIQUE
b)
SELECT DIFFERENT
c)
SELECT INDEX
d)
SELECT DISTINCT
10.
Which of the following command is correct?
a)
CREATE TRIGGER SumTotal AFTER CREATE ON
b)
CREATE TRIGGER SumTotal AFTER DROP ON
c)
CREATE TRIGGER SumTotal AFTER DELETE ON
d)
CREATE TRIGGER SumTotal AFTER SELECT ON
Reset
