Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

On Tap 1

Download as pdf or txt
Download as pdf or txt
You are on page 1of 16

3/23/2021 Progress test 2 (L04, L05, L06, L07) Date 23_03_2021: Attempt review

Started on Tuesday, 23 March 2021, 4:29 PM


State Finished
Completed on Tuesday, 23 March 2021, 5:14 PM
Time taken 45 mins
Marks 28.17/40.00
Grade 7.04 out of 10.00 (70%)

Question 1
Complete

Mark 1.00 out of 1.00

A CASE SQL statement is which of the following?

Select one:
A way to establish a loop in SQL

A way to establish a data definition in SQL

All of the above

A way to establish an IF-THEN-ELSE in SQL

The correct answer is: A way to establish an IF-THEN-ELSE in SQL

Question 2
Complete

Mark 0.00 out of 1.00

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’)

…CHECK PaymentMethod IN (‘Cash’,’Transfer’)

…CHECK (PaymentMethod IN ('Cash','Transfer')

…CHECK (PaymentMethod = ‘Cash’ AND PaymentMethod = ‘Transfer’)

The correct answer is: …CHECK (PaymentMethod IN ('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

Mark 0.00 out of 1.00

A relationship is when both participants in the relationship are the same entity set is called

Select one:
Ternary

N-ary

Binary

Unary

The correct answer is: Unary

Question 4
Complete

Mark 1.00 out of 1.00

A trigger belongs to_______________

Select one:
a single table in the database

all tables in th database

none of the others

more than one table in the database

The correct answer is: a single table in the database

Question 5
Complete

Mark 1.00 out of 1.00

Choose the correct statement.

Select one:
All of the others

The syntax to remove a trigger is: DROP TRIGGER < trigger_name >

You can remove a trigger by dropping it or by dropping the trigger table.

Use ALTER TRIGGER to change the definition of a trigger

The correct answer is: All of the others

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

Mark 1.00 out of 1.00

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

Mark 1.00 out of 1.00

How many tables may be included with a join?

Select one:
Four

One

Three

Two

The correct answer is: Two

Question 8
Complete

Mark 0.00 out of 1.00

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).

Select one or more:


Select count (Stu_ID) from Students group by Stu_ID

Select * from Students

Select count(Stu_ID) from Students

Select count(*) from Students

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

Mark 1.00 out of 1.00

SELECT SUBSTRING('SQL_SERVER', 2, 3) AS 'Substring', len(SUBSTRING('SQL_SERVER', 2, 3)) AS 'x'

Select one:
Substring is ‘SQL’ and x=3

Substring is ‘QL_’ and x=3

Substring is ‘_S’ and x=2

Substring is ‘QL_’ and x=2

The correct answer is: Substring is ‘QL_’ and x=3

Question 10
Complete

Mark 1.00 out of 1.00

SQL data definition commands make up a(n)___________.

Select one:
DML

DDL

XML

HTML

The correct answer is: DDL

Question 11
Complete

Mark 0.50 out of 1.00

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)

Select one or more:


Delete an exist tuple from the relation R1

Delete an exist tuple from the relation R2

Insert a new tuple to the relation R1

Insert a new tuple to the relation R2

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

Mark 0.00 out of 1.00

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?

Select one or more:


We cannot find “Primary Key” from “Candidate Key”

All Super Keys can be a Candidate Key

Only one Candidate Key can be Primary Key.

Minimal super key is a Candidate Key.

The correct answers are: Minimal super key is a Candidate Key., Only one Candidate Key can be Primary Key.

Question 13
Complete

Mark 1.00 out of 1.00

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.

None of these others.

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

Mark 0.00 out of 1.00

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

The correct answer is: Cartesian 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

Mark 1.00 out of 1.00

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

The correct answer is: Natural join

Question 16
Complete

Mark 1.00 out of 1.00

The main purpose of Indexes using in DBMS is___________

Select one:
Providing a quicker way to store data.

Decreasing the amount of disk space utilized.

Providing rapid, random and sequential access to base-table data.

Increasing the cost of implementation

Decreasing the cost of implementation

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

Mark 1.00 out of 1.00

The SQL wildcards are _____ and _____.

Select one:
Underscore (_); Question mark (?)

Percent sign (%); Underscore (_)

Question mark (?); Asterisk (*)

Asterisk (*); Percent sign (%)

The correct answer is: Percent sign (%); Underscore (_)

Question 18
Complete

Mark 1.00 out of 1.00

The subset of super key is a candidate key under what condition?

Select one:
Each subset is a super key

Subset is a super key

All subsets are super keys

No proper subset is a super key

The correct answer is: No proper subset is a super key

Question 19
Complete

Mark 1.00 out of 1.00

UNION query is which of the following?

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

Mark 1.00 out of 1.00

Using SQL Server 2000, which of the following symbols is used to indicate parameters in stored procedures?

Select one:
@

&

The correct answer is: @

Question 21
Complete

Mark 1.00 out of 1.00

What type of function returns the unit, not a table?

Select one:
All of the answers

Scalar Functions

Inline Table-valued functions

Multi-statement valued functions

The correct answer is: Scalar Functions

Question 22
Complete

Mark 1.00 out of 1.00

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

The correct answer is: IN and NOT 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

Mark 0.50 out of 1.00

Which is/are the correct SQL statement(s) when you want to return MaVT which have the highest purchase price (GiaMua)?

Select one or more:


select MaVT from VATTU where GiaMua in (select max(GiaMua) from VATTU)

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)

