For the following questions answer them individually
Consider the schema
Sailors(sid, sname, rating, age) with the following data
For the query
SELECT S.rating, AVG(S.age) AS avgage FROM Sailors S
Where S.age $$\ge$$ 18
GROUP BY S.rating
HAVING 1 $$<$$ (SELECT COUNT($$*$$) FROM Sailors S2 where S.rating $$=$$ S2.rating)
The number of rows returned is
Consider a table that describes the customers :
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
Consider the following schema :
Sailors(sid,sname,rating,age)
Boats(bid,bname, colour)
Reserves(sid,bid,day)
Two boats can have the same name but the colour differentiates them.
The two relations
$$\rho(Tempsids, (\pi_{sid, bid}Reserves)/(\pi_{bid }(\sigma_{bname = 'Ganga'} Boats)))$$,
$$\pi_{sname}(Tempsids \bowtie Sailors)$$
If / is division operation, the above set of relations represents the query
Consider the following table : Faculty(facName, dept, office, rank, dateHired)
(Assume that no faculty member within a single department has same name. Each faculty member has only one office identified in office). 3NF refers to third normal form and BNCF
refers to Boyce-Codd normal form
Then Faculty is
Consider the following query :
SELECT E.eno, COUNT(*)
FROM Employees E
GROUP BY E.eno
If an index on eno is available, the query can be answered by scanning only the index if
If C is a skew-symmetric matrix of order n and X is $$n \times 1$$ column matrix, then $$X^T CX$$ is a
Consider the recurrence equation
$$T(n) = \begin{cases}2T(n - 1), & if n> 0\\1 & otherwise\end{cases}$$
Then T(n) is (in big O order)
Consider the program
void function (int n) {
int i, j, count = 0;
for (i = n/2; i <= n; i++)
for (j = 1; j <= n; j = j * 2)
count++;
}
The complexity of the program is