0% found this document useful (0 votes)
4 views

DB Past Question 2020 - 2022_012514

The document outlines a series of questions related to relational algebra, payroll database instances, and SQL queries for a session in 2023/2024. It includes tasks such as expressing iterative steps in relational algebra, generating payroll database instances, and discussing the implications of database design choices. Additionally, it touches on noSQL databases and their relation to Big Data, including database partitioning and distributed architectures.

Uploaded by

charlesvince682
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
4 views

DB Past Question 2020 - 2022_012514

The document outlines a series of questions related to relational algebra, payroll database instances, and SQL queries for a session in 2023/2024. It includes tasks such as expressing iterative steps in relational algebra, generating payroll database instances, and discussing the implications of database design choices. Additionally, it touches on noSQL databases and their relation to Big Data, including database partitioning and distributed architectures.

Uploaded by

charlesvince682
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Session 2023/2024

Question 1: Use the Table to answer question (i) – 1 (iii)

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

iii. Convert (2) to a relational algebra


iv. Convert (3) from what the computer is to do how the computer should go about achieving (3)
as a series of algorithm steps

Questions 3:

Consider the schema instances below and answer the following questions.

Employee (E) Department (D)


Enr Ename Dept Dnr Dname
1 Bill A A Bursary
2 Sarah C B Maintenan
3 John A ce
C Human
Resources

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

d. σ e.ename = ‘Sarah’ (I3) = I4

e. σ e.ename=’Sarah’ amd d.dnr=’B’ (I4) = I5

ii. Answer the questions that follow

(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

iv. formulate the relational algebra of the query.

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

You might also like