0% found this document useful (0 votes)
97 views65 pages

Chapter 1

This document provides information about the ITEC2071 Fundamentals of Database Systems course taught in April 2021. It outlines the course contact details, assessment breakdown of 40% coursework and 60% examination, recommended textbooks, topics to be covered including data models, SQL, and database design, and provides an overview of database systems compared to traditional file-based approaches.

Uploaded by

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

Chapter 1

This document provides information about the ITEC2071 Fundamentals of Database Systems course taught in April 2021. It outlines the course contact details, assessment breakdown of 40% coursework and 60% examination, recommended textbooks, topics to be covered including data models, SQL, and database design, and provides an overview of database systems compared to traditional file-based approaches.

Uploaded by

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

FUNDAMMETAL DATABASE

SYSTEMS(ITEC2071)
Fundamentals of database systems
2
Course Information
Contact details
 Assessment
 Gemeda Raga  40% Coursework
 Some lab-marked exercises
 gamadaraga143@gmail.com
 A written exercise with a
 Office: database design
 60% Examination
 written exam
 Answer all of the questions

Fundamental database Systems April 2021


3
Textbook
 Recommended textbooks:  Other textbooks:
 ‘Database Systems: A  There are lots of database
practical approach to design, texts
implementation and  Most of them would be fine
management’ by Connolly also
and Begg
 For example:
 `A first course in database
systems’ by Ullman and
 ‘Database Systems’ by CJ Date
Widom.
 Rameez Elmasri and
Shamakanth B. Navathe

Fundamental database Systems April 2021


Course Overview
4

 Several main topics  Practical sessions


 Database systems  Will start on 23 April
 Data models  Ms-access
 Database design  SQL
 SQL  creating a database
 querying a database

Fundamental database Systems April 2021


Outline
5

 Introduction Database Systems


 View of Data
 Data Definition Language
 Data Manipulation Language
 Database Administrator
 Database Users
 Overall System Structure
 Data Models

Fundamental database Systems


April 2021
6
Introduction to Database System
 Data management passes through the different levels of
development along with the development in technology and
services.
 These levels could best be described by categorizing the levels into
three levels of development. Even though there is an advantage and
a problem overcome at each new level, all methods of data handling
are in use to some extent. The major three levels are;
 Manual Approach
 Traditional File Based Approach
 Database Approach

Fundamental database Systems April 2021


7

Fundamental database Systems April 2021


File-based Approach
8

 A collection of application programs that perform services


for the end-users such as the production of reports . Each
program defines and manages its own data.
 Data is stored in one or more separate computer files
 Data is then processed by computer programs - applications
 This approach is the decentralized computerized data
handling method.
 File, in traditional file based approach, is a collection of
records which contains logically related data.

Fundamental database Systems April 2021


9
File-based Approach

Fundamental database Systems April 2021


File-based Approach
10

Fundamental database Systems April 2021


Drawbacks of using file-based approach
11

 Drawbacks of using file systems to store data:


 Data redundancy and inconsistency

 Multiple file formats, duplication of information in different


files
 Difficulty in accessing data

 Need to write a new program to carry out each new task


 Data isolation - multiple files and formats

 Integrity problems

 Integrity constraints
 Hard to add new constraints or change existing ones

Fundamental database Systems April 2021


Drawbacks of using file systems (cont.)
12

 Atomicity of updates
 Failures may leave database in an inconsistent state with
partial updates carried out
 Example: Transfer of funds from one account to another
should either complete or not happen at all
 Concurrent access by multiple users
 Concurrent access needed for performance
 Uncontrolled concurrent accesses can lead to inconsistencies
 Example: Two people reading a balance and updating
it at the same time
 Security problems
 Hard to provide user access to some, but not all, data

Fundamental database Systems April 2021


Database Approach
13

 Arose because:
 Definition of data was embedded in application programs,
rather than being stored separately and independently
 No control over access and manipulation of data beyond
that imposed by application programs
 Result:
 The Database and Database Management System (DBMS).

Fundamental database Systems April 2021


Database Approach
14

Fundamental database Systems April 2021


Hierarchy of database
Example
15

Personal file
(Project
Database Department file database)

Payroll file

005-10-6321 Johns Francine 10-7-65


549-77-1001 Buckley Bill 2-17-79 (Personnel file)
Files 098-40-1370 Fiske Steven 1-5-85
(Record containing
Records SSN, last name, first
098-40-1370 Fiske Steven 1-5-85 598
name, date of hire)

Fields Fiske (Last name field)

Characters
(bytes) 1000100 (Letter ‘F’ in ASCII)
Fundamental database Systems April 2021
Terminology
16

 Database
 A collection of integrated and related files
 File
 A collection of related records
 Record
 A collection of related fields
 Field
 A group of characters
 Character
 Basic building block of information, represented by a
byte

Fundamental database Systems April 2021


Advantages of the database approach
17

 Database systems offer solutions to all the above problems


 A database is a storage space for content /
information (data)
 Data Independence/Reduced Maintenance
 Improved Data Sharing
 Increased Application Development Productivity
 Enforcement of Standards
 Improved Data Quality (Constraints)
 Better Data Accessibility/ Responsiveness
 Security, Backup/Recovery, Concurrency

Fundamental database Systems April 2021


Why Study Databases?
18

 Databases are useful  Databases in IT


 Many computing  Databases are a ‘core
applications deal with topic’ in information
large amounts of technology
information  Basic concepts and skills
 Database systems give a with database systems
set of tools for storing, are part of the skill set
searching and managing you will be assumed to
this information have as a IT graduate

Fundamental database Systems April 2021


What is a Database?
19

 “A set of information held in a computer”


Oxford English Dictionary
 “One or more large structured sets of persistent
data, usually associated with software to update and
query the data”
Free On-Line Dictionary of Computing
 “A collection of data arranged for ease and speed of
search and retrieval”
Dictionary.com
 A database represents some aspect of the real world,
sometimes called the mini-world or the Universe of
Discourse (UoD).
Fundamental database Systems April 2021
What is a Database?
20

 Shared collection of logically related data (and a description


of this data), designed to meet the information needs of an
organization.

 Shared collection – can be used simultaneously by many


departments and users.
 Logically related - comprises the important objects and the
relationships between these objects.
 Description of the data – the system catalogue (meta-data)
provides description of data to enable data independence.

Fundamental database Systems April 2021


Databases everywhere!
21

 Web indexes  Train timetables


 Library catalogues  Airline bookings
 Medical records  Credit card details
 Bank accounts  Student records
 Stock control  Customer histories
 Personnel systems  Stock market prices
 Product catalogues  Discussion boards
 Telephone directories  and so on… so that
 Databases touch all aspects
of our lives
Fundamental database Systems April 2021
Database Systems
22
 A database system consists of  People Includes database designers,
 Data (the database) DBAs, application programmers,
 Used by the organization and a and end-users.
description of this data called the schema.  We focus mainly on the software
 Software
 Database systems allow users to
 DBMS, operating system, network
software (if necessary) and also the  Store
application programs.  Update
 Hardware  Retrieve
 Can range from a PC to a network of  Organise
computers.
 Protect
 Procedures
 Instructions and rules that should be their data.
applied to the design and use of the
database and DBMS.

Fundamental database Systems April 2021


Database Users
23

 End users  Database Administrator


 Use the database system (DBA)
to achieve some goal  Designs & manages the

 Application developers database system


 Write software to allow  Database systems
end users to interface programmer
with the database system  Writes the database
software itself

Fundamental database Systems April 2021


Database Management Systems
24

 A software system that enables users to define,


create, and maintain the database and that provides
controlled access to this database.

 A software program that interacts with the database


by issuing an appropriate request (typically an SQL
statement) to the DBMS.

Fundamental database Systems April 2021


Database Management Systems
25

 A database management  Examples:


system (DBMS) is the  Oracle
software than controls that  DB2 (IBM)
information
 MS SQL Server

 MS Access
 Application program A
 Ingres
computer that interacts with
the database by issuing an  PostgreSQL
program appropriate request  MySQL
(typically an SQL statement)
to the DBMS.
Fundamental database Systems April 2021
Database Management Systems
26

Fundamental database Systems April 2021


What the DBMS does
27

 Provides users with  DBMS provides


 Data definition language  Persistence
(DDL)  Concurrency
 Data manipulation language  Integrity
(DML)  Security
 Data control language (DCL)  Data independence
 Often these are all the  Data Dictionary
same language  Describes the database itself

Fundamental database Systems April 2021


Types of SQL LANGUAGES
28

 Data Definition Language (DDL) commands - that define a


database, including creating, altering, and dropping tables
and establishing constraints
 Data Manipulation Language (DML) commands - that
maintain and query a database
 Data Control Language (DCL) commands - that control a
database, including administering privileges and committing
data

Fundamental database Systems April 2021


DDL, DML, DCL, and the database
development process
29

Fundamental database Systems April 2021


Data Dictionary - Metadata
30

 The dictionary or catalogue  The dictionary holds


stores information about  Descriptions of database
the database itself objects (tables, users,
 This is data about data or rules, views, indexes,…)
‘metadata’  Information about who is

 Almost every aspect of the using which data (locks)


 Schemas and mappings
DBMS uses the dictionary

Fundamental database Systems April 2021


Data Models
31

 Data Model: A set of concepts to describe the structure


of a database, and certain constraints that the database
should obey.

 Data Model Operations: Operations for specifying


database retrievals and updates by referring to the
concepts of the data model. Operations on the data model
may include basic operations and user-defined
operations.

Fundamental database Systems April 2021


Implementation of Data Models

 Hierarchical
 Network
 Relational

Fundamental database Systems 32 2021


April
1. Hierarchical Database Model

 Logically represented by an upside down tree


 Each parent can have many children

 Each child has only one parent

Fundamental database Systems 33 2021


April
Sample Database of Hierarchical model

Fundamental database Systems 34 2021


April
Hierarchical Database Model
 Advantages
 Conceptual simplicity
 Database security and integrity
 Data independence
 Efficiency
 Disadvantages
 Complex implementation
 Difficult to manage and lack of standards
 Lacks structural independence
 Applications programming and use complexity
 Implementation limitations

Fundamental database Systems 35 2021


April
2. Network Database Model

 Each record can have multiple parents


 Composed of sets
 Each set has owner record and member record
 Member may have several owners

Figure
Fundamental database Systems
1.10
36 2021
April
Network Database Model
 Advantages
 Conceptual simplicity
 Handles more relationship types
 Data access flexibility
 Promotes database integrity
 Data independence
 Conformance to standards
 Disadvantages
 System complexity
 Lack of structural independence

Fundamental database Systems 37 2021


April
3. Relational Database Model

 Perceived by user as a collection of tables for data storage


 Tables are a series of row/column intersections
 Tables related by sharing common entity characteristic (s)

Fundamental database Systems 38 2021


April
Relational Database Model (con’t.)

Figure 1.11

Fundamental database Systems 39 2021


April
Relational Database Model

 Advantages
 Structural independence

 Improved conceptual simplicity

 Easier database design, implementation,


management, and use
 Ad hoc query capability with SQL

 Powerful database management system

Fundamental database Systems 40 2021


April
Weaknesses of RDBMSs

 Poor Representation of “Real World” Entities


 Normalization leads to relations that do not correspond to
entities in “real world”.

 Semantic Overloading
 Relational model has only one construct for representing
data and data relationships: the table.
 Relational model is semantically overloaded.

Fundamental database Systems 41 2021


April
Weaknesses of RDBMSs

 Poor Support for Business Rules


 Limited Operations
 RDBMSs only have a fixed set of operations which
cannot be extended.
 Difficulty Handling Recursive Queries
 Extremely difficult to produce recursive queries.
 Extension proposed to relational algebra to handle this
type of query is unary transitive (recursive) closure
operation.

Fundamental database Systems 42 2021


April
Weaknesses of RDBMSs

 Impedance Mismatch
 Most DMLs lack computational completeness.
 To overcome this, SQL can be embedded in a high-level
3GL.
 This produces an impedance mismatch - mixing different
programming paradigms.

Fundamental database Systems 43 2021


April
ANSI/SPARC Architecture
44

 ANSI - American National  A three-level architecture


Standards Institute  Internal level: For systems
designers
 SPARC - Standards
Planning and Requirements
 Conceptual level: For
database designers and
Committee1975 - proposed administrators
a framework for DBs  External level: For database
users

Fundamental database Systems April 2021


Three-Schema Architecture
45

• Objectives of Three-Schema Architecture


• All users should be able to access same data
• A user’s view is immune to changes made in other views
• Users should not need to know physical database storage
details
• DBA should be able to change database storage structures
without affecting the users’ views
• Internal structure of database should be unaffected by
changes to physical aspects of storage
• DBA should be able to change conceptual structure of
database without affecting all users

Fundamental database Systems April 2021


Three-Schema Architecture
46

Fundamental database Systems April 2021


Three-Schema Architecture
47

 Defines DBMS schemas at three levels:


 Internal schema at the internal level to describe physical
storage structures and access paths. Typically uses a physical
data model.
Or describes HOW the system will be implemented using a
specific DBMS
 Conceptual schema at the conceptual level to describe the
structure and constraints for the whole database for a
community of users. Uses a conceptual or an implementation
data model Or describes WHAT the system contains
 External schemas at the external level to describe the various
user views. Usually uses the same data model as the conceptual
level.

Fundamental database Systems April 2021


Three-Schema Architecture and Data
Independence
48

Fundamental database Systems April 2021


Data Independence
49

 Data Independence is the capacity to change the schema at one


level of a database system without having to change the schema at
the next higher level
 Logical Data Independence: Change conceptual schema
without having to change external schemas and their application
programs.
 Physical Data Independence: Change internal schema without
having to change conceptual schema.

Fundamental database Systems April 2021


Data Independence and the ANSI-SPARC
Three-level Architecture
50

Fundamental database Systems April 2021


Historical Development of Database
Technology

 Early Database Applications: Hierarchical and


Network Models (in mid 1960’s).
 Relational Model based Systems: Researched and
experimented with in IBM and the universities (in
1970).
 Object-oriented applications: OODBMSs (in late
1980’s and early 1990’s )
 Data on the Web and E-commerce Applications:
using new standards like XML (extended Markup
Language).

Fundamental database Systems Slide 2021


April 1-51
Schemas versus Instances
52

 Database Schema: The description of a database.


 Schema Diagram: A diagrammatic display of (some
aspects of) a database schema.
 Schema Construct: A component of the schema or an
object within the schema, e.g., STUDENT, COURSE.

Fundamental database Systems April 2021


53

Fundamental database Systems April 2021


Schemas versus Instances
54

Database Instance: The actual data stored in a


database at a particular moment in time. Also called
database state (or occurrence).
Since Instance is actual data of database at some
point in time, changes rapidly
To define a new database, we specify its database
schema to the DBMS (database is empty)

Fundamental database Systems April 2021


student name student number class major
smith 17 1 cosc
55 brown 8 2 cosc

course courseName coursenumber Cradit hours depertment


intro to com duts s cie nce cosc1310 4 cosc
data s tr ucture s cosc3320 4 cosc
dis math2410 3 math
database cosc3380 3 cosc

rerequisite
pre requisite course numbe r
number
cosc3380 cosc3320
cosc3330 math2410
cosc3320 cosc1310

section sectionldentifier coursenumber semester year instructor


85 math2410 fall 86 king
92 cosc1310 fall 86 anderson
102 cosc3320 spring 87 kuuth
112 math2410 fall 87 chang
119 cosc1310 fall 87 anderson
135 cosc3380 fall 87 stone

grade_report student number sectionldentifier grade


17 112 B
17 119 C
8 85 A
8 92 A
8 102 B
8 Fundamental
135 database
A Systems April 2021
Instances and Schemas
56

 Similar to types and variables in programming


languages
 Schema – the logical structure of the database
 e.g., the database consists of information about a set of customers and accounts
and the relationship between them)
 Analogous to type information of a variable in a program
 Physical schema: database design at the physical level
 Logical schema: database design at the logical level
 Instance – the actual content of the database at a
particular point in time
 Analogous to the value of a variable

Fundamental database Systems April 2021


Physical (Storage) schema
57 decisions
 Mapping of entities to files (OS files)
 Data representation and encoding (compression)
 Access methods (Direct, Hashing, Indexed)
 Which indexes to maintain
 Clustering of records
 OS/DBMS issues (buffer management)

Fundamental database Systems April 2021


External (View) schema decisions
58

 Which entities to present/filter


 Data representation and encoding (compression)
 Programming language dependent issues
 Changes to names, order of attributes
 Derived (computed) fields and joined tables

Fundamental database Systems April 2021


Database Schema Vs. Database State
59

• Database State: Refers to the content of a database at a


moment in time.
• Initial Database State: Refers to the database when it is
loaded
• Valid State: A state that satisfies the structure and constraints
of the database.
• Distinction
• The database schema changes very infrequently. The
database state changes every time the database is updated.
• Schema is also called intension, whereas state is called
extension.
Fundamental database Systems April 2021
60

Fundamental database Systems April 2021


Different parts of a database
61

 Fields
 Records
 Queries
 Reports

Fundamental database Systems April 2021


Different parts of a database: Fields
62

 Database storage units


 Generic elements of content

Fundamental database Systems April 2021


Different parts of a database: Records
63

 A simple table showing fields (columns) and


records(rows):

 And as part of an MS Access database table

Fundamental database Systems April 2021


Different parts of a database: Queries
64

 Queries are the information retrieval requests you


make to the database
 Your queries are all about the information you are
trying to gather

Fundamental database Systems April 2021


Different parts of a database: Reports
65

 If the query is a question...


...then the report is its answer
 Reports can be tailored to the needs of the data-user,

making the information they extract much more


useful

Fundamental database Systems April 2021

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy