DB Past Question 2020 - 2022_012514
DB Past Question 2020 - 2022_012514
Department (D)
Employee (E) Dnr Dname
Enr Ename Dept A Bursary
1 Bill A B Maintenan
2 Sarah C ce
3 John A C Human
Resources
The join of the relational algebra given below is achievable using the relational algebras
σ (e.dept – d.dnr (E ⋈ D) and (⋈e.dept – d.dnr (E, D)) respectively. You are required to the
following:
a. Express the iterative steps in each of the rational algebra to do the following
b. Apply the iterative steps to evaluate σ σ e.dept = d.dnr ( E ⋈ D) and (⋈e.dept = d.dnr
(E, D))
c. Comment on the equality of σ e.dept = d.dnr ( E ⋈ D) and (⋈e.dept = d.dnr (E, D))
Question 2
Generate instances of a payroll database relation having an arity of 12 and width ≥ 6 and do the
following:
i. Describe the strategy you have used in your choice of primary key in terms of its advantages
and disadvantage
ii. Write a query that retrieves the names of staff whose net salary is within a range determined
by a sargable predicate
Questions 3:
Consider the schema instances below and answer the following questions.
Department (n)
enr amount
1 140000
2 289000
i. Solve the relational algebra given below, Show the instances of Ii, i = 1, 2, …, n in a tabular
format
a. e x d = Ii
b. π.ename, e.dept, d.dnr, d.dname (Ii) = I2
c. σ e.dept = d.dnr l2 = l3
(a) Suggest an applicable join predicate for employee, department and netsalary relations
(b) Suggest an applicable sargable predicate whose query result set is a derivate of the join in
(ii)(1) above
Question 3
Consider the SQL query, select a.studentid, a.name, a.dept, b.coursecode, b.score from
student_diodata a join student_scores b on a.studentid=b.studentid where a deptid = ‘biology’
and b.score >= 39 and do the following:
i. Extract the schema for each of the relations in the query and suggest additional attributes that
make the data set more meaningful
ii. in a tabular format, show ten instances (tuples) of each schema such that the scores of 5
student are less than 39
iii. Determine the result set of the query which must not be an empty set based on the instances
generated
Question 4.
For several reasons, the noSQL database paradigm has been equated to Big Data. Considering
this fact, answer the following questions
1. How does database partitioning and distribution achieve the volume dimension of big
data
2. Discuss a distributed computer architecture that can effectively support horizontal scaling
characteristic of a noSQL database