0% found this document useful (0 votes)
13 views29 pages

LECT 5 COS 101-Databse Systems - New

Uploaded by

abrahamigomu1
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)
13 views29 pages

LECT 5 COS 101-Databse Systems - New

Uploaded by

abrahamigomu1
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/ 29

INTRODUCTION TO

COMPUTING SCIENCE
LECT 5 COS 101
DATABASE SYSTEM
LEARNING OUTCOME

• Describe the basic principle of database management system.


WHAT IS A DATABASE?

•By definition:
Database is an organized collection of operational
data used by the application systems of a particular
enterprise to derive information from data.
IMPORTANT TERMINOLOGIES

Operational data: data maintained about the operation of an Enterprise: generic term for any reasonably large-scale
enterprise.
• E.g Baze university commercial, scientific, technical, or other application
• Department
• manufacturing
• Students
• Course • financial
• Tutor
• medical
• Employee etc
• E.g Shoprite Enterprise • university
• Sales
• government
• Product
• Manufacturer
• Category
• Suppliers
WHAT IS A DATABASE SYSTEM (DBMS)?

DBMS: Is a software for storing, managing, and facilitating access


to databases.

Examples:
DATABASE LANGUAGE

• Structured query language (SQL): A standard programming


language for manipulating data within a database.
WHO INTERACTS WITH A DBMS?

i. System analyst
ii. Database Designers
iii. Database Administrators
iv. Application Developers
v. Users of enterprise applications
TRADITIONAL DATA SYSTEM VS DBMS

• The traditional DATA system sometimes called a flat file


• Is a one-dimensional storage system
• Redundancy of data.
• Customer service department can only have information on data, which can’t be seen by
marketing department nor purchasing department.
TRADITIONAL (FLAT FILE) SYSTEM VS DBMS
• DBMS
• Is a multidimensional data storage system (Information is accessible from a variety of
perspectives (from different users)).
• There exist internal links (relationships) between entries.
• Therefore, no redundancy in data.

EXAMPLE:
• Get the customers with the most
purchase.
• Get most purchased items
• Give premiums and advertise similar
products to them
APPLICATIONS OF DBMS
• Banking: For customer information, accounts, loans, and banking transactions.
• Airlines: For reservations and schedule information. Airlines were among the first to use databases
in a geographically distributed manner.
• Universities: For student information, course registrations, section, instructor and grades.
• Credit Card transactions: For purchases on credit cards and generation of monthly statements.
• Telecommunication: For keeping records of calls made, generating monthly bills, maintaining
balances on prepaid calling cards, and storing information about the communication networks.
• Finance: For storing information about holdings, sales, and purchases of financial instruments such
as stocks and bonds;
APPLICATIONS CONT..
• Finance: for storing real-time market data to enable on-line trading by customers and
automated trading by the firm.
• Sales: For customer, product, and purchase information.
• On-line retailers: For sales data noted above plus on-line order tracking/ generation of
recommendation lists, and maintenance of on-line product evaluations.
• Manufacturing: For management of the supply chain and for tracking production of
items in factories, inventories of items in warehouses and stores, and orders for items.
• Human resources: For information about employees, salaries, payroll taxes, benefits,
and for generation of pay checks
DBMS ARCHITECTURE
LEVELED ARCHITECTURE OF A DBMS
Conceptual
External /
Model (ERM)
View 1 Logical
Mapping Logical / Physical
Mapping
View 2 Logical Physical
Database Database

Physical Level
View n (as stored)
Logical Level
External Level
(View Level)
Logical Data Physical Data
Independence Independence
PICTORIAL VIEW OF DBMS ARCHITECTURE
(Interaction between the end user and the database)
LEVELS OF ABSTRACTION
Users
• Views (also called External level): describe how
users see the data.
• Conceptual schema (Logical level): defines
View 1 View 2 View 3
logical structure, (data tables and relationships).
• Physical schema (physical level) describes the Conceptual Schema
actual files and indexes stored (raw data). Physical Schema

