CSCI 4402: Database Systems - Module 4/Quiz 4

0.0(0)
studied byStudied by 5 people
0.0(0)
full-widthCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/11

encourage image

There's no tags or description

Looks like no tags are added yet.

Study Analytics
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No study sessions yet.

12 Terms

1
New cards

Suppose that we have the following table schema: Movies (id, name, director)

Which of the following queries could retrieve the movies names that doesn't have director in the database (the director attribute equal to NULL)?

a. SELECT * FROM Movies WHERE director=NULL

b. SELECT name FROM Movies WHERE director IS NULL

c. SELECT name FROM Movies WHERE director = NULL

d. SELECT * FROM Movies WHERE director IS NULL

SELECT name FROM Movies WHERE director IS NULL

2
New cards

With MySQL, how can you return the number of records in the "Student" table?

a. SELECT LEN(*) FROM Student;

b. SELECT NO(*) FROM Student;

c. SELECT COLUMNS(*) FROM Student;

d. SELECT COUNT(*) FROM Student;

SELECT COUNT(*) FROM Student;

3
New cards

The system execute the rest of the trigger body that is satisfying the condition only for the ___________

a. Tuples

b. Relation

c. Instances

d. Attributes

Tuples

4
New cards

What is the clause that is responsible for adding a condition to an aggregate function?

a. HAVING Clause

b. GROUP Clause

c. ORDER Clause

d. WHERE Clause

HAVING Clause

5
New cards

What is the name of the function that is used to check whether the query result is empty or not?

a. EXIST

b. UNIQUE

c. AS

d. DISTINCT

EXIST

6
New cards

Which of the following is not from the typical trigger components?

a. Condition

b. Events

c. Action

d. Manipulation

Manipulation

7
New cards

Which of the operation are not specifies in triggers?

a. INSERT

b. ALTER

c. DELETE

d. UPDATE

ALTER

8
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p></p><p>SELECT Dname, sum(salary)</p><p>FROM Department,Employee</p><p>WHERE Department.Did=Employee.Did</p><p>GROUP BY Dname;</p><p></p><p>a. Four Tuples</p><p>b. One Tuple</p><p>c. Three Tuples</p><p>d. Five Tuples</p>

How many tuples does the following SQL statement retrieve?

SELECT Dname, sum(salary)

FROM Department,Employee

WHERE Department.Did=Employee.Did

GROUP BY Dname;

a. Four Tuples

b. One Tuple

c. Three Tuples

d. Five Tuples

Three Tuples

9
New cards
<p>How many tuples does the following SQL statement retrieve?</p><p></p><p>SELECT sum(salary)</p><p>FROM Department, Employee</p><p>WHERE Mgr=Eid;</p><p></p><p>a. Three Tuples</p><p>b. Five Tuples</p><p>c. Four Tuples</p><p>d. One Tuple</p>

How many tuples does the following SQL statement retrieve?

SELECT sum(salary)

FROM Department, Employee

WHERE Mgr=Eid;

a. Three Tuples

b. Five Tuples

c. Four Tuples

d. One Tuple

One Tuple

10
New cards
<p>Suppose that the following SQL statement will retrieve one values. What is this value?</p><p></p><p>SELECT sum(salary)</p><p>FROM Department, Employee</p><p>WHERE Mgr=Eid;</p><p></p><p>a. 9700</p><p>b. 7000</p><p>c. 4200</p><p>d. 13400</p>

Suppose that the following SQL statement will retrieve one values. What is this value?

SELECT sum(salary)

FROM Department, Employee

WHERE Mgr=Eid;

a. 9700

b. 7000

c. 4200

d. 13400

7000

11
New cards
<p>Suppose that the following SQL statement will retrieve one values. What is this value?</p><p></p><p>SELECT sum(salary)</p><p>FROM Employee</p><p>WHERE Eid in (SELECT DISTINCT Mgr FROM Department);</p><p></p><p>a. 7000</p><p>b. 9700</p><p>c. 4200</p><p>d. 13400</p>

Suppose that the following SQL statement will retrieve one values. What is this value?

SELECT sum(salary)

FROM Employee

WHERE Eid in (SELECT DISTINCT Mgr FROM Department);

a. 7000

b. 9700

c. 4200

d. 13400

4200

12
New cards
<p>Which of the following SQL statements will retrieve the total salaries of all department</p><p>managers?</p><p></p><p>a. SELECT sum(salary)</p><p>FROM Department, Employee</p><p>WHERE Department.Mgr=Employee.Eid;</p><p></p><p>b. SELECT sum(salary) FROM Employee</p><p>WHERE Eid in (SELECT DISTINCT Mgr FROM Department);</p><p></p><p>c. SELECT sum(salary)</p><p>FROM Department, Employee</p><p>WHERE Mgr=Eid;</p><p></p><p>d. SELECT sum(salary)</p><p>FROM Department, Employee</p><p>WHERE Mgr=Eid</p><p>GROUP BY Department.Did;</p>

Which of the following SQL statements will retrieve the total salaries of all department

managers?

a. SELECT sum(salary)

FROM Department, Employee

WHERE Department.Mgr=Employee.Eid;

b. SELECT sum(salary) FROM Employee

WHERE Eid in (SELECT DISTINCT Mgr FROM Department);

c. SELECT sum(salary)

FROM Department, Employee

WHERE Mgr=Eid;

d. SELECT sum(salary)

FROM Department, Employee

WHERE Mgr=Eid

GROUP BY Department.Did;

b. SELECT sum(salary) FROM Employee

WHERE Eid in (SELECT DISTINCT Mgr FROM Department);