0% found this document useful (0 votes)
11 views40 pages

CHPT 1

The document provides an overview of database systems, their importance in modern society, and the role of Database Management Systems (DBMS) in managing data. It discusses the characteristics, advantages, and various applications of databases, including multimedia and geographical information systems. Additionally, it outlines the history of database applications, highlighting the evolution from early systems to relational and object-oriented databases.

Uploaded by

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

CHPT 1

The document provides an overview of database systems, their importance in modern society, and the role of Database Management Systems (DBMS) in managing data. It discusses the characteristics, advantages, and various applications of databases, including multimedia and geographical information systems. Additionally, it outlines the history of database applications, highlighting the evolution from early systems to relational and object-oriented databases.

Uploaded by

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

CSC 2702

Intro to Databases

Department of Computer Science


School of Natural Sciences
University of Zambia
Intro to Databases
• Database systems are an essential component of life in modern society
most of us encounter several activities every day that involve some
interaction with a database

• Examples?

• Traditional Applications

• Numeric

• Textual
Recent Applications of Databases
• Multimedia Databases

• Geographical Information Systems (GIS)

• Data Warehouses

• OLAP

• Real-time/Active Databases

• Database Search/Query Techniques


What is a Database?
• A collection of related data.

• What is Data?

• Facts that can be recorded and that have implicit meaning aka Information

• Example,

• the names, telephone numbers, and addresses of the people you know is a
collection of related data with an implicit meaning
What is a Database?
• Data has a Source: Usually represents some aspect of the real world.

• Data is Logically Coherent: Collected data has inherent meaning. A


random collection of data cannot correctly be referred to as a database.

• Data can Change: Updates to the data occur are usually reflected in the
database.

• Database is Planned: A database is designed, built, and populated with


data for a specific purpose. It has an intended group of users and
planned-for usage.
Database Management System (DBMS)
• a software system that enables users to create and maintain a database.

• DBMS facilitates the processes of

• Defining the database – specifying the data types, structures, and constraints of the
data to be stored in the database;
• Constructing the database – building and storing the data on some storage medium
• Manipulating the database – functions such as querying the database to retrieve
specific data, updating the database to reflect changes, and generating reports; and
• Sharing the database – controlling access among various users and simultaneously.
Database Management System (DBMS)
• DBMS facilitates the processes of

• Protecting the database – protection against hardware or software malfunction (or


crashes) and security protection against unauthorized or malicious access.
• Maintaining the database – maintaining the database system, allowing it to evolve as
requirements change over time (sometimes spanning years).

• Database + DBMS = Database System


Illustration of DB System
Example of a Student Database
• A simple UNIVERSITY database for maintaining information concerning students
grades

• The database is composed of the following files/tables


1. STUDENT table stores data on each student

2. COURSE table stores data on each course

3. SECTION file stores data on each section of a course, like which year and which lecturer

4. GRADE_REPORT table stores the grades that students receive in the various sections they
have completed

5. PREREQUISITE table stores the prerequisites of each course


Example of a Student Database
Example of a Student Database
Example of a Student Database
Example of a Student Database
• Defining this database, involves specifying the structure of the records of each
table by specifying the different types of data elements/attributes to be stored in
each record.

• STUDENT record includes data attributes like Name, Student_number, Class and
Major;
• Name is a string of alphabetic characters,

• Student_number is an integer

• Class is an integer

• Major is a string of alphabetic characters,

• COURSE record includes data attributes like Course_name, Course_number,


Credit_hours, and Department
Example of a Student Database
• Constructing the database, involves storing data to represent each student,
course, section, grade report, and prerequisite as a record in the appropriate
file/table.

• Data records in the various tables are almost always related and have many
relationships among the records.

• For example,
• the record for Smith in the STUDENT file is related to two records in the GRADE_REPORT file
that specify Smith’s grades in two sections.

• each record in the PREREQUISITE file relates two course records: one representing the course
and the other representing the prerequisite.
Example of a Student Database
• Manipulating the database involves querying and updating the data records in
one or more tables.

• Examples of queries are as follows:


• Retrieve the transcript—a list of all courses and grades—of ‘Smith’
Example of a Student Database
• Examples of queries are as follows:
• List the prerequisites of the ‘Database’ course

• List the names of students who took the section of the ‘Database’ course offered in fall
2008 and their grades in that section.
Example of a Student Database
• Examples of updates are as follows:
• Change the class of ‘Smith’ to 2nd year student

• Create a new section for the ‘Database’ course for this semester

• Enter a grade of ‘A’ for ‘Smith’ in the ‘Database’ section of last semester
Characteristics of the Database Approach
• Database approach vs older approach of writing customized programs to access
data stored in files (i.e. traditional file processing)

• Characteristics of the database approach versus the file-processing approach are


the following:
1. Self-describing nature of a database system

2. Insulation between programs and data, and data abstraction

3. Support of multiple views of the data

