SlideShare uma empresa Scribd logo
Lecture 1-3
Introduction to Databases
Outline
Introduction
Traditional File Based system
File-Based Approach
Limitation of File Based system
Database Approach
Applications of Database System
View of Data
Data Abstraction
Instances and Schemas
Data Models
Database Languages
DML
DDL
Database Design
Design Process
The Entity-Relationship Model
Normalization
Data Storage and Querying
Storage Manager
The Query Processor
Transaction Management
Database Architecture
Database Users and Administrators
Introduction
What is Data?
Fact and Figures or distinct pieces of information
What is a database?
Collection of related data.
What is a database Management System?
Database systems give a set of tools for storing, searching and managing this
information
What is a database Application?
database application is simply a program that interacts with the database at
some point in its execution. It is an intermediary between user and DBMS.
Traditional File Based System
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.
Conventional file systems are inadequate as database systems, because they fail to
support efficient search, efficient modifications to small pieces of data, complex
queries, or atomic and independent execution of transactions.
File-Based Processing
© Pearson Education Limited 1995, 2005
Activity
Make a group of two people
Search on web or from your text book the limitation of the file based system.
Give presentation on it using board.
Limitation of File Based system
In the early days, database applications were built on top of file systems
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:
Incompatible file formats
Programs are written in different languages, and so cannot easily access each other’s files.
Integrity problems
Integrity constraints (e.g. account balance > 0) become part of program code
Hard to add new constraints or change existing ones
Fixed Queries/Proliferation of application programs
Any new requirement needs a new program.
Limitation of File Based system(Cont.)
Atomicity of updates
Failures may leave database in an inconsistent state with partial updates carried out
E.g. transfer of funds from one account to another should either complete or not happen at all
Concurrent access by multiple users
Concurrent accessed needed for performance
Uncontrolled concurrent accesses can lead to inconsistencies
E.g. two people reading a balance and updating it at the same time
Security problems
Database systems offer solutions to all the above problems
Database Management System (DBMS)
© Pearson Education Limited 1995, 2005
Database Approach
Applications of Database-System
Enterprise Information: Sales, Accounting, Human Resource
Airline reservation systems: For reservation, scheduling
Banking systems: Credit and transaction, Finance
Telecommunication: records of calls, monthly bills, communication networks
Levels of Abstraction
Physical level describes how a record (e.g., customer) is stored.
Logical level: describes data stored in database, and the relationships among the data.
type customer = record
name : string;
street : string;
city : integer;
end;
View level: application programs hide details of data types. Views can also hide
information (e.g., salary) for security purposes.
View of Data
• Allows each user to have his or her own view of the database.
• A view is essentially some subset of the database.
• An architecture for a database system
Views - Benefits
Reduce complexity
Provide a level of security
Provide a mechanism to customize the appearance of the database
Present a consistent, unchanging picture of the structure of the database, even if
the underlying database is changed
Instances and Schemas
Similar to types and variables in programming languages
Schema – the structure view (design) 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
Physical Data Independence – the ability to modify the physical schema without changing the logical schema
Applications depend on the logical schema
In general, the interfaces between the various levels and components should be well defined so that changes in some
parts do not seriously influence others.
Data Models
A collection of tools for describing
Data, Data relationships, Data semantics, Data constraints
A data model provides a way to describe the design of a database at the physical,
logical, and view levels. The data models can be classified into four different
categories:
Relational model
Entity-Relationship data model (mainly for database design)
Object-based data models (Object-oriented and Object-relational)
Semistructured data model (XML)
Other older models:
Network model
Hierarchical model
Entity-Relationship Model
Example of schema in the entity-relationship model
Relational Model
All the data is stored in various tables.
Example of tabular data in the relational model
Columns
Rows
A Sample Relational Database
Database Languages
Database system provides DDL to specify the database schema and DML to express
database queries and updates.
Data Definition Language (DDL)
Specification notation for defining the database schema
E.g.
create table account (
account-number char(10),
balance integer)
DDL compiler generates a set of tables stored in a data dictionary
Data dictionary contains metadata (i.e., data about data)
Data storage and definition language
These statements define the implementation details of the database schemas, which are
usually hidden from the users.
Usually an extension of the data definition language
Data Manipulation Language (DML)
Language for accessing and manipulating the data organized by the appropriate data
model
DML also known as query language
Two classes of languages
Procedural – user specifies what data is required and how to get those data
Nonprocedural – user specifies what data is required without specifying how to get
those data
SQL is the most widely used query language
SQL
SQL: widely used non-procedural language
E.g. find the name of the customer with customer-id 192-83-7465
select customer.customer-name
from customer
where customer.customer-id = ‘192-83-7465’
E.g. find the balances of all accounts held by the customer with customer-id 192-
83-7465
select account.balance
from depositor, account
where depositor.customer-id = ‘192-83-7465’ and
depositor.account-number = account.account-number
Application programs generally access databases through one of
Language extensions to allow embedded SQL
Application program interface (e.g. ODBC/JDBC) which allow SQL queries to be
sent to a database
Database Design
The process of designing the general structure of the database:
Specification: to characterize fully the data needs of the prospective database
users.
Conceptual Design: The focus at this point is on describing the data and their
relationships
Business decision – What attributes should we record in the database?
Computer Science decision – What relation schemas should we have and how
should the attributes be distributed among the various relation schemas?
There are principally two ways to tackle the problem.
entity-relationship model
Normalization: that takes as input the set of all attributes and generates a set of tables
Continue
The process of moving from an abstract data model to the implementation of the
database proceeds in two final design phases
Logical Design: designer maps the high-level conceptual schema onto the
implementation data model of the database system that will be used
Physical Design: the physical features of the database are specified. These features
include the form of file organization and the internal storage structures
Design Approaches
Need to come up with a methodology to ensure that each of the relations in the
database is “good”
Two ways of doing so:
Entity Relationship Model (Chapter 7)
Models an enterprise as a collection of entities and relationships
Represented diagrammatically by an entity-relationship diagram:
Normalization Theory (Chapter 8)
Formalize what designs are bad, and test for them
Database Engine
Storage manager
Query processing
Storage Management
Storage manager is a program module that provides the interface between the low-
level data stored in the database and the application programs and queries submitted
to the system.
The storage manager is responsible to the following tasks:
Interaction with the OS file manager
Efficient storing, retrieving and updating of data
Issues:
Storage access
File organization
Indexing and hashing
Query Processing
The query processor components include:
DDL interpreter, which interprets DDL statements and records the definitions
in the data dictionary.
DML compiler, which translates DML statements in a query language into an
evaluation plan consisting of low-level instructions that the query evaluation
engine understands.
The DML compiler also performs query optimization; that is, it picks the lowest cost
evaluation plan from among the alternatives.
Query evaluation engine, which executes low-level instructions generated by the
DML compiler.
Transaction Management
What if the system fails?
What if more than one user is concurrently updating the same data?
A transaction is a collection of operations that performs a single logical function in
a database application
Transaction-management component ensures that the database remains in a
consistent (correct) state despite system failures (e.g., power failures and
operating system crashes) and transaction failures.
Concurrency-control manager controls the interaction among the concurrent
transactions, to ensure the consistency of the database.
Database System Internals
Database Users
Users are differentiated by the way they expect to interact with the system
Application programmers – interact with system through DML calls
Sophisticated users – form requests in a database query language
Specialized users – write specialized database applications that do not fit into the
traditional data processing framework
Naïve users – invoke one of the permanent application programs that have been
written previously
E.g. people accessing database over the web, bank tellers, clerical staff
Database Administrator
Coordinates all the activities of the database system; the database administrator
has a good understanding of the enterprise’s information resources and needs.
Database administrator's duties include:
Schema definition
Storage structure and access method definition
Schema and physical organization modification
Granting user authority to access the database
Specifying integrity constraints
Acting as liaison with users
Monitoring performance and responding to changes in requirements
Database Architecture
The architecture of a database systems is greatly influenced by
the underlying computer system on which the database is running:
Centralized
Client-server
Parallel (multi-processor)
Distributed
Application Architectures
Two-tier architecture: E.g. client programs using ODBC/JDBC to
communicate with a database
Three-tier architecture: E.g. web-based applications, and
applications built using “middleware”
Suggested Reading
Chapter 1 of Database System Concepts by Abraham Silberschatz
Chapter 1,2,3,4 of Database Systems: A Practical Approach to Design, Implementation,
and Management by Thomas Conolly

