0% found this document useful (0 votes)
17 views

Database

The document provides an overview of database fundamentals, including: - Different types of databases like centralized, client-server, and distributed databases. - The importance of databases as an organizational resource for storing and managing data efficiently. - Key differences between file-based systems and database management systems (DBMS). - Common database terminology and the need for databases to solve problems.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
17 views

Database

The document provides an overview of database fundamentals, including: - Different types of databases like centralized, client-server, and distributed databases. - The importance of databases as an organizational resource for storing and managing data efficiently. - Key differences between file-based systems and database management systems (DBMS). - Common database terminology and the need for databases to solve problems.
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 48

TEE 103

Database Fundamentals
Content
• Introduction to database
• File based systems
• Database management systems
• Centralized Database Systems
• Client-Server Database Systems
• Distributed Database Systems
Session Objectives and Learning Outcomes
• Know common database terminology
• Understand requirements and uses of data
• Know the differences between databases and flat files
• Realize the importance and need for databases in problem-solving
• Understand the different types of databases and their differences
Data: A Resource
• The Success of an organization depends
on efficient use of its resources:
• Buildings, factories, equipment
• Technical know-how
• Human resources
• Data
• Data: An important organizational
resource
Data
• Data are basic values or facts
• Every task a computer carries out works with data in some way.
Without data, a computer would be pretty useless
• It is, therefore, important to understand how to represent and
organize data.
Analog vs Digital Data
• Analog data are continuous
• Nature is analog
• Digital data are discrete and broken
up into a limited number of
elements
• Computers are digital
• All data is stored in binary digits, and
there is a limit to how much data we
can represent.
Types of Data
• Computer systems work with different types of digital data.
• In the early days of computing, data consisted primarily of text and
numbers
• Nowadays, there are lots of different multimedia data types, such as
audio, images, graphics and video
• Ultimately, all data types are stored as binary digits
• For each data type, there are very specific techniques to convert
between the binary language of computers and how we interpret
data using our senses, such as sight and sound.
Databases
• A database is an organized collection of data
• A database provides a structure to organize the data.
• One of the most common data structures is a database table
https://www.youtube.com/watch?v=wR0jg0eQsZA
Data Structure
• Why?
• Large volume in a small space
• Ease of sharing
• Ease of use
• Data analysis
• How?
• File-based system versus databases
File Based Systems
• File based systems
• Data is stored in files
• Each file has a specific format
• Programs that uses these files depend on knowledge
about that format
Problems with file based Systems
• Uncontrolled data redundancy
• Data inconsistency
• Poor data sharing
• Data duplication
• Difficult to keep up with changes
• No provision for security, recovery, concurrency
etc.
• Low productivity
• High maintenance cost
What is a Database System?

• “One or more large structured sets of


persistent data, usually associated with
software to update and query the
data”
• “A collection of data arranged for ease
and speed of search and retrieval”
File-based vs Database
Database Features
• Non-redundant collection of logically related facts
• representing some aspect of the real world
• the data itself plus the data definitions
• Permits sharing
• Consistent representation for each piece of data
• Avoids (minimizes) redundancy
• Allows different user views
• Users are isolated from most changes
Why Databases?
• Control redundancy and consistency
• Ensure integrity/security
• Better scalability
• Allow ad hoc access
• Better maintenance
• Better concurrency
• Independence from representation
formats
Access Flexibility
• Easy to ask ad-hoc questions
• No need for separate codes
• User-friendly interface
• Command-based (e.g., SQL)
Data Integrity
• Ensures that the stored data are
consistent and correct
• Easy to define global rules
• customer_age > 21 years
• number_of_credits < 18
• Can allow multiple users to access data
without compromising on data integrity
Data Security
• Access definition
• Global
• Local
• Uniform access authorization
Data Redundancy
• Data need not be replicated
• Less wastage of storage space
• Less data anomaly
• Reduced and controlled redundancy
• Tighter control of replicated data
Standardization
• Everybody talks the same talk.
• Less chance of misunderstanding
• Easier to interpret other’s data
• Easier to merge
• Useful when several organizations combine to form one.
Productivity and Maintenance
• Increase in productivity
• User-friendly interface
• Independence from specific data structure
• Easier maintenance
• Less code to maintain
• The DBMS is the bulk of the code.
• Ad-hoc queries make it possible to make do with
much less code.
• The vendor makes revisions of the DBMS.
Disadvantages of Databases
• Software complexity
• Processing inefficiency
• Need for co-ordination
• Organizational impact
• Risk
Relational Database
• A relational database stores information in tables. Each informational
them is stored in its own table
• In essence, a relational database will break-up a list into several parts
• One part for each theme in the list
• For example, a Student Database might be divided into a StudentName table,
GradeReport table, etc
An Example of a Relational Database
STUDENT: Name StudentNumber Class Major
Smith 17 1 CSC
Brown 8 2 ECE
Green 24 2 CSC
White 37 1 CSC

