You are on page 1of 15

Patuakhali Science and Technology University

Assignment on

DATABASE SYSTEM CHAPTER- 01

Course Code: CCE – 223.


Couse Title: Database System.

Submitted To

Dr. Md. Samsuzzaman.


Professor.
Department of Computer and Communication Engineering.
Faculty of Computer Science and Engineering.
Patuakhali Science and Technology University, Dumki, Patuakhali, Bangladesh.

Submitted By

Md. Tahsin Amin. Roll No: 1802054.


Reg No:08464.

Date of Submission: 13th March, 2021.

1|Page
Table of Contents

Review Questions and Answers:........................................................................................................................................3


1.1. Define the following terms: data, database, DBMS, database system, database catalog, program-data
independence, user view, DBA, end user, canned transaction, deductive database system, persistent object, meta-
data, transaction-processing application........................................................................................................................3

1.2. What four main types of actions involve databases? Briefly discuss about it.........................................................4

1.3. Discuss the main characteristics of database approach and how it differs from traditional file system?.................4

1.4. What are the responsibilities of the DBA and database designer?..........................................................................5

1.5. What are the different types of database end users? Discuss the main activities of each........................................5

1.6. Discuss the capabilities that should be provided by a DBMS.................................................................................6

1.7. Discuss the differences between database systems and information retrieval systems...........................................6

Exercise:............................................................................................................................................................................... 8
1.8. Identify some informal queries and update operations that you would expect to apply to the database shown in
Figure 1.2...................................................................................................................................................................... 8

1.9. What is the difference between controlled and uncontrolled redundancy? Illustrate with examples......................9

1.10. Specify all the relationships among the records of the database shown in Figure 1.2.........................................11

1.11. Give some additional views that may be needed by other user groups for the database shown in Figure 1.2.....13

1.12. Cite some examples of integrity constraints that you think can apply to the database shown in Figure 1.2........14

1.13: Give examples of systems in which it may make sense to use traditional file processing instead of a database
approach...................................................................................................................................................................... 14

1.14: Consider Figure 1.2............................................................................................................................................15

a. If the name of the ‘CS’ (Computer Science) Department changes to ‘CSSE’(Computer Science and Software
Engineering) Department and the corresponding prefix for the course number also changes, identify the columns
in the database that would need to be updated.....................................................................................................15

b. Can you restructure the columns in the COURSE, SECTION, and PREREQUISITE tables so that only one
column will need to be updated?.........................................................................................................................15

2|Page
Review Questions and Answers:

1.1. Define the following terms: data, database, DBMS, database system, database catalog, program-data
independence, user view, DBA, end user, canned transaction, deductive database system, persistent
object, meta-data, transaction-processing application.

Ans: Definition of following terms:

Data: Data is a relative entity or object. Ex-name, age, class.

Database: A Database is a collection of related data with an implicit meaning.

DBMS: A database management system is a software system that helps users to create and maintains a
database. This system contains the processes of defining, constructing, manipulating and sharing databases
from various users and applications.

Database System: Data base system is nothing but database and DBMS software together we call as data
base system.

Database catalog: Database catalog contains information such as the structure of each file, the type and
storage format of each data item and various constraints on the data.

Program-data independence: The structure of data files is stored in the DBMS catalog separately from the
access programs is known as program – data independence.

User view: It is the view that may be a subset of the database or it contains virtual data is derived from the
database files but is not explicitly stored.

DBA: Database Administrator is an administrator who is responsible for authorizing access to the database.
DBA manages and coordinates the resources and acquires software and hardware resources.

End-user: An end user is a person whose job requires access to the database for querying, updating and
generating the reports.

Canned transaction: The main aim of canned transaction is using standard types of queries and updates for
querying and updating database.

Deductive database systems: This type of database systems provides capability for defining deduction
rules for new information from the stored database.

Persistent object: Persistent means object is stored permanently in an object –oriented DBMS and it
survives to terminate the program execution and then retrieved directly by another program.

Meta-data: It is information about structure of each file, type and storage format of each data and various
constraints on the data is called meta-data.

3|Page
Transaction-processing application: This application is designed to maintain database integrity in a
known, consistent state.

1.2. What four main types of actions involve databases? Briefly discuss about it.

Ans: The DBMS is a software system that explains the four types of actions, which are defining,
constructing, manipulating, and sharing databases among various users and applications.

1. Defining a database: It includes the data types, structures, and constraints of the data have to store in
the database. The database descriptive information is also stored by the DBMS in the form of a database
catalog or dictionary; it is called meta-data.
2. Constructing the database: It is the process of data storing on some storage medium that is maintained
by the DBMS.
3. Manipulating a database: It includes functions such as retrieve the database by using query, updating
the database to reflect changes in the system, and generate reports from the data.
4. Sharing a database: It allows multiple users and programs to access the database simultaneously.

1.3. Discuss the main characteristics of database approach and how it differs from traditional file system?

Ans: Characteristics of database approach: -