select MaVT, max(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

Mark 1.00 out of 1.00

Which of following statement is correct?

Select one:
Primary key has only one attribute

Every relation must have only one primary key

Super key is a special primary key

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

Mark 1.00 out of 1.00

Which of the following group functions ignore NULL values?

Select one:
Sum

All of these answers

Count

Max

The correct answer is: All of these answers

Question 26
Complete

Mark 0.00 out of 1.00

Which of the following is NOT a type of SQL constraint?

Select one:
CHECK

FOREIGN KEY

PRIMARY KEY

UNIQUE

ALTERNATE KEY

The correct answer is: 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

Mark 1.00 out of 1.00

Which of the following is one of the basic approaches for joining tables?

Select one:
All of the above

Union join

Subqueries

Natural join

The correct answer is: All of the above

Question 28
Complete

Mark 1.00 out of 1.00

Which of the following is true concerning triggers?

Select one:
They can not cascade (Cause another trigger to fire).

They execute against only some applications that access a database.

They do not create them with SQL

They have an event, condition, and action.

The correct answer is: They have an event, condition, and action.

Question 29
Complete

Mark 0.50 out of 1.00

Which of the following statement(s) is/are true about “HAVING” and “WHERE” clauses in SQL?

Select one or more:


“WHERE” is used to filter groups but “HAVING” is used to filter rows.

“WHERE” is always used before “GROUP BY” and “HAVING” before “GROUP BY”.

“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.

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

Mark 0.50 out of 1.00

Which of the following statement(s) is/are true about “HAVING” and “WHERE” clauses in SQL?

Select one or more:


“WHERE” is always used before “GROUP BY” and “HAVING” after “GROUP BY”.

“WHERE” is always used before “GROUP BY” and “HAVING” before “GROUP BY”.

“WHERE” is used to filter rows but “HAVING” is used to filter groups.

“WHERE” is used to filter groups but “HAVING” is used to filter rows.

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

Mark 1.00 out of 1.00

Which of the following statements is true concerning routines and triggers?

Select one:
Both are stored in the database.

Both have to be called to operate.

Both consist of procedural code

Both run automatically.

The correct answer is: Both consist of procedural code

Question 32
Complete

Mark 0.00 out of 1.00

Which operator(s)are used in the SELECT statement?

Select one:
Aggregate functions

All of these answers

Expression

Operator

The correct answer is: All of these answers

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

Mark 1.00 out of 1.00

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

Mark 1.00 out of 1.00

Which statement does not fire the trigger?

Select one:
SELECT

INSERT

DELETE

UPDATE

The correct answer is: SELECT

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

Mark 0.00 out of 1.00

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)

None of the others

ALTER TABLE Student

ADD CONSTRAINT FKStudent FOREIGN KEY(IdClass) REFERENCES Class(IdClass)

ADD FOREIGN KEY(IdClass) REFERENCES Class(IdClass)

ALTER TABLE Student

ALTER TABLE Student

The correct answer is: ALTER TABLE Student

Question 36
Complete

Mark 1.00 out of 1.00

Which statement is used to insert data from table HREmp to table Employee

Select one:
INSERT INTO Employee VALUES (SELECT * FROM HREmp)

INSERT INTO Employee SELECT * FROM HREmp WHERE HREmp.EmpID=Employee.EmpID

INSERT INTO Employee SELECT * FROM HREmp

INSERT INTO Employee (Dept) VALUES(‘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

Mark 1.00 out of 1.00

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 Address = (SELECT Addr FROM Enroll)

UPDATE Student SET Address = (SELECT Addr FROM Enroll)

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

Mark 0.17 out of 1.00

Which statement(s) is/are used to delete all data but keep the structure of table Student

Select one or more:


TRUNCATE TABLE Student

TRUNCATE Student

DROP TABLE Student

DELETE TABLE Student

DELETE FROM 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

Mark 1.00 out of 1.00

The attributes of relationship teaches in teacher teaches course should be _______

Select one:
Teacher_Code, Course_No, Semester_No

Teacher_Code, Course_No, Teacher_Name, Dept, Phone_No

Teacher_Code, Teacher_Name, Dept, Phone_No

Course_No, Course_Name, Semester_Offered, Credits

The correct answer is: Teacher_Code, Course_No, Semester_No

Question 40
Complete

Mark 0.00 out of 1.00

Attributes are _________________________

Select one:
Properties of relationship

Properties of realtionship, Attributed to entities

Properties of relationship, Properties of members of an entity set

Properties of members of an entity set

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

You might also like