Download as pdf or txt
Download as pdf or txt
You are on page 1of 5

DCS 1201 - Database Systems Assignment for 27th July 2021 Class Must attempt

Question 1.

a) Compare the use of flat files with the use of a database system for storing data, and highlight
the limitations commonly associated with flat file systems. ( 6 marks)

b) Define and distinguish between, primary keys and foreign keys. ( 5 marks)

c) Distinguish between an external schema and a conceptual schema as used in database


design. ( 4 marks)

d) Distinguish between logical data independence and physical data


independence. ( 5 marks)

Question 1 answer.
As a guide, reward students with one mark for each relevant point made in their answer to
each part question.

a) There are many issues distinguishing flat file environment with DB environment. Data
redundancy is the first issue that where the two environments are, differs. Flat file environment
tends to duplicate data among its various applications (i.e. uncontrolled redundancy) due to the
close dependency between programs and data. In other words, each program defines and
manages its own data. Data dependency is another limitation of flat files environment. DB
environment however, has a minimal redundancy, which is carefully controlled. A DB, typically,
has a well-designed database table structure that can avoid the dangers of uncontrolled data
redundancy and specifically update, insert
and delete anomalies. Nevertheless, the failures of the flat file environment can easily be
duplicated in a database environment if the DB is poorly designed. In contrast to flat
files, Databases exhibit a high degree of Data Independence. Other issues include the
incompatible file format, which could be found among flat files due to the embedding of data
structure in the application programs. Databases do not suffer from this incompatibility since
data in the database follows a common format to facilitate processing by all applications.
Another distinctive feature of a database environment is the flexibility and extendibility of writing
queries on the same set of data. W e can get more information from the same data sets when it
is used in different contexts. Flat files systems tend to be very dependent upon the application
developer, who has to write any queries or reports that are required. Hence, there are fixed
number of queries or reports and no facilities for unplanned queries. Finally, there are more
limitations of file-based systems compared with database systems, such as lack of security,
integrity, recovery and multi-access services.
(6 marks)

b) A primary key is a candidate key that is selected to identify tuples uniquely within the relation. A
relation always has a primary key since no duplicate tuples are allowed within the relation. A
primary key can be atomic which consists of a single attribute value, or composite where more
than one attribute values together uniquely identify the primary key. In a base relation, no
attributes of a primary key can be null.
A foreign key is an attribute, or set of attributes, within one relation that matches the candidate
key of some (possibly the same) relation. A foreign key value can be NULL or must match a
candidate key value of some tuples in its home relation or another relation.
(5 marks)

c) The description of the database is called the „Database Schema‟. There are three different types
of schema in the database and these are defined according to the level of abstraction. At the top
level (the highest abstract level), we have the external schema. The complete description or
definition of database records is stored at the least abstract level, which is called the internal
schema. The conceptual schema is the one in the middle. The conceptual schema describes all
the entities, attributes and relationships together with the integrity constraints. There could be
many external schemas as users (or groups of
users), one conceptual schema and one internal schema for each database. (4 marks)

d) Data Independence means that upper level schemas are unaffected by changes to lower levels.
Data Independence is intended to ensure that the only elements requiring modification in the
system are those, which are directly and logically involved in the alteration. Physical data
independence will allow the physical layout and organisation of the data to be changed without
affecting either the conceptual or external models or the application programs. Logical data
independence permits the conceptual and external models to be altered without affecting the
internal model or the application programs.
(5 marks)
(Total 20 marks)

Question 2

a) Two issues associated with deploying a database system are given below. Discuss each
point briefly, indicating whether they should be considered as advantages or disadvantages
of database systems.

i) The impact of system failure. ( 3 marks)

ii) The support for multiple views of the same data. ( 3 marks)

b) A recruitment agency finds suitable employees for its client companies. The agency holds files of
information about companies who are looking for employees, employees who are looking for
jobs, and newspapers in which to place advertisements. W hen potential employees or job
seekers look for a job, they apply to the agency for an advertised job in the newspaper. The
agency classifies potential employees to be qualified for all jobs of the same type, so they can
advise potential employees for similar jobs offered by different companies in the future.