Mais conteúdo relacionado

Semelhante a Lecture 1 to 3intro to normalization in database

Ch1 2
Ch1 2Ch1 2
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
koolkampus
 
Database Management System, Lecture-1
Database Management System, Lecture-1Database Management System, Lecture-1
Database Management System, Lecture-1
Sonia Mim
 
Ch1- Introduction to dbms
Ch1- Introduction to dbmsCh1- Introduction to dbms
Ch1- Introduction to dbms
Shakila Mahjabin
 
Dbms 1
Dbms 1Dbms 1
Dbms 1
kartik_chell
 
21UCAC 41 Database Management System.ppt
21UCAC 41 Database Management System.ppt21UCAC 41 Database Management System.ppt
21UCAC 41 Database Management System.ppt
ssuser7f90ae
 
Dbms models
Dbms modelsDbms models
Dbms models
devgocool
 
DBMS - Introduction
DBMS - IntroductionDBMS - Introduction
DBMS - Introduction
JOSEPHINE297640
 
27 fcs157al2
27 fcs157al227 fcs157al2
27 fcs157al2
CHANDRA BHUSHAN
 
Dbms
DbmsDbms
Dbms
saurav-IT
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System Introduction
Smriti Jain
 
Data base management system
Data base management systemData base management system
Data base management system
Navneet Jingar
 
