Question 41
Which of the following statements are TRUE about an SQL query? P : An SQL query can contain a HAVING clause even if it does not have a GROUP BY clause Q : An SQL query can contain a HAVING clause only if it has a GROUP BY clause R : All attributes used in the GROUP BY clause must appear in the SELECT clause S : Not all attributes used in the GROUP BY clause need to appear in the SELECT clause
Question 45
Employee (name, sex, salary, deptName)Consider the following SQL query
select deptName from Employee where sex = \'M\' group by deptName having avg (salary) > (select avg (salary) from Employee)It returns the names of the department in which
Question 46
A database table T1 has 2000 records and occupies 80 disk blocks. Another table T2 has 400 records and occupies 20 disk blocks. These two tables have to be joined as per a specified join condition that needs to be evaluated for every pair of records from these two tables. The memory buffer space available can hold exactly one block of records for T1 and one block of records for T2 simultaneously at any point in time. No index is available on either table. If Nested-loop join algorithm is employed to perform the join, with the most appropriate choice of table to be used in outer loop, the number of block accesses required for reading the data are
Question 47
Customers(custid, name, gender, rating)The rating value is an integer in the range 1 to 5 and only two values (male and female) are recorded for gender. Consider the query “how many male customers have a rating of 5”? The best indexing mechanism appropriate for the query is
Question 49
SELECT * FROM EMPLOYEE E WHERE 2 = (SELECT COUNT(DISTINCT E1.SALARY) FROM EMPLOYEE E1 WHERE E1.SALARY>E.SALARY)
There are 50 questions to complete.