Using the Chen notation, draw the Entity-Relationship Diagram (ERD) for the following
situations by:

i) Identifying the entities for the above scenario. ( 4 marks) ii)

Identifying the relationships between entities. ( 4 marks) iii) Showing

the primary key ONLY for each entity on the diagram ( 3 marks)

iv) Showing the cardinality of each relationship on the diagram. ( 3 marks)

Question 2 answer.

a)
i) The impact of system failure is considered to be a disadvantage of deploying a
database system. The reason for this is that centralisation of resources increases
the vulnerability of the system. Since all users & applications rely on the
availability of the Database Management System (DBMS), the failure of any
component can bring operations to halt. E.g. impact of failure of a specific
application in a file based system vs. one DBMS that serves many applications.
(3 marks)

One mark for each relevant point made (which must include a correct identification
of whether advantage or disadvantage) up to a maximum of three.

ii) Support for multiple views of the same data is an advantage of a DBMS. The
reason for this is that each individual item of data may have a different
appearance according to the view through which they accesses. E.g. a decimal
number in one application may be an integer in another. (3 marks)

One mark for each relevant point made (which must include a correct identification
of whether advantage or disadvantage) up to a maximum of three.

b)
i) Company, Job, Paper, Job Type, Employee. (4 marks)

ii) (4 marks), (iii) (3 marks) & (iv) (3 marks)

Note that thick lines between entities refer to relationship of mandatory


participations while thin lines refer to optional relationships.

Company Offer N Job Advertised In


1 N
N
CompName JobCode
M
Is A Paper

EmpNo
1
PaperName
Employee Job Type
Seeks JobTypeName
N N
(Total 20 marks)

Question 3

Consider the simple database tables below and answer the questions that follow:

Table: Employee
Emp_No. Qual_Code
00012 32 2
00012 33 3 Table:
00020 10 1
00021 11
00021 10 3
00033 23 1
00034 23 5
00020 10 5

a) How many entity sets does this database contain? ( 2 marks)

b) How many attributes does the Employee table have and how many fields does the
Qualification table have? ( 2 marks)

c) How many Employees are there in the table Employee? ( 2 marks)

d) How many Employees hold GNVQ certificate? ( 2 marks)

e) W hat field(s) constitute(s) the Employee table‟s primary key? Explain your
answer. ( 2 marks)

f) How would you describe the relationship between the two tables? ( 2 marks)

g) Does the database exhibit referential integrity? Explain your answer. ( 2 marks)

h) Identify any foreign key in the Qualification table. ( 2 marks)

i) Does the Employee table exhibit entity integrity? Why, or why not? ( 2 marks)

j) Given the fact that no Employee currently holds a PhD degree, is there any
orphan or fragment record in the qualification table? If so, can youidentify the
record? Explain your answer. ( 2 marks)

Question 3 answer.

a) Two. An entity set is a table.


b) Two attributes in the Employee table and two fields in the Qualification table. Fields,
attributes and columns are used as synonyms.
c) 7 Employees, as the last record is repeated since the Employee 0002010 has HND
and BSc.
d) Two employees.
e) Both Emp-No and Qual_Code constitutes the composite primary key since Emp_No is not
unique.
f) The cardinality of the relationship between Employee to Qualification is 1:N. An
Employee may have none, one or more than one qualification.
g) Yes, the Qual_Code foreign key values either have a match in the Qualification table or have
a NULL value.
h) No.
i) No, because the Employee table violates the Entity integrity constraint. Entity integrity
states that “in a base relation, no attributes of a primary key can be null”.
j) No, there is no fragment or an orphan record since the relationship is not mandatory for
each qualification (i.e. it is an optional participation – may not be associated with any
employee). In the relational system, a row that exists inappropriately without a required
parent or child is sometimes called a fragment, and a child row that exists
without a mandatory parent is sometimes called an orphan.
2 marks each per section. (Total
20 marks)

You might also like