DBMS
DBMSDBMS
Database systems - Chapter 2 (Remaining)
Database systems - Chapter 2 (Remaining)Database systems - Chapter 2 (Remaining)
Database systems - Chapter 2 (Remaining)
shahab3
 
Dbms
DbmsDbms
dbms notes.ppt
dbms notes.pptdbms notes.ppt
dbms notes.ppt
Ranjit273515
 
DBMS and its Models
DBMS and its ModelsDBMS and its Models
DBMS and its Models
AhmadShah Sultani
 
Dbms module i
Dbms module iDbms module i
Dbms module i
SANTOSH RATH
 
Mis chapter 7 database systems
Mis chapter 7 database systemsMis chapter 7 database systems
Mis chapter 7 database systems
Filmon Habtemichael Tesfai
 
Ch-1-Introduction-to-Database.pdf
Ch-1-Introduction-to-Database.pdfCh-1-Introduction-to-Database.pdf
Ch-1-Introduction-to-Database.pdf
MrjJoker1
 

Semelhante a Lecture 1 to 3intro to normalization in database (20)

Ch1 2
Ch1 2Ch1 2
Ch1 2
 
1. Introduction to DBMS
1. Introduction to DBMS1. Introduction to DBMS
1. Introduction to DBMS
 
Database Management System, Lecture-1
Database Management System, Lecture-1Database Management System, Lecture-1
Database Management System, Lecture-1
 
Ch1- Introduction to dbms
Ch1- Introduction to dbmsCh1- Introduction to dbms
Ch1- Introduction to dbms
 
Dbms 1
Dbms 1Dbms 1
Dbms 1
 
21UCAC 41 Database Management System.ppt
21UCAC 41 Database Management System.ppt21UCAC 41 Database Management System.ppt
21UCAC 41 Database Management System.ppt
 
Dbms models
Dbms modelsDbms models
Dbms models
 
DBMS - Introduction
DBMS - IntroductionDBMS - Introduction
DBMS - Introduction
 
27 fcs157al2
27 fcs157al227 fcs157al2
27 fcs157al2
 
Dbms
DbmsDbms
Dbms
 
Database Management System Introduction
Database Management System IntroductionDatabase Management System Introduction
Database Management System Introduction
 
Data base management system
Data base management systemData base management system
Data base management system
 
DBMS
DBMSDBMS
DBMS
 
Database systems - Chapter 2 (Remaining)
Database systems - Chapter 2 (Remaining)Database systems - Chapter 2 (Remaining)
Database systems - Chapter 2 (Remaining)
 
Dbms
DbmsDbms
Dbms
 
dbms notes.ppt
dbms notes.pptdbms notes.ppt
dbms notes.ppt
 
DBMS and its Models
DBMS and its ModelsDBMS and its Models
DBMS and its Models
 
Dbms module i
Dbms module iDbms module i
Dbms module i
 
Mis chapter 7 database systems
Mis chapter 7 database systemsMis chapter 7 database systems
Mis chapter 7 database systems
 
Ch-1-Introduction-to-Database.pdf
Ch-1-Introduction-to-Database.pdfCh-1-Introduction-to-Database.pdf
Ch-1-Introduction-to-Database.pdf
 

Último

一比一原版(UofT毕业证)多伦多大学毕业证如何办理
一比一原版(UofT毕业证)多伦多大学毕业证如何办理一比一原版(UofT毕业证)多伦多大学毕业证如何办理
一比一原版(UofT毕业证)多伦多大学毕业证如何办理
exukyp
 
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理 原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
tzu5xla
 
A gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented GenerationA gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented Generation
dataschool1
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
eoxhsaa
 
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
1tyxnjpia
 
一比一原版(uob毕业证书)伯明翰大学毕业证如何办理
一比一原版(uob毕业证书)伯明翰大学毕业证如何办理一比一原版(uob毕业证书)伯明翰大学毕业证如何办理
一比一原版(uob毕业证书)伯明翰大学毕业证如何办理
9gr6pty
 
Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
blueshagoo1
 
Digital Marketing Performance Marketing Sample .pdf
Digital Marketing Performance Marketing  Sample .pdfDigital Marketing Performance Marketing  Sample .pdf
Digital Marketing Performance Marketing Sample .pdf
Vineet
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
Márton Kodok
 
Data Scientist Machine Learning Profiles .pdf
Data Scientist Machine Learning  Profiles .pdfData Scientist Machine Learning  Profiles .pdf
Data Scientist Machine Learning Profiles .pdf
Vineet
 
一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理
zsafxbf
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
slg6lamcq
 
一比一原版澳洲西澳大学毕业证(uwa毕业证书)如何办理
一比一原版澳洲西澳大学毕业证(uwa毕业证书)如何办理一比一原版澳洲西澳大学毕业证(uwa毕业证书)如何办理
一比一原版澳洲西澳大学毕业证(uwa毕业证书)如何办理
aguty
 
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
asyed10
 
Sample Devops SRE Product Companies .pdf
Sample Devops SRE  Product Companies .pdfSample Devops SRE  Product Companies .pdf
Sample Devops SRE Product Companies .pdf
Vineet
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
ihavuls
 
Template xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptxTemplate xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptx
TeukuEriSyahputra
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
SaffaIbrahim1
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
Vietnam Cotton & Spinning Association
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
Timothy Spann
 

Último (20)

一比一原版(UofT毕业证)多伦多大学毕业证如何办理
一比一原版(UofT毕业证)多伦多大学毕业证如何办理一比一原版(UofT毕业证)多伦多大学毕业证如何办理
一比一原版(UofT毕业证)多伦多大学毕业证如何办理
 
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理 原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
原版一比一爱尔兰都柏林大学毕业证(UCD毕业证书)如何办理
 
A gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented GenerationA gentle exploration of Retrieval Augmented Generation
A gentle exploration of Retrieval Augmented Generation
 
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
一比一原版多伦多大学毕业证(UofT毕业证书)学历如何办理
 
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
一比一原版(Sheffield毕业证书)谢菲尔德大学毕业证如何办理
 
一比一原版(uob毕业证书)伯明翰大学毕业证如何办理
一比一原版(uob毕业证书)伯明翰大学毕业证如何办理一比一原版(uob毕业证书)伯明翰大学毕业证如何办理
一比一原版(uob毕业证书)伯明翰大学毕业证如何办理
 
Econ3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdfEcon3060_Screen Time and Success_ final_GroupProject.pdf
Econ3060_Screen Time and Success_ final_GroupProject.pdf
 
Digital Marketing Performance Marketing Sample .pdf
Digital Marketing Performance Marketing  Sample .pdfDigital Marketing Performance Marketing  Sample .pdf
Digital Marketing Performance Marketing Sample .pdf
 
Build applications with generative AI on Google Cloud
Build applications with generative AI on Google CloudBuild applications with generative AI on Google Cloud
Build applications with generative AI on Google Cloud
 
Data Scientist Machine Learning Profiles .pdf
Data Scientist Machine Learning  Profiles .pdfData Scientist Machine Learning  Profiles .pdf
Data Scientist Machine Learning Profiles .pdf
 
一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理一比一原版莱斯大学毕业证(rice毕业证)如何办理
一比一原版莱斯大学毕业证(rice毕业证)如何办理
 
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
一比一原版南十字星大学毕业证(SCU毕业证书)学历如何办理
 
一比一原版澳洲西澳大学毕业证(uwa毕业证书)如何办理
一比一原版澳洲西澳大学毕业证(uwa毕业证书)如何办理一比一原版澳洲西澳大学毕业证(uwa毕业证书)如何办理
一比一原版澳洲西澳大学毕业证(uwa毕业证书)如何办理
 
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
一比一原版美国帕森斯设计学院毕业证(parsons毕业证书)如何办理
 