1. Self-Describing Nature of a Database system: The database system contains not only the database
itself but also a complete definition or description of the database structure and constraints.This
definition is stored is the DBMS catalog, which contains information like structure, type, and storage
format of each data.

2. Insulation between program and data: In database systems, the data is stored independently from
the programs that access it. That is, you can modify data without need to any changes in the programs
this property is called program operation independence.

3. Support of multiple views of the data: Database is shared among multiple users, each user may
require different information based on their requirement from the database. each user requirement is
the view of database.

4. Sharing of data transaction processing: A multi-user DBMS allows access to database


simultaneously by more than one user at the same time using concurrency control software.

5. Security: features like multiple views offer security to some extent. DBMS offers methods to
improve security by using constraints while entering data into the database and retrieving the same at
a later stage.

6. Query language: query language makes it more efficient to retrieve and manipulate data. user can
apply as many and as different filtering option as required.

4|Page
A traditional file system typically provides files to store data. Most provide a privilege scheme to control who
can access files. Often they include features such as keyed access and partitioning and encryption. A few
provide secondary indexes. Some even include integration with a transaction manager.

A database management system provides all these things and more. A database management system usually sits
on top of a traditional file system (or perhaps several). It provides a table abstraction, with rows and columns.
Data is strongly typed. A database management system provides a query language that one can use to query and
maintain tables. The query language is rich: it can join multiple tables together, it can aggregate data into
groups. The results of a query are themselves a table which can be stored back into the database if one wishes.

1.4. What are the responsibilities of the DBA and database designer?

Ans: Organizations vary but the allocation of tasks that works best I think is this:

 DBA’s don’t have to know anything about the content of the database, but they need to make sure
that there is adequate CPU, disk, memory, and network bandwidth available, that appropriate backups
are being taken (and checked periodically). They should monitor system loads and let the
developers/designers know when the system is being overtaxed.

 Database designers/developers work with the end users to make sure that the database holds all the
information that the users need. They also need to design physical tables and indexes to ensure that
queries execute as quickly as required. They tell the DBA’s how much space they need to start with,
and how fast tables/indexes are expected to grow.

 If queries (screens and reports) are not running fast enough, the designers. developers need to check
for bottlenecks in their code, and the DBA’s need to check for bottlenecks in memory, I/O, or the
network. The designers may need to create new indexes, or add statistics to the database so that
queries execute faster - these objects will need space from the DBA’s, and maybe changes to table
definitions to create/update statistics.

1.5. What are the different types of database end users? Discuss the main activities of each.

Ans: There are several categories of end users these are as follows:

 Casual End Users
o  Casual users learn only a few facilities that they may use repeatedly

 Naive or parametric end users 


o Naive end users need to learn very little about the facilities provided by the DBMS

5|Page
 Sophisticated end users 
o Sophisticated users try to learn most of the DBMS facilities in order to achieve their
complex requirement.

 Standalone users 
o Standalone users typically become very proficient in using a specific software
package.

1.6. Discuss the capabilities that should be provided by a DBMS.

Ans:

 Controlling Redundancy: normalization


 Restricting unauthorized Access
 Multiple User interfaces: query language, programming language interfaces (forms and command codes)
 Representing Complex Relationships among Data
 Enforcing Integrity Constraints
 Providing Persistent storage for program objects
 Providing storage structures for efficient query processing
 Backup and recovery

1.7. Discuss the differences between database systems and information retrieval systems.

Ans:

# Database management system can be regarded as a store house of information. It is a centralized


repository where raw data would be organized as tables with each column representing an attribute of
the data.

Information retrieval system on the other hand refers to an overall system which is capable of searching
and providing useful information from a data repository based one or more combinations of search
conditions (queries). 

# Conventional DBMS supports ACID properties (Atomicity, Consistency, Isolation and Durability)
which indicates how a data change can happen inside db without being interfered by parallel
transactions.

6|Page
Retrieval system is a more generic term and can mean lots of things other than a conventional DBMS
alone. Here the main emphasis is to get the required bit of information in the most convenient and fastest
way.

# DBMS provides stable platform for data storage and parallel retrieval of data with ability to recover
data in case of any catastrophic failures.

Depending on the complexity of the data in retrieval system backend repository may even be a NoSQL
system without any definite metadata. The data will also be stored in the best possible way for the
optimized retrieval. It may or may not include a front-end presentation layer which will add more
functionality for the end user like visualization for example to display the information in the most
meaningful way for the users.

7|Page
Exercise:

1.8. Identify some informal queries and update operations that you would expect to apply to the database
shown in Figure 1.2.

8|Page
(a) (Query) List the names of all students majoring in Computer Science.

(b) (Query) What are the prerequisites of the Database course?


(c) (Query) Retrieve the transcript of Smith. This is a list of <Course_Name, Section-Identifier,
Semester, Year, Grade> for each course section that Smith has completed.
(d) (Update) Insert a new student in the database whose Name=Jackson, Student_Number=23, Class=1
(freshman), and Major=MATH.
(e) (Update) Change the grade that Smith received in Intro to Computer Science section 119 to B.

