Database Management System: Refer Below To Answer The Questions (Q.1 To Q4)
Database Management System: Refer Below To Answer The Questions (Q.1 To Q4)
Database Management System: Refer Below To Answer The Questions (Q.1 To Q4)
Branch_scheme=(Branch_name,assets,Branch_city)
Customer_scheme=(Customer_name,street,Customer_city)
Deposit_scheme=(Branch_name,account_number,Customer_name,balance)
Borrow_scheme=(Branch_name,loan_number,Customer_name,amount)
Client_scheme=(Customer_name,banker_name)
1. Using relational algebra, the query that finds customers who have a balance of over 1000 is:
(a) Πcustomer_name (σbalance > 1000 (Deposit)) (b) σcustomer_name (Пbalance > 1000 (Deposit))
(c) Пcustomer_name (σbalance > 1000 (Borrow)) (d) σcustomer_name (Пbalance > 1000 (Borrow))
2. Which of the following queries finds the clients of banker Agassi and the city they live in?
3. Which of the following tuple relational calculus finds all customers who have a loan
amount of more than 1200?
4. Which of the following Domain relation calculus finds all customers who have a loan
amount of over 1200?
1
(b) { <c> | ⋺ b, 1, a (<b, 1, c, a> ϵ borrow ⋂ a > 1200)}
(c) { <c> | ⋺ <b, 1, c, a> ϵ borrow ⋂ a > 1200)}
(d) { <c> | <b, 1, c, a> ϵ borrow ⋂ a > 1200)}
5. Which of the following features are beyond the capacity of relational algebra?
(a) Relational algebra and relational calculus are both procedural query languages.
(b) Relational algebra and relational calculus are both non-procedural query languages.
(c) Relational algebra is a procedural query language and relational calculus is a non-
procedural query language.
(d) Relational algebra is a non-procedural query language and relational calculus is a
procedural query language.
7. If P and Q are predicates, P is the relational algebra expression, other which of the
following equivalents are valid?
2
(d) None of the above.
10. Select the relational expression which could possibly return the following result:
a c
1 2
2 3
11. Consider a banking database with the following table with 3 attributes (br_name, loan_no,
amount). Find the appropriate query for the given statement below.Find the loan no. for each
loan of an amount greater than 20,000.
12. Let r and s be 2 relations over the relation schemes R and S respectively and let A be an
attribute in R. Then the relational algebra expression,
3
(a) σA=a(r) (b) r
(c) σA=a(r) ⨝s (d) None of the above
14. Suppose the adjacency relation of vertices in a graph is represented in a table Adj(X, Y).
Which of the following queries, cannot be expressed by a relational algebra expression of
constant length?
15. Which of the following query transformation (i.e. replacing the LHS expression by the RHS
expression) is incorrect?
R1 and R2 are relation, C1, C2 are relation condition and A1, A2 are attributes of R1.
16. Consider the relation (name, sex, marks) where the primary key is shown underlined,
pertaining to students in a class that has at least one boy and one girl. What does the
following relational algebra expression produce?
4
(d) Names of girl students with more marks than all the boy students
ПA1(ПA2(σF1(σF2(r))) where A1, A2 are sets of attributes in r with A1< A2 and F1, F2 are
Boolean expression based on attributes in r?
18. Consider the relation schema given below, where eId of the relation dependent is a foreign
key referring to empId of the relation employee. Assume that every employee has at least one
associated dependent in the dependent relation:
employee (empId, empName, empAge)
dependent(depId, eid, depName, depAge)
The above query evaluates to the set of empIds of employees whose age is greater than that
of:
A:
Id Name Age
12 Arun 60
15 Shreya 24
99 Rohit 11
5
B:
Id Name Age
15 Shreya 24
25 Hari 4
98 Rohit 20
99 Rohit 11
C:
Id Name Age
10 2200 2
99 2100 1
19. How many tuples does the result of the following relation algebra expression contain?
Assume that the schema of A⋃B is the same as that of A:
(A⋃B)⨝A.Id> 40⋃C.Id<15C
(a) 7 (b) 4
(c) 5 (d) 9
20. Suppose R1(A, B) and R2(C, D) are 2 relation schemas. Let r1 and r2 be the corresponding
relation instances. B is a foreign key that refers to C in R2. If data in r1 and r2 satisfy
referential integrity constraints, which of the following is always true?