GRADE_RPRT: StudentNo Course Grade


17 CSC742 A-
17 CSC316 B
24 CSC742 C-
8 CSC742 B+

25
Group Discussion

• Come up with 2-4 relational part of the following databases

• Library catalogues
• Medical records
• Bank accounts
• Airline bookings
• Train timetables
• Stock market prices

27
Example: Banking System
 Data = information on accounts,
customers, balances, current interest
rates, transaction histories, etc
 Massive
 Persistent
 Multi-user

28
Example (2 of 4)

• Jane at ATM1: withdraw £100 from account #55


• Get balance from database
• If balance > 100 then
• balance := balance – 100
• dispense cash
• put new balance into database

29
Example (3 of 4)

• John at ATM2: withdraw £50 from account #55


• Get balance from database
• If balance > 50 then
• balance := balance – 50
• dispense cash
• put new balance into database
• Initial balance = 100
• Final balance = ??

30
Example (4 of 4)
 Safe
 Convenient
 Efficient

31
Database Users
• End users
• Use the database system to achieve some goal
• Application developers
• Write software to allow end users to interface with the database system

• Database Administrator (DBA)


• Designs & manages the database system
• Database systems programmer
• Writes the database software itself
Database Management System (DBMS)
What is a DBMS ?
• A big program written by someone else that allows us to manage efficiently a large
database and allows it to persist over long periods of time
• It is a software package designed to store and manages information easily and
efficiently

Examples of DBMS
• DB2 (IBM)
• SQL Server, Access (Microsoft),
• Oracle
33
DBMS
• A Specialized piece of software that sits between the data and
its users.
• Buy, install, set up for particular application
• Available for PC’s, workstations, mainframes, supercomputers
• Is expected to:
• Allow users to create new databases (schema)
• Give users the ability to query/modify the data
• Support the storage of very large amounts of data
• Control access to data from many users at once
DBMS
Users / Programmers
DATABASE
• Powerful tool for Application Programs / Queries
providing efficient, SYSTEM
convenient, and safe DBMS
multi-user storage of SOFTWARE Processing Queries / Programs
and access to
massive amounts of Accessing Stored Data
persistent data

Stored Database
Stored
Definition
Database
(Meta-Data)
Database Systems
• A database system consists of
• Data (the database)
• Software
• Hardware
• Users
• Database systems allow users to
• Store
• Update
• Retrieve
• Organise
• Protect
their data.
An Example
The Internet Movie Database
http://www.imdb.com

• Entities:
Actors (800k), Movies (400k), Directors, …

• Relationships:
who played where, who directed what, …

37
Functionality
1. Create/store large datasets
2. Search/query/update
3. Change the structure
4. Concurrent access to many user
5. Recover from crashes

38
1. Create/store Large Datasets
• Files Yes, but…

• DBMS Yes

39
2. Search/Query/Update
• Simple query:
• In what year was ‘Rain man’ produced ?
• Multi-table query:
• Find all movies by ‘Coppola’
• Complex query:
• For each actor, count her/his movies
• Updating
• Insert a new movie; add an actor to a movie; etc

40
2. Search/Query/Update
• Files Simple queries

• DBMS All

Updates: generally OK
41
3. Change the Structure
Add Address to each Actor

• Files Very hard

• DBMS Yes

42
How to Use a DBMS
• Requirements modeling (conceptual)
• Decide what entities should be part of the application and
how they are related
• Schema design and database creation
• Decide on a database schema
• Define the schema to the DBMS
• Load data into the database
• Access to data
• Use a database language
• Write database application programs
• Use database application programs

43
Database Language
• Data Definition Language (DDL). Used to define & change database
schemas.
• Storage Definition Language (SDL). Specify the physical schema.
• View Definition Language (VDL). Used to represent information to
users.
• Data Manipulation Language (DML). Used to query & update data.

44
Who Are Happy with Databases?
• DBMS implementers (???)
• End users and DBMS vendors
• DB application programmers
• E.g. smart webmasters
• Database administrator (DBA)
• Designs logical /physical schemas
• Handles security and authorization
• Data availability, crash recovery
• Database tuning as needs evolve

45
Centralized Database Systems

Database
Client/Server Database Systems

Client

Client
Database
Server
Distributed Database Systems

Database
Server

Database Database
Server Server
Summary
• Data is essential for an organization
• A Database is usually the most effective way of storing and
organizing data
• File-based Vs. database systems
• Database system properties
• Types of database systems
• DBMS used to maintain, query large datasets.
• Benefits include recovery from system crashes, concurrent
access, quick application development, data integrity, and
security.
49

You might also like