DB
DBMS EXAMPLE: UNIVERSITY DATABASE

• External Schema (View):


• Course_info
• Conceptual schema:
• Students
• Courses
• Enrolled
• Physical schema:
• Relations stored as unordered files (within the meta-data).
• Index on first column of Students (sid).
DATABASE MODELS

Database models

1. Relational database model


is primarily about the conceptual view
of a database.
2. Object-oriented database model

3. NoSQL database model


RELATIONAL DATABASE MODEL

• Relation: A rectangular table


• Attribute: A column in the table
• Tuple: A row in the table

Cust ID Name Address Email Phone number


ct211 Joe biden 22 wuse [email protected] 08033212220
ct212 Faith evans 3 gateway [email protected] 08123232345

A relational Table containing customer details


RELATIONAL DESIGN
• Problem:
• When a single customer makes many purchases, there is bound to be repetition of customer record. E.g
ct211
• Also difficult to delete because the purchase details are both important.
• Solution:
• Avoid multiple concepts within one relational table.
• Split table by operational data.

Cust IDx Name Address Email Phone Product Product descriptio Order id Order Order
number ID name n date quantity
ct211 Joe biden 22 wuse jb@gmail. 08033212 00d1 disinfectta Detol 0001 12/07/200 5
com 220 nt disinfectan 3 repeated
t
ct212 Faith 3 gateway feve@yah 08123232 00t4 Tambourin Ppr 0005 5/07/2009 1
evans oo.com 345 e company
ct211 Joe biden 22 wuse jb@gmail. 08033212 00rr2 Music box Gg 0004 12/07/200 10
com 220 company 3
SOLUTION
Separate concepts into individual relational tables, whereby a table Order can manage relationship between Customer and
Product.

Customer table
Product table
Cust ID Name Address Email Phone
number Prod ID Name Description Category Supplier
ct211 Joe biden 22 wuse jb@gmail. 08033212
00d1 disinfectant Detol 1 Mark ben
com 220
disinfectant
ct212 Faith 3 gateway feve@yah 08123232
00t4 Tambourine Ppr flat ab Philips global
evans oo.com 345
00rr2 Music box Gg small, blue

Order table
Order ID Cust ID Prod ID Quantity Date Amount

0001 ct211 00d1 5 12/07/2003 58000

0005 ct212 00t4 1 5/07/2009 10,000

ct211 00rr2 5 12/07/2003 100,000


RELATIONAL OPERATIONS

• Select: Choose rows


• Project: Choose columns
THE SELECT OPERATION
THE PROJECT OPERATION
OTHER OPERATIONS

• Structured Query Language (SQL) – high level language for manipulating


contents of a relational table on tuples (rows) basis.
• Example of SQL operations for manipulating data are:
1. insert
2. update
3. delete
4. select
OBJECT-ORIENTED DATABASES

• Object-oriented Database: A database constructed by applying the


object-oriented paradigm

✔ Each entity stored as a persistent object


✔ Relationships indicated by links between objects
✔ DBMS maintains inter-object links
NOSQL DATABASE MODEL
• What does NoSQL stand for
• Not only SQL
• No Relational Model
• No RDBMS

• NoSQL is basically used to refer to any database that


does not follow the RDBMS principles. There is no
standard NoSQL data model. NoSQL refers to a new
generation of databases that address the specific
challenges of Big data era.
APPLICATIONS WITH NOSQL
DB
SIGNIFICANT TERMINOLOGIES

• Data Mining: The area of computer science that deals with discovering patterns in
collections of data.
• Class description
• Class discrimination
• Cluster analysis
• Association analysis
• Outlier analysis
• Sequential pattern analysis

• Data warehouse: A static data collection to be mined


• Data cube: Data presented from many perspectives to enable mining

• Distributed Database: A database stored on multiple machines


• DBMS will mask this organizational detail from its users

You might also like