You are on page 1of 19

PATUAKHALI SCIENCE AND TECHNOLOGY

UNIVERSITY
Faculty of Computer Science and Engineering
Assignment 02

Course Code : CCE-223


Course 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. TASNIF RAHMAN
ID No : 1802014
Reg No : 08424
Review Questions and Answers:
Data : Data is any sort of information which is stored in computer memory.
This information can later be used for a website, an application or any other
client to store for future purpose.

Ex -> name, age, class.


Src: [https://www.toolsqa.com/sql/data-database-and-database-management-system/]

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


meaning.
For example, consider the names , telephone numbers, and addresses of people we
know. ... This collection of related data with an implicit meaning is a database.

Src:[https://www.google.com/search?
q=A+Database+is+a+collection+of+related+data+with+an+implicit+meaning.&oq=A+Database+is+a+collection+of+related+
data+with+an+implicit+meaning.&aqs=chrome..69i57.2472j0j4&sourceid=chrome&ie=UTF-8]

DBMS: A database management system (DBMS) is a software


package designed to define, manipulate, retrieve and manage data in a
database. A DBMS generally manipulates the data itself, the data
format, field names, record structure and file structure. It also defines
rules to validate and manipulate this data.
Src:[https://www.techopedia.com/definition/24361/database-management-systems-dbms#:~:text=A%20database
%20management%20system%20(DBMS)%20is%20a%20software%20package%20designed,validate%20and
%20manipulate%20this%20data.]

Database System: Data base system is nothing but database and


DBMS software together we call as data base system.
Src:[https://en.wikibooks.org/wiki/Introduction_to_Database_Systems#:~:text=A%20Database%20Management
%20System%20(DBMS,do%20the%20job%20more%20efficiently.]

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.
Src:[https://www.easytechjunkie.com/what-is-a-database-catalog.htm#:~:text=A%20database%20catalog%20is
%20a,used%20in%20a%20particular%20database.]
Program-data independence: Program-data independence refers to
the capability of leaving data intact and accessible regardless of
modifications to the database that contains the data.
Src:[https://www.techwalla.com/articles/what-is-program-data-independence-metadata]

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.
Src:[https://www.google.com/search?sxsrf=ALeKk00QY-fhIchY6VRH5v4kj-E2d0znOQ
%3A1615644714616&ei=KshMYKSXJZK_8QPhkYSwCg&q=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.&oq=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.&gs_lcp=Cgdnd3Mtd2l6EAMyBAgAEEcyBA
gAEEcyBAgAEEcyBAgAEEcyBAgAEEcyBAgAEEcyBAgAEEcyBAgAEEdQAFgAYMjXB2gAcAN4AIABAIgBAJIBAJgBAaoBB2d3cy13aXrIAQjAAQE&s
client=gws-wiz&ved=0ahUKEwik1LDKua3vAhWSX3wKHeEIAaYQ4dUDCA0&uact=5]

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.
Transaction-processing application: This application is designed to
maintain database integrity in a known, consistent state.

What four main types of actions involve databases?Briefly discuss


about it.
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.
Src:[ https://www.myassignmenthelp.net/types-of-actions-involve-in-database#:~:text=The%20four%20main
%20types%20of,Manipulate%20database%2C%20and%20Share%20database..]

Discuss the main characteristics of database approach and how


it differ from traditional file system?

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 multiuser 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.

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.
Src:[ https://courses.lumenlearning.com/santaana-informationsystems/chapter/characteristics-and-benefits-of-a-
database/]

What are the responsibilities of the DBA and database


designer?
 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.
Src:[ https://www.coursehero.com/file/p3jv6smv/14-What-are-the-responsibilities-of-the-DBA-and-the-
database-designers-The-DBA/#:~:text=The%20DBA%20are%20responsible%20to,structures%20to
%20store%20this%20data.]

What are the different types of database end users?

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

 Casual End Users 
 Naive or parametric end users 
 Sophisticated end users 
 Standalone users 

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

*Casual users learn only a few facilities that they may use repeatedly

*Sophisticated users try to learn most of the DBMS facilities in order to


achieve their complex requirement.

*Standalone users typically become very proficient in using a specific


software package.
Src:[ https://www.geeksforgeeks.org/categories-of-end-users-in-dbms/]

Discussing the capabilities that should be provided by a DBMS:

 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
Src:[ https://www.chegg.com/homework-help/discuss-capabilities-provided-dbms-chapter-1-problem-6rq-
solution-9780133970777-exc]

Discuss the differences between database systems and


information retrieval systems:

# 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.

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.

Exercise:
Identify some informal queries and update operations that you
would expect to apply to the database shown in Figure 1.2.
Ans:
(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.

What is the difference between controlled and uncontrolled


redundancy?Illustrate with examples.

Redundancy is the state of being not or no longer needed or useful.In the


traditional approach, uncontrolled 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, 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 name and course numberalong with the grade, student number, and
section identifier.
Src:[ https://practice.geeksforgeeks.org/problems/what-is-the-difference-between-controlled-and-uncontrolled-
redundancy]
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_numbervalues 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).
WhenFigure 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
Specify all the relationships among the records of the database shown
in Figure 1.2.
Ans:

Fig:1.2
In the section 1.2 example, we have auniversity 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 theCourse_name, Course_number, Credit_hours, and
Department.

SECTION: The SECTION file stores data on each section of a course.


Thus it is related to theCOURSEdata 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 theSTUDENT and SECTION data records.

PREREQUISITE: The PREREQUISITE file stores the prerequisites of


each course.Thus it is related to the COURSE data records.
Give some additional views that may be needed by other user groups
for the database shown in Figure 1.2.

Ans:
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.

(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 th at 24 credits (general semantic integrity constraint)

Give examples of systems in which it may make sense to use


traditional file processing instead of a database approach.
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.

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 cor-responding 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 CourseNumber and
Department
SECTION CourseNumber
PREREQUISITE CourseNumber and
PrerequisiteNumber

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


Table Column Split Columns
COURSE CourseNumber CourseDept and
CourseNum
SECTION CourseNumber CourseDept and
CourseNum
PREREQUISITE CourseNumber CourseDept and
CourseNum
PREREQUISITE PrerequisiteNumber PreReqDept and
PreReqNum

In the COURSE table, the column CourseDept will not be needed


after the above change, since it is redundant with the Department
column.

You might also like