1.9. What is the difference between controlled and uncontrolled redundancy? Illustrate with examples.

Ans:
Redundancy is the state of being not or no longer needed or useful. In the traditional approach,
redundancy in storing the same data/information many times in the database leads to several problems.
This leads to Duplication of effort, Wastage of storage space and Inconsistent data.
For example: Student_name and Course_number redundantly in a GRADE_REPORT file (Figure
1.6(a)) because whenever we retrieve a_GRADE_REPORT_record, we want to retrieve the student’s
name and course number along with the grade, student number, and section identifier.

Fig:1.6

A controlled redundancy is necessary technique to use redundant fields in a database. This speed ups the
database access and also improves the performance of queries. Usually, the DBMS ensures the
allocation of the data in the records. It should have the capability to control this redundancy in order to
prohibit inconsistencies among the files. This may be done by automatically checking that the
Student_name–Student_number values in any GRADE_REPORT record in Figure 1.6(a) match one of
the Name–Student_number values of a STUDENT record (Figure 1.2).
9|Page
When Figure 1.6(b) shows a GRADE_REPORT record that is inconsistent with the STUDENT file in
Figure 1.2 and when the DBMS has no control over this, we have uncontrolled redundancy.

Fig:1.2
10 | P a g e
1.10. Specify all the relationships among the records of the database shown in Figure 1.2.

Ans:

Fig:1.2

11 | P a g e
In the section 1.2 example, we have a university database for maintaining information concerning
students, courses, and grades in a university environment. The database here is organized as five files,
each of which stores data records of the same type.

STUDENT: The STUDENT file stores data on each student. It includes the data to represent the
Student’s Name, Student_number, Class and Major.

COURSE: The COURSE file stores data on each course. It includes the data to represent the
Course_name, Course_number, Credit_hours, and Department.

SECTION: The SECTION file stores data on each section of a course. Thus it is related to the
COURSE_data records.

GRADE_REPORT: The GRADE_REPORT file stores the grades that students receive in the various
sections they have completed. Thus, it is related to the STUDENT and SECTION data records.

PREREQUISITE: The PREREQUISITE file stores the prerequisites of each course. Thus, it is related
to the COURSE data records.

12 | P a g e
1.11. Give some additional views that may be needed by other user groups for the database shown in
Figure 1.2.

A view that groups all the students who took each section and gives each student's grade. This may be
useful for printing the grade report for each section for the university administration's use.
13 | P a g e
(b) A view that gives the number of courses taken and the GPA (grade point average) for each student.
This may be used to determine honors students.

1.12. Cite some examples of integrity constraints that you think can apply to the database shown in
Figure 1.2.

Ans:
Examples:

(a) The Student_Number should be unique for each STUDENT record (key constraint).
(b) The Course_Number should be unique for each COURSE record (key constraint).
(c) A value of Course_Number in a SECTION record must also exist in some COURSE record
(referential integrity constraint).
(d) A value of Student_Number in a GRADE_REPORT record must also exist in some STUDENT
record (referential integrity constraint).
(e) The value of Grade in a GRADE_REPORT record must be one of the values in the set {A, B, C, D,
F, I, U, S} (domain constraint).
(f) Every record in COURSE must have a value for Course_Number (entity integrity constraint).
(g) A STUDENT record cannot have a value of Class=2 (sophomore) unless the student has completed a
number of sections whose total course Credit_Hours is greater than at 24 credits (general semantic
integrity constraint)

1.13: Give examples of systems in which it may make sense to use traditional file processing instead of a
database approach.

Ans:

1. Small internal utility to locate files


2. Small single user application that does not require security (such as a customized calculator or a
personal address and phone book)
3. Real-time navigation system (with heavy computation and very little data)
4. The students may think of others.

14 | P a g e
1.14: Consider Figure 1.2.

a. If the name of the ‘CS’ (Computer Science) Department changes to ‘CSSE’(Computer Science and
Software Engineering) Department and the corresponding prefix for the course number also changes,
identify the columns in the database that would need to be updated.

b. Can you restructure the columns in the COURSE, SECTION, and PREREQUISITE tables so that
only one column will need to be updated?

Answer:
a. The following columns will need to be updated.
Table Column(s)
STUDENT Major
COURSE Course_Number and Department
SECTION Course_Number
PREREQUISITE Course_Number and
Prerequisite_Number

b. WE should split the following columns into two columns:


Table Column Split Columns
COURSE Course_Number Course_Dept and Course_Number
SECTION Course_Number Course_Dept and Course_Number
PREREQUISITE Course_Number Course_Dept and Course_Number
PREREQUISITE Prerequisite_Number PreReq_Dept and PreReq_Num

In the COURSE table, the column Course_Dept will not be needed after the above change, since it is
redundant with the Department column.

15 | P a g e

You might also like