Consider The Following Relational Scheme
Student (school-id, sch-roll-no, sname, saddress)
School (school-id, sch-name, sch-address, sch-phone)
Enrolment (school-id, sch-roll-no, erollno, examname)
ExamResult (Erollno, examname, marks)
Consider the following tuple relational calculus query
{ t | ∃E ∈ Enrolment t = E.school-id ∧
| { x | x ∈ ExamResult B.school-id =
t ∧ ( ∃B ∈ ExamResult B.erollno =
x.erollno ∧ B.examname = x.examname ∧
B.marks > 35 } | ÷ |
{ x | x ∈ Enrolment ∧ x.school-id = t }
| * 100 > 35 }
If a student needs to score more than 35 marks to pass an exam what does the query return?Consider The Following Relational Scheme
Student (school-id, sch-roll-no, sname, saddress)
School (school-id, sch-name, sch-address, sch-phone)
Enrolment (school-id, sch-roll-no, erollno, examname)
ExamResult (Erollno, examname, marks)
SELECT sch-name, COUNT (*)
FROM School C, Enrolment E,
ExamResult R
WHERE E.school-id = C.school-id
AND E.examname = R.examname
AND E.erollno = R.erollno
AND R.marks = 100 AND S.school-id IN
(SELECT school-id
FROM student
GROUP BY school-id
HAVING COUNT (*) > 200)
GROUP BY school-id;
Q1:
Select e.empId
From employee e
Where not exists
(Select * From employee s
where s.department = "5" and
s.salary >=e.salary);
Q2:
Select e.empId
From employee e
Where e.salary > Any
( Select distinct salary
From employee s
Where s.department = "5");
Query1:
Select A.customer, count(B.customer)
From account A, account B
Where A.balance <=B.balance
Group by A.customer
Query2:
Select A.customer, 1+count(B.customer)
From account A, account B
Where A.balance < B.balance
Group by A.customer
Consider these statements about Query1 and Query2.
1. Query1 will produce the same row set as Query2 for some but not all databases.
2. Both Query1 and Query2 are correct implementation of the specification
3. Query1 is a correct implementation of the specification but Query2 is not
4. Neither Query1 nor Query2 is a correct implementation of the specification
5. Assigning rank with a pure relational query takes less time than scanning in decreasing balance order assigning ranks using ODBC.
Which two of the above statements are correct?