Consider a database that has the relation schema CR(StudentName, CourseName). An instance of the schema CR is as given below.
The following query is made on the database.
T1 ← πCourseName(σStudentName=’SA’(CR))
T2 ← CR ÷ T1
The number of rows in T2 is
Which of the following concepts is true for Generalization?
Select operation in SQL is equivalent to
Consider the following database table named water_schemes :
The number of tuples returned by the following SQL query is
with total(name, capacity) as select district_name, sum(capacity) from water_schemes group by district_name with total_avg(capacity) as select avg(capacity) from total select name from total, total_avg where total.capacity >= total_avg.capacity
Consider the following database table named top_scorer.
Consider the following SQL query:
SELECT ta.player FROM top_scorer AS ta WHERE ta.goals > ALL ( SELECT tb.goals FROM top_scorer AS tb WHERE tb.country = 'Spain' ) AND ta.goals > ANY (SELECT tc.goals FROM top_scorer AS tc WHERE tc.country = 'Germany')
The number of tuples returned by the above SQL query is
Suppose a database schedule S involves transactions T1, ....Tn. Construct the precedence graph of S with vertices representing the transactions and edges representing the conflicts. If S is serializable, which one of the following orderings of the vertices of the precedence graph is guaranteed to yield a serial schedule?
An ER model of a database consists of entity types A and B. These are connected by a relationship R which does not have its own attribute. Under which of the following conditions, can the relational table for R be merged with that of A?
The following relation records the age of 500 employees of a company, where empNo ( indicating the employee number) is the key :
empAge(empNo, age)
Consider the following relational algebra expression:
What does the above expression generate?
The relation scheme given below is used to store information about the employees of a company, where empId is the key and deptId indicates the department to which the employee is assigned. Each employee is assigned to exactly one department.
emp(empId, name, gender, salary, deptId)
Consider the following SQL query:
select deptId, count(*) from emp where gender = “female” and salary > (select avg(salary)from emp) group by deptId;
The above query gives, for each department in the company, the number of female employees whose salary is greater than the average salary of
In a database system, unique time stamps are assigned to each transaction using Lamport’s logical clock. Let TS(T1) and TS(T2) be the time stamps of transactions T1 and T2 respectively. Besides, T1 holds a lock on the resource R, and T2 has requested a conflicting lock on the same resource R. The following algorithm is used to prevent deadlocks in the database assuming that a killed transaction is restarted with the same timestamp.
if TS(T2) <TS(T1) then T1 is killed else T2 waits.
Assume any transactions that is not killed terminates eventually. Which of the following is TRUE about the database system that uses the above algorithm to prevent deadlocks?