Quiz Space

Database Management Systems · Quiz 1 · 27 Oct 2024 · September 2024 term

Question 5: Consider the table Faculty(ID, Name, Department, Salary) …

Question 5

+4 marksOne correct option

Consider the table Faculty(ID, Name, Department, Salary) and the two queries Q1 and Q2 given below. Our goal is to find the IDs of faculty members whose salary is greater than the highest salary in the Computer Science department. Assume that 'Computer Science' department has more than one faculty member. Which of the following queries will give the required output?

Q1:

sql
select F.ID
from Faculty as F
where F.salary>All(select distinct salary
from Faculty as T
where T.department='Computer Science')

Q2:

sql
select F.ID
from Faculty as F
where not exists(select *
from Faculty as T
where T.department='Computer Science' and T.salary>=F.salary)
  1. A

    Q1 is correct but Q2 is wrong

  2. B

    Q2 is correct but Q1 is wrong

  3. C

    Both Q1 and Q2 are wrong

  4. D

    Both Q1 and Q2 are correct

Show answer

Correct answer

  • D

    Both Q1 and Q2 are correct

Question 5 of 14 in the IIT Madras BS Database Management Systems (DBMS) Quiz 1 paper sat on 27 Oct 2024, in the September 2024 term (IIT M DIPLOMA AN EXAM QDD2 27 Oct 2024). It carries 4 marks.

More questions from this paper

  1. Q1Which of the following is the correct sequence for query processing?
  2. Q2Figure question
  3. Q3A relational database contains two separate tables called Employee and Department.\ The Employee table has the attribut…
  4. Q4The relation Students(Name, Total_Marks) contains the names and marks of different students where no two students have …
  5. Q6Consider the following Entity Relationship Diagram: Choose the correct statements.
  6. Q7We want to create the table nominee by using following SQL statements: Which of the following is/are the correct SQL st…
  7. Q8Consider relations Book and Author shown in Table 1 and Table 2 | BookID | Title | AuthorID | Genre | |---|---|---|---|…
  8. Q9Consider the following relations:\ Instructor(<u>InsID</u>, InsName, email)\ Course(<u>CID</u>, CName)\ Teaches(<u>InsI…
  9. Q10Questions: Find the first names of players whose names start with 'A' and have at least 4 characters. Find out the numb…
  10. Q11Consider the following relational schema and answer the given subquestions.
  11. Q12Consider the tables 3 and 4 and answer the given subquestions. Table 3: Relation team | team_id | name | ranking | coun…
  12. Q13Consider the tables 3 and 4 and answer the given subquestions. Table 3: Relation team | team_id | name | ranking | coun…
  13. Q14Using the SQL query shown below, a view named BestTeam is created. Which among the following SQL queries will display t…