On Tap 1
On Tap 1
On Tap 1
Question 1
Complete
Select one:
A way to establish a loop in SQL
Question 2
Complete
A domain of PaymentMethod attributes in Invoice relation have 2 types: Cash, Transfer. Which statement is used to validate the data entries?
Select one:
…CHECK PaymentMethod = (‘Cash’,’Transfer’)
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 1/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 3
Complete
A relationship is when both participants in the relationship are the same entity set is called
Select one:
Ternary
N-ary
Binary
Unary
Question 4
Complete
Select one:
a single table in the database
Question 5
Complete
Select one:
All of the others
The syntax to remove a trigger is: DROP TRIGGER < trigger_name >
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 2/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 6
Complete
Give the SQL statement: SELECT * FROM Worker WHERE first_name like '%a%'
Select one:
This statement is used to print details of the workers whose first_name begins with ‘a’
This statement is used to print details of the workers whose first_name ends with ‘a’
This statement is used to print details of the workers whose first_name begins and ends with ‘a’
This statement is used to print details of the workers whose first_name contains ‘a’
The correct answer is: This statement is used to print details of the workers whose first_name contains ‘a’
Question 7
Complete
Select one:
Four
One
Three
Two
Question 8
Complete
In SQL, Students(Stu_ID, Stu_Name, Stu_Age, Stu_Sex) . How can you return the number of record in the “Students” table? Choose the correct
answer(s).
The correct answers are: Select count(*) from Students, Select count(Stu_ID) from Students
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 3/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 9
Complete
Select one:
Substring is ‘SQL’ and x=3
Question 10
Complete
Select one:
DML
DDL
XML
HTML
Question 11
Complete
Suppose there are two relations R1(A, B,C, D) and R2(E, F, G). A referential integrity constraint from attribute G of R2 to attribute A of R1,
where A is a primary key of R1. Which of the followings can violate this constraint? (Choose the correct answers)
The correct answers are: Insert a new tuple to the relation R2, Delete an exist tuple from the relation R1
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 4/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 12
Complete
Suppose you want to compare three keys (‘Primary Key’, ‘Super Key’, and ‘Candidate Key’) in database. Which of the following option(s)
is/are correct?
The correct answers are: Minimal super key is a Candidate Key., Only one Candidate Key can be Primary Key.
Question 13
Complete
The difference between PRIMARY KEY constraint and UNIQUE constraint is_________
Select one:
These constraints are not different.
The data of field has UNIQUE constraint that can be NULL, otherwise to PRIMARY KEY constraint.
The data of field has PRIMARY constraint that can be NULL, otherwise to UNIQUE constraint
The correct answer is: The data of field has UNIQUE constraint that can be NULL, otherwise to PRIMARY KEY constraint.
Question 14
Complete
The following SQL in which type of join: Select Student.StudentID, Test.StudentID, S_Name From Student, Test;
Select one:
Natural join
Equi-join
Cartesian join
Outer join
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 5/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 15
Complete
The join, which connect two tuples with the same values in their same attributes, is called as ____________________
Select one:
Equal join
Theta join
Natural join
Outer join
Question 16
Complete
Select one:
Providing a quicker way to store data.
The correct answer is: Providing rapid, random and sequential access to base-table data.
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 6/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 17
Complete
Select one:
Underscore (_); Question mark (?)
Question 18
Complete
Select one:
Each subset is a super key
Question 19
Complete
Select one:
Combines the output from no more than two queries and must include the same number of columns.
Combines the output from no more than two queries and does not include the same number of columns
Combines the output from multiple queries and does not include the same number of columns.
Combines the output from multiple queries and must include the same number of columns.
The correct answer is: Combines the output from multiple queries and must include the same number of columns.
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 7/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 20
Complete
Using SQL Server 2000, which of the following symbols is used to indicate parameters in stored procedures?
Select one:
@
&
Question 21
Complete
Select one:
All of the answers
Scalar Functions
Question 22
Complete
When three or more AND and OR conditions are combined, it is easier to use the SQL keyword(s):
Select one:
NOT IN
IN and NOT IN
LIKE
IN
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 8/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 23
Complete
Which is/are the correct SQL statement(s) when you want to return MaVT which have the highest purchase price (GiaMua)?
select MaVT from VATTU where GiaMua = (select max(GiaMua) from VATTU)
select MaVT from VATTU where GiaMua = (select top 1 MaVT from VATTU Order by GiaMua desc)
select MaVT from VATTU where GiaMua>= all(select GiaMua from VATTU)
The correct answers are: select MaVT from VATTU where GiaMua = (select top 1 MaVT from VATTU Order by GiaMua desc), select MaVT
from VATTU where GiaMua = (select max(GiaMua) from VATTU), select MaVT from VATTU where GiaMua in (select max(GiaMua) from
VATTU), select MaVT from VATTU where GiaMua>= all(select GiaMua from VATTU)
Question 24
Complete
Select one:
Primary key has only one attribute
Two tuples can have only the same values on primary key ‘s components
The correct answer is: Every relation must have only one primary key
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 9/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 25
Complete
Select one:
Sum
Count
Max
Question 26
Complete
Select one:
CHECK
FOREIGN KEY
PRIMARY KEY
UNIQUE
ALTERNATE KEY
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 10/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 27
Complete
Which of the following is one of the basic approaches for joining tables?
Select one:
All of the above
Union join
Subqueries
Natural join
Question 28
Complete
Select one:
They can not cascade (Cause another trigger to fire).
The correct answer is: They have an event, condition, and action.
Question 29
Complete
Which of the following statement(s) is/are true about “HAVING” and “WHERE” clauses in SQL?
“WHERE” is always used before “GROUP BY” and “HAVING” before “GROUP BY”.
“WHERE” is always used before “GROUP BY” and “HAVING” after “GROUP BY”.
The correct answers are: “WHERE” is always used before “GROUP BY” and “HAVING” after “GROUP BY”., “WHERE” is used to filter rows but
“HAVING” is used to filter groups.
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 11/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 30
Complete
Which of the following statement(s) is/are true about “HAVING” and “WHERE” clauses in SQL?
“WHERE” is always used before “GROUP BY” and “HAVING” before “GROUP BY”.
The correct answers are: “WHERE” is always used before “GROUP BY” and “HAVING” after “GROUP BY”., “WHERE” is used to filter rows but
“HAVING” is used to filter groups.
Question 31
Complete
Select one:
Both are stored in the database.
Question 32
Complete
Select one:
Aggregate functions
Expression
Operator
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 12/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 33
Complete
Which SQL statement allows you to list all stores with Quantity_sales totals over 1000? SELLING_DETAILS(StoreNum, DateOfSale,
Quantity_Sales)
Select one:
SELECT StoreNum, SUM(Quantity_Sales) FROM SELLING GROUP BY StoreNum HAVING SUM(Quantity_Sales) > 1000;
SELECT StoreNum, SUM(Quantity_Sales) FROM SELLING GROUP BY StoreNum HAVING Quantity_Sales > 1000;
SELECT StoreNum, SUM(Quantity_Sales) FROM SELLING WHERE sum(Quantity_Sales )> 1000 GROUP BY StoreNum;
SELECT StoreNum, SUM(Quantity_Sales) FROM SELLING WHERE Quantity_Sales > 1000 GROUP BY StoreNum;
The correct answer is: SELECT StoreNum, SUM(Quantity_Sales) FROM SELLING GROUP BY StoreNum HAVING SUM(Quantity_Sales) > 1000;
Question 34
Complete
Select one:
SELECT
INSERT
DELETE
UPDATE
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 13/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 35
Complete
Which statement is use to add FOREIGN KEY constraint into Student table (IdClass is a foreign key which refer to Class table)
Select one:
ADD FKStudent FOREIGN KEY(IdClass) REFERENCES Class(IdClass)
Question 36
Complete
Which statement is used to insert data from table HREmp to table Employee
Select one:
INSERT INTO Employee VALUES (SELECT * FROM HREmp)
The correct answer is: INSERT INTO Employee SELECT * FROM HREmp
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 14/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 37
Complete
Which statement is used to modify the value of Address in table Student selected from Addr column in table Enroll?
Select one:
UPDATE Student SET Address = (SELECT Addr FROM Enroll Student.Id = Enroll.Id)
UPDATE Student SET Addr = (SELECT Address FROM Enroll Student.Id = Enroll.Id)
The correct answer is: UPDATE Student SET Address = (SELECT Addr FROM Enroll Student.Id = Enroll.Id)
Question 38
Complete
Which statement(s) is/are used to delete all data but keep the structure of table Student
TRUNCATE Student
The correct answers are: DELETE FROM Student, TRUNCATE TABLE Student
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 15/16
3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review
Question 39
Complete
Select one:
Teacher_Code, Course_No, Semester_No
Question 40
Complete
Select one:
Properties of relationship
The correct answer is: Properties of relationship, Properties of members of an entity set
https://lmsdn.fpt.edu.vn/mod/quiz/review.php?attempt=24328&cmid=6113 16/16