4. Sharing of data and multiuser transaction processing


(1) Self-Describing Nature of a Database System
• In the database approach the database system contains not only the database itself but
also a complete definition of the database structure and constraints (aka meta-data)
• Meta data includes information such as the structure of each file, the type and storage format of each
data item, and various constraints on the data

• Meta data is stored in the DBMS catalog

• The catalog is used by the DBMS software and also by database users who need
information about the database structure

• DBMS software can access diverse databases by extracting the database definitions from
the catalog—for example, a university database, a banking database, or a company
database

• In traditional file processing approach, programs are constrained to work with only one
specific database, whose structure is declared in the application programs
(1) Self-Describing Nature of a Database System
Example of Meta Data
(2) Insulation between Programs and Data, & Data Abstraction

• In traditional file processing approach, changes to the structure of a file may


require changing all programs that access that file because the structure of data
files is embedded in the application programs

• In the database approach, the structure of data files is stored in the DBMS catalog
separately from the access programs.
• We call this property program-data independence.

• In object-oriented and object-relational systems user application programs can


operate on the data by invoking operations (methods) through their names and
arguments, regardless of how the operations are implemented.
• We call this property program-operation independence.

• Program-Data Independence + Program-Operation Independence = Data Abstraction


(2) Insulation between Programs and Data, & Data Abstraction

• In the database approach, the DBMS provides users with a conceptual


representation of data that does not include many of the details of how the data is
stored or how the operations are implemented
• It hides storage and implementation details that are not of interest to most database users

• It stores the structure and organization details in the catalog

• A data model is a type of data abstraction that is used for conceptual


representation (more on this later)
(3) Support of Multiple Views of the Data

• In the database approach, a database typically has many types of users, each of
whom may require a different perspective or view of the database.

• A view may be a subset of the database or it may contain virtual data that is
derived from the database files but is not explicitly stored.

• For example,
• one user of the database of in our student db example may be interested only in accessing and
printing the transcript of each student (a)

• a second user, may only be interested in checking that students have taken all the prerequisites
of each course for which the student registers (b)
(3) Support of Multiple Views of the Data
(4) Sharing of Data and Multiuser Transaction Processing

• In the database approach a DBMS, allows multiple users to access the database
at the same time.

• The DBMS includes concurrency control software to ensure that several users
trying to update the same data does not cause problems

• Any ideas where this is useful?

• Multi usage results in multiple transactions


• A transaction is an executing program or process that includes one or more database
accesses, such as reading or updating of database records.

• Each transaction is supposed to execute without interference from other transactions.


Database Actors/Users
• In large organizations, many people are involved in the design, use, and
maintenance of a large database. These typically are:
1. Database Administrators (DBA)
• chief administrator of the DB

• responsible for authorizing access to the database, coordinating and monitoring its use, and
acquiring software and hardware resources as needed.

• accountable for problems such as security breaches and poor system response time

2. Database Designers
• discusses with all prospective database users in order to understand their requirements and
then creates a design that meets the requirements of the users

• responsible for identifying the data to be stored in the database and for choosing
appropriate structures to represent and store this data
Database Actors/Users
3. End Users
• DB is built for them

• query, update, and generate reports from the database

• Types of end users?? (READ details in 7th ed.)

4. System Analysts & Application Programmers (Software Developers /


Engineers)
• Systems Analysts determine the requirements of end users, and develop specifications
that application programmer

• Application Programmers implement the specifications as applications; then they test,


debug, document, and maintain
Advantages of Using the DBMS Approach

(1) Controlling Redundancy

• In traditional software development utilizing file processing, every user group


maintains its own files for handling its data-processing applications.

• This is data redundancy i.e storing the same data multiple times

• Leads to several problems


• wasted effort – there is the need to perform a single logical update multiple times

• wasted storage space – storing the the same data repeatedly

• data inconsistency – data stored in multiple locations becomes inconsistent if not all updated
simultaneously

• In the database approach, we have a database design that stores each logical data
item in only one place in the database – data normalization
Advantages of Using the DBMS Approach

(2) Restricting Unauthorized Access

• In a multi-user database the type of access operation—retrieval or update—must


be controlled.

• A DBMS provides security and authorization which the DBA uses to create
accounts and to specify account restrictions.

• For example,
• In a university database only Academic Office staff may be allowed to enroll students but cannot
add course grades.

• While lectures and instructors can only view students but not enroll. However, can add course
grades
Advantages of Using the DBMS Approach

(3) Providing Persistent Storage for Program Data

• Programming languages typically have complex data structures

• The values of program variables or objects are discarded once a program


terminates, unless the programmer explicitly stores them in permanent files

• Databases can be used to provide persistent storage for program data

• Data is said to be persistent, since it survives the termination of program execution


and can later be directly retrieved by another program
Advantages of Using the DBMS Approach

(4) Providing Storage Structures and Search Techniques for Efficient Query
Processing

• The DBMS provide specialized data structures called indexes to efficiently execute
searches, queries and updates

• In order to process the database records needed by a particular query, those records must
be copied from disk to main memory

• Therefore, the DBMS often has a buffering or caching module that maintains parts of the
database in main memory buffers

• The query processing and optimization module of the DBMS is responsible for choosing
an efficient query execution plan for each query based on the existing storage structures

• The choice of which indexes to create and maintain is part of physical database design and
tuning, which is one of the responsibilities of the DBA staff
Advantages of Using the DBMS Approach

(5) Providing Backup and Recovery

• A DBMS provides facilities for recovering from hardware or software failures

• For example, if the computer system fails in the middle of an update transaction,
the DBMS makes sure that the database is restored to the state it was in before the
transaction started executing.

• Physical disk backup is also necessary in case of a catastrophic disk failure.


Advantages of Using the DBMS Approach

(6) Providing Multiple User Interfaces

• Many types of users with varying levels of technical knowledge use a database,

• DBMS should provide a variety of user interfaces e.g.


• apps for mobile users,

• query languages for casual users,

• programming language interfaces (or APIs) for application programmers,

• forms and command codes for parametric users, and

• menu-driven interfaces and natural language interfaces for standalone users

• Both forms-style interfaces and menu-driven interfaces are commonly known as


graphical user interfaces (GUIs)
Advantages of Using the DBMS Approach

(7) Representing Complex Relationships among Data

• A database may include numerous varieties of data that are interrelated in many
ways

• A DBMS has
• the capability to represent a variety of complex relationships among the data,

• to define new relationships as they arise, and

• to retrieve and update related data easily and efficiently.


Advantages of Using the DBMS Approach

(8) Enforcing Integrity Constraints

• A DBMS provides capabilities for defining and enforcing constraints


1. Data Type Constraint - involves specifying a data type for each data item

2. Referential Integrity Constraint - involves specifying that a record in one file must be related to
records in other files

3. Key/Uniqueness Constraint - uniqueness on data item values, e.g. every course record must have a
unique Course_code

• Constraints are derived from the meaning or semantics of the data and of what it represents

• It is the responsibility of the database designers to identify integrity constraints during


database design

• Some constraints can be specified to the DBMS and automatically enforced

• Other constraints may have to be checked by update programs or at the time of data entry
Advantages of Using the DBMS Approach

(9) Permitting Inferencing and Actions

• Some database systems provide capabilities for defining deduction rules for
inferencing new information from the stored database facts – called deductive
database systems
• Rules, when compiled and maintained by the DBMS can allow it to make deductions.

• In a traditional DBMS, this is done by an application program

• But if the rules change, it is more convenient to change the declared deduction rules than to
recode the application program(s)

• Relational database systems can associate triggers with tables


• A trigger is a form of a rule activated by updates to the table, which results in performing some
additional operations to some other tables
Other Advantages of Using the DBMS Approach
10. Potential for Enforcing Standards - The database approach allows the DBA to
enforce organization-wide standards among database users in a large
organization, enhancing communication and cooperation across departments.
11. Reduced Application Development Time – Compared to file-based systems
that would need to start from scratch using a DBMS significantly reduces the time
required to develop new applications after the initial database setup.
12. Flexibility - Modern DBMSs provide the ability to modify database structures as
needs evolve without disrupting existing data or applications
13. Availability of Up-to-Date Information - A DBMS ensures that updates are
immediately visible to all users, which is crucial for transaction-heavy applications
like reservations and banking.
14. Economies of Scale - The DBMS approach consolidates data and resources,
reducing redundancy and allowing the organization to invest in higher-
performance infrastructure, thereby lowering overall costs.
History of Database Applications – READ details in 7th ed.

Early Database Systems (1960s-1980s): Initial database systems used hierarchical


and network models, which tightly coupled data storage with its physical placement,
making them inflexible for new queries and challenging to reorganize.

Relational Databases (1980s onwards): Relational databases introduced data


abstraction and program-data independence, improving flexibility and efficiency by
separating data storage from conceptual representation and using high-level query
languages.

Object-Oriented Databases (1980s-1990s): With the rise of object-oriented


programming, databases evolved to handle complex, structured data, though these
systems remained niche, leading to the development of object-relational databases
(ORDBMSs).
History of Database Applications – READ details in 7th ed.

Web and E-Commerce (1990s onwards): The rise of the web and e-commerce
drove the need for dynamic data exchange on web pages, leading to the
development of standards like XML for data interchange between databases and
web applications.

Specialized Database Extensions: As database applications expanded into new


areas like scientific research, multimedia, and data mining, DBMSs were extended
with new data types, operations, and modules to better support these specialized
needs.

Big Data and NoSQL (21st Century): The explosion of data from social media, e-
commerce, and cloud storage required new database systems (NoSQL) that could
handle large-scale, nontraditional data types and provide fast, reliable storage and
retrieval, supplementing traditional SQL systems.

You might also like