1/11
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced | Call with Kai |
|---|
No study sessions yet.
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
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;
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
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
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
Which of the following is not from the typical trigger components?
a. Condition
b. Events
c. Action
d. Manipulation
Manipulation
Which of the operation are not specifies in triggers?
a. INSERT
b. ALTER
c. DELETE
d. UPDATE
ALTER

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

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

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

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

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