Database miscellaneous
- The maximum number of superkeys for the relation schema R(E, F, G, H) with E as the key is _____.
-
View Hint View Answer Discuss in Forum
Maximum no. of super keys = 2n – 1 = 24 – 1 = 23 = 8
Correct Option: C
Maximum no. of super keys = 2n – 1 = 24 – 1 = 23 = 8
- Given an instance of the STUDENTS relation as shown below :
For (StudentName, StudentAge) to be a key for this instance, the value X should NOT be equal to _____________ .
-
View Hint View Answer Discuss in Forum
Age cannot be 19 as (Student Name, Student Age) is a key.
Correct Option: A
Age cannot be 19 as (Student Name, Student Age) is a key.
- Which one of the following is not logically equivalent to ̚ ∃x (∀ y (α) ∧ ∀ z (β) ) ?
-
View Hint View Answer Discuss in Forum
∀ ×(∃z(̚β) &rarrr; ∀ y(α)) and ∀ ×(∃y(̚α) &rarrr; ∃z(β)) both are NOT logically equivalent to
̚∃ × (∀y(α) ∧ ∀z(β)Correct Option: A
∀ ×(∃z(̚β) &rarrr; ∀ y(α)) and ∀ ×(∃y(̚α) &rarrr; ∃z(β)) both are NOT logically equivalent to
̚∃ × (∀y(α) ∧ ∀z(β)
- The employee information in a company is stored in the relation
Employee (name, sex, salary, deptName)
Consider the following SQL query :
Select deptName
From Employee
Where sex = ‘M’
Group by deptName
Having avg(salary) >
(select avtg (salary) from Employee)
It returns the name of the department in which
-
View Hint View Answer Discuss in Forum
SQL query will compute as follows
1. Selects the name from the department
2. Selects the male employee
3. Computes that the average salary of male employees is more than the average salary in the company.Correct Option: D
SQL query will compute as follows
1. Selects the name from the department
2. Selects the male employee
3. Computes that the average salary of male employees is more than the average salary in the company.
- Let R and S be relational schemas such that R = {a, b, c} and S = {c}. Now consider the following queries on the database:
1. πR - S - πR - S (πR - S(r) × S - πr - S , S (r))
2. { t | t ∈ πR - S(r) ∧ ∀ u ∈ s (∃ v ∈ r ( u = v[s] ∧ t = v[ R - S ] ) ) }
3. { t | t ∈ πR - S(r) ∧ ∀ u ∈ s (∃ u ∈ s ( u = v[s] ∧ t = v[ R - S ] ) ) }
4. Select R.a, R. b
From R, S
Where R.c = S.c
Which of the above queries are equivalent?
-
View Hint View Answer Discuss in Forum
This is very clear from the options itself that the option 2 and option 4 are equivalent as option 2 is technical representation of code given in option 4. Therefore
{ t | t ∈ πR - S (r) ∈ ∃u ∈ s(∃v ∈ r(u = v[s] ∧ t = v [R - S])) }
= Select R.a, R.b
From R, S
= Where R.c = S.cCorrect Option: C
This is very clear from the options itself that the option 2 and option 4 are equivalent as option 2 is technical representation of code given in option 4. Therefore
{ t | t ∈ πR - S (r) ∈ ∃u ∈ s(∃v ∈ r(u = v[s] ∧ t = v [R - S])) }
= Select R.a, R.b
From R, S
= Where R.c = S.c