Sample Devops SRE Product Companies .pdf
Sample Devops SRE  Product Companies .pdfSample Devops SRE  Product Companies .pdf
Sample Devops SRE Product Companies .pdf
 
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
原版制作(unimelb毕业证书)墨尔本大学毕业证Offer一模一样
 
Template xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptxTemplate xxxxxxxx ssssssssssss Sertifikat.pptx
Template xxxxxxxx ssssssssssss Sertifikat.pptx
 
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docxDATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
DATA COMMS-NETWORKS YR2 lecture 08 NAT & CLOUD.docx
 
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
[VCOSA] Monthly Report - Cotton & Yarn Statistics March 2024
 
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
06-12-2024-BudapestDataForum-BuildingReal-timePipelineswithFLaNK AIM
 

Lecture 1 to 3intro to normalization in database

  • 2. Outline Introduction Traditional File Based system File-Based Approach Limitation of File Based system Database Approach Applications of Database System View of Data Data Abstraction Instances and Schemas Data Models Database Languages DML DDL Database Design Design Process The Entity-Relationship Model Normalization Data Storage and Querying Storage Manager The Query Processor Transaction Management Database Architecture Database Users and Administrators
  • 3. Introduction What is Data? Fact and Figures or distinct pieces of information What is a database? Collection of related data. What is a database Management System? Database systems give a set of tools for storing, searching and managing this information What is a database Application? database application is simply a program that interacts with the database at some point in its execution. It is an intermediary between user and DBMS.
  • 4. Traditional File Based System 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. Conventional file systems are inadequate as database systems, because they fail to support efficient search, efficient modifications to small pieces of data, complex queries, or atomic and independent execution of transactions.
  • 5. File-Based Processing © Pearson Education Limited 1995, 2005
  • 6. Activity Make a group of two people Search on web or from your text book the limitation of the file based system. Give presentation on it using board.
  • 7. Limitation of File Based system In the early days, database applications were built on top of file systems 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: Incompatible file formats Programs are written in different languages, and so cannot easily access each other’s files. Integrity problems Integrity constraints (e.g. account balance > 0) become part of program code Hard to add new constraints or change existing ones Fixed Queries/Proliferation of application programs Any new requirement needs a new program.
  • 8. Limitation of File Based system(Cont.) Atomicity of updates Failures may leave database in an inconsistent state with partial updates carried out E.g. transfer of funds from one account to another should either complete or not happen at all Concurrent access by multiple users Concurrent accessed needed for performance Uncontrolled concurrent accesses can lead to inconsistencies E.g. two people reading a balance and updating it at the same time Security problems Database systems offer solutions to all the above problems
  • 9. Database Management System (DBMS) © Pearson Education Limited 1995, 2005
  • 11. Applications of Database-System Enterprise Information: Sales, Accounting, Human Resource Airline reservation systems: For reservation, scheduling Banking systems: Credit and transaction, Finance Telecommunication: records of calls, monthly bills, communication networks
  • 12. Levels of Abstraction Physical level describes how a record (e.g., customer) is stored. Logical level: describes data stored in database, and the relationships among the data. type customer = record name : string; street : string; city : integer; end; View level: application programs hide details of data types. Views can also hide information (e.g., salary) for security purposes.
  • 13.
  • 14.
  • 15. View of Data • Allows each user to have his or her own view of the database. • A view is essentially some subset of the database. • An architecture for a database system
  • 16. Views - Benefits Reduce complexity Provide a level of security Provide a mechanism to customize the appearance of the database Present a consistent, unchanging picture of the structure of the database, even if the underlying database is changed
  • 17. Instances and Schemas Similar to types and variables in programming languages Schema – the structure view (design) 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 Physical Data Independence – the ability to modify the physical schema without changing the logical schema Applications depend on the logical schema In general, the interfaces between the various levels and components should be well defined so that changes in some parts do not seriously influence others.
  • 18. Data Models A collection of tools for describing Data, Data relationships, Data semantics, Data constraints A data model provides a way to describe the design of a database at the physical, logical, and view levels. The data models can be classified into four different categories: Relational model Entity-Relationship data model (mainly for database design) Object-based data models (Object-oriented and Object-relational) Semistructured data model (XML) Other older models: Network model Hierarchical model
  • 19. Entity-Relationship Model Example of schema in the entity-relationship model
  • 20. Relational Model All the data is stored in various tables. Example of tabular data in the relational model Columns Rows
  • 22. Database Languages Database system provides DDL to specify the database schema and DML to express database queries and updates.
  • 23. Data Definition Language (DDL) Specification notation for defining the database schema E.g. create table account ( account-number char(10), balance integer) DDL compiler generates a set of tables stored in a data dictionary Data dictionary contains metadata (i.e., data about data) Data storage and definition language These statements define the implementation details of the database schemas, which are usually hidden from the users. Usually an extension of the data definition language
  • 24. Data Manipulation Language (DML) Language for accessing and manipulating the data organized by the appropriate data model DML also known as query language Two classes of languages Procedural – user specifies what data is required and how to get those data Nonprocedural – user specifies what data is required without specifying how to get those data SQL is the most widely used query language
  • 25. SQL SQL: widely used non-procedural language E.g. find the name of the customer with customer-id 192-83-7465 select customer.customer-name from customer where customer.customer-id = ‘192-83-7465’ E.g. find the balances of all accounts held by the customer with customer-id 192- 83-7465 select account.balance from depositor, account where depositor.customer-id = ‘192-83-7465’ and depositor.account-number = account.account-number Application programs generally access databases through one of Language extensions to allow embedded SQL Application program interface (e.g. ODBC/JDBC) which allow SQL queries to be sent to a database
  • 26. Database Design The process of designing the general structure of the database: Specification: to characterize fully the data needs of the prospective database users. Conceptual Design: The focus at this point is on describing the data and their relationships Business decision – What attributes should we record in the database? Computer Science decision – What relation schemas should we have and how should the attributes be distributed among the various relation schemas? There are principally two ways to tackle the problem. entity-relationship model Normalization: that takes as input the set of all attributes and generates a set of tables
  • 27. Continue The process of moving from an abstract data model to the implementation of the database proceeds in two final design phases Logical Design: designer maps the high-level conceptual schema onto the implementation data model of the database system that will be used Physical Design: the physical features of the database are specified. These features include the form of file organization and the internal storage structures
  • 28. Design Approaches Need to come up with a methodology to ensure that each of the relations in the database is “good” Two ways of doing so: Entity Relationship Model (Chapter 7) Models an enterprise as a collection of entities and relationships Represented diagrammatically by an entity-relationship diagram: Normalization Theory (Chapter 8) Formalize what designs are bad, and test for them
  • 30. Storage Management Storage manager is a program module that provides the interface between the low- level data stored in the database and the application programs and queries submitted to the system. The storage manager is responsible to the following tasks: Interaction with the OS file manager Efficient storing, retrieving and updating of data Issues: Storage access File organization Indexing and hashing
  • 31. Query Processing The query processor components include: DDL interpreter, which interprets DDL statements and records the definitions in the data dictionary. DML compiler, which translates DML statements in a query language into an evaluation plan consisting of low-level instructions that the query evaluation engine understands. The DML compiler also performs query optimization; that is, it picks the lowest cost evaluation plan from among the alternatives. Query evaluation engine, which executes low-level instructions generated by the DML compiler.
  • 32. Transaction Management What if the system fails? What if more than one user is concurrently updating the same data? A transaction is a collection of operations that performs a single logical function in a database application Transaction-management component ensures that the database remains in a consistent (correct) state despite system failures (e.g., power failures and operating system crashes) and transaction failures. Concurrency-control manager controls the interaction among the concurrent transactions, to ensure the consistency of the database.
  • 34. Database Users Users are differentiated by the way they expect to interact with the system Application programmers – interact with system through DML calls Sophisticated users – form requests in a database query language Specialized users – write specialized database applications that do not fit into the traditional data processing framework Naïve users – invoke one of the permanent application programs that have been written previously E.g. people accessing database over the web, bank tellers, clerical staff
  • 35. Database Administrator Coordinates all the activities of the database system; the database administrator has a good understanding of the enterprise’s information resources and needs. Database administrator's duties include: Schema definition Storage structure and access method definition Schema and physical organization modification Granting user authority to access the database Specifying integrity constraints Acting as liaison with users Monitoring performance and responding to changes in requirements
  • 36. Database Architecture The architecture of a database systems is greatly influenced by the underlying computer system on which the database is running: Centralized Client-server Parallel (multi-processor) Distributed
  • 37. Application Architectures Two-tier architecture: E.g. client programs using ODBC/JDBC to communicate with a database Three-tier architecture: E.g. web-based applications, and applications built using “middleware”
  • 38. Suggested Reading Chapter 1 of Database System Concepts by Abraham Silberschatz Chapter 1,2,3,4 of Database Systems: A Practical Approach to Design, Implementation, and Management by Thomas Conolly