尊敬的 微信汇率:1円 ≈ 0.046166 元 支付宝汇率:1円 ≈ 0.046257元 [退出登录]
SlideShare a Scribd company logo
Week 1 - Introduction
IS220 - Database Systems
Dios Kurniawan, MSc
Text Book
• Database System Concepts 6th
Edition, Abraham Silberschatz,
et al, McGraw-Hill
• Additional reading: Connolly, T.
M. (2005). Database Systems: A
Practical Approach to Design,
Implementation, and
Management, (4th Ed.), Essex:
Addison Wesley
Note: you must have the printed copy of the book
Course Structure
1. Introduction to DBMS (week 1)
2. File Organization (week 2)
3. Indexing and Hashing (week 3-4)
4. Query Processing and Optimization (week 5-6)
5. Transactions (week 7)
6. OO DBMS, XML (week 8-9)
7. DB Architectures, parallel, distributed DB (week
10-12)
8. Advanced Application Development (week 13)
Class Activity
• 70% theory
• 30% hands-on assignments
– Students will work in pairs (2 students each group)
– Each group to prepare A MS Windows 7/8 laptop
Assessment
• 35% Group work & individual homework
• 30% Mid-term Tests
• 35% Final Exam
• Minimum 80% class attendance
Class Rules
• Class normally starts at 7:30 and stops at 9:10 (but
there might be times that it will start at 7:20)
• Attendance check will be done at 7:45 – I cannot
accept excuses such as “macet”, “cannot find parking
spot” or “flat tyre”
• No phones inside the class – tablets are OK but do not
use them for social media or chat
• If anytime you feel you need to go to the washroom, or
make a phone call outside, please do so – no need to
ask for my permission
• English to be used at all times
• Please sit in the front rows whenever possible
• Please dress professionally
Let’s Get Started
What is A Database?
• Is an organized collection of data
• Computer program can quickly select the
desired pieces of data
• Typically a database is organized by:
– Fields (=single piece of information)
– Records (=complete set of fields)
– Files (=collection of records)
Data is Produced …
• Each time you make a phone
call or send messages
• Each time you withdraw
money from an ATM
• Each time you purchase a
merchandise in a retail shop
• Each time you book an airline
ticket
• ..and many many more
Picture source: google.com
An Example – call detail record
• The telephone number of the
caller and the calling partner
• The time when the conversation
started
• How long the call lasted
• How much the cost
• What cell tower identification
was serving the caller
6282346376766 +6285334692755 2014/02/01 00:26:20.0 63 500 510101630030573
6282291065057 +6285259187902 2014/02/01 00:49:25.0 430 2000 510100910840061
6285367034197 +6281354260056 2014/02/01 00:51:23.0 163 750 510100917165221
6282198087732 +6282292261026 2014/02/01 00:13:12.0 54 250 510101221640754
6281360050554 +6282372171347 2014/02/01 00:28:50.0 391 1750 510100980136873
6282170311008 +6282238722355 2014/02/01 00:44:29.0 104 500 510100036500045
A telecommunication company could generate hundreds of million of such records in a day!
freepatentsonline.com
field
record
Database Management System
(DBMS)
• DBMS contains information about a particular organization:
– Collection of interrelated data
– Set of programs to access the data
– An environment that is both convenient and efficient to use
• Database Applications:
– Banking: transactions
– Airlines: reservations, schedules
– Universities: registration, grades
– Sales: customers, products, purchases
– Online retailers: order tracking, customized recommendations
– Manufacturing: production, inventory, orders, supply chain
– Human resources: employee records, salaries, tax deductions
• Databases touch all aspects of our lives
• Databases can be very large.
Popular DBMS Products
>40% market share
>15 % market share
>20% market share
3% market share
Open source:
Source: Oracle.com, Teradata.com, Microsoft.com, Postgresql.org
University Database Example
• Application program examples
– Add new students, instructors, and courses
– Register students for courses, and generate class
rosters
– Assign grades to students, compute grade point
averages (GPA) and generate transcripts
• In the early days, database applications were
built directly on top of file systems
Drawbacks of Using File Systems
• 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 (e.g., account balance must be > 0)
become “buried” in program code rather than being stated
explicitly
– Hard to add new constraints or change existing ones
Drawbacks of using file systems to store
data (Cont.)
– Atomicity of updates
• Failures may leave database in an inconsistent state with partial updates carried out
• Example: Transfer of students 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 (say 100) and updating it by withdrawing
money (say 50 each) at the same time
– Security problems
• Hard to provide user access to some, but not all, data
Database systems offer solutions to all the above problems
Database systems provide abstract view of the data
View of Data
An architecture for a database system
Levels of Abstraction
• Physical level: describes how a record (e.g., customer) is
stored.
• Logical level: describes what data stored in database, and
the relationships among the data.
type instructor = record
ID : string;
name : string;
dept_name : string;
salary : integer;
end;
• View level: application programs hide details of data
types. Views can also hide information (such as an
employee’s salary) for security purposes.
Instances and Schemas
• Similar to types and variables in programming languages : schema is when
variables are declared, instance is when the program is run
• Schema – the logical structure of the database
– Example: 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
• Categories:
1. Relational model
2. Entity-Relationship data model (mainly for database
design)
3. Object-based data models (Object-oriented and Object-
relational)
4. Semistructured data model (XML)
• Other older models:
– Network model
– Hierarchical model
Relational Model
• Relation = table = file
• Tuples = rows = Records.
• Column = field
• Example of tabular data in the relational model: Columns
Rows
(Tuples)
A Sample Relational Database
How to Access The Data
• Use these languanges:
1. DML
2. DDL
Data Manipulation Language (DML)
• Language for accessing and manipulating the
data organized by the appropriate data model
– DML also known as query language
• Query = request to retrieve some information
• Two classes of languages
– Procedural – user specifies what data is required
and how to get those data
– Declarative (non-procedural) – user specifies
what data is required without specifying how to
get those data – easier to learn
• SQL is the most widely used non-procedural
query language
Data Definition Language (DDL)
• Specification notation for defining the database schema
Example: create table instructor (
ID char(5),
name varchar(20),
dept_name varchar(20),
salary numeric(6))
• DDL compiler generates a set of table templates stored in a data dictionary
• Data dictionary contains metadata (data about data)
– Database schema
– Integrity constraints
• Primary key (ID uniquely identifies instructors)
• Referential integrity (references constraint in SQL)
– e.g. dept_name value in any instructor tuple must appear in department relation
– Authorization
SQL
• SQL: widely used non-procedural language
– Example: Find the name of the instructor with ID 22222
select name
from instructor
where instructor.ID = ‘22222’
– Example: Find the ID and building of instructors in the Physics dept.
select instructor.ID, department.building
from instructor, department
where instructor.dept_name = department.dept_name and
department.dept_name = ‘Physics’
• 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
• Chapters 3, 4 and 5
Database Design
The process of designing the general structure of the database:
• Logical Design – Deciding on the database schema. Database design
requires that we find a “good” collection of relation schemas.
– 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?
• Physical Design – Deciding on the physical layout of the database
Database Design?
• Is there any problem with this design?
Yes, Many Problems
• Redundant/repetition of tuples : so many
departments are repeated
• Waste of space
• Complicates updates on the table : if we want
to change a budget of a department, many
tuples must be changed
• Cannot create new department unless at least
one instructor is present in the department
Design Approaches
• Normalization Theory
– Dividing large tables into smaller ones, and
defining the relationships between them
– Reduce repetitions
– Isolates data, thus inserts/deletes/updates
can be made in just one table
• Entity Relationship Model
– An abstract way to describe a database
The Entity-Relationship Model
• Models an enterprise as a collection of entities and relationships
– Entity: a “thing” or “object” in the organization that is
distinguishable from other objects
• Described by a set of attributes
– Relationship: an association among several entities
• Represented diagrammatically by an entity-relationship
diagram:
1..10..*
Individual Homework #1
• Name one IT application you find in your daily life
that uses DBMS
– What it does and how it works
– What information is stored in the DBMS
• What tables (each with its column names) might be there
• Estimated size of the data (number of records)
• You may use your own assumptions as needed
• Submit your paper via LMS in PDF or XPS format
• Deadline : Tuesday March 11, 23:59 WIB
Object-Relational Data (ORD) Models
• Relational model: flat, “atomic” values
• Object Relational Data Models:
– Extend the relational data model by including object
orientation and constructs to deal with added data types
– Adapt OOP concepts: Encapsulation, object/classes,
inheritance
– Allow attributes of tuples to have complex types,
including non-atomic values such as nested relations
– Preserve relational foundations, provide upward
compatibility with existing relational languages
Object Data Type
• Object contains :
– Attributes
– Methods
Source: Oracle.com
Objects in ORACLE
Source: Oracle.com
Objects (cont’d)
“person_typ” is now a data type, can be used just like any other kind of
data type :
Attributes and methods of the object are accessed using the dot (“.”) :
Source: Oracle.com
XML: Extensible Markup Language
• Defined by the WWW Consortium (W3C)
• Originally intended as a document markup
language, not a database language
• The ability to specify new tags, and to create nested
tag structures made XML a great way to exchange
data, not just documents
• XML has become the basis for all new generation
data interchange formats.
• A wide variety of tools is available for parsing,
browsing and querying XML documents/data –
example: XPath, XQuery language
XML for Storing Data
Example of XML Application
Web Service
ProviderDBMS Applications
Data exchanged
in XML format
Main Components of A DBMS
1. Query Processor
– Provide simplified access to the data
– Handle queries
2. Storage Manager
– Interfaces with the operating system
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 file manager (operating system files)
– Efficient storing, retrieving and updating of data
– Translates DML into file system commands
• Issues it must handle:
– Storage access
– File organization
– Indexing and hashing
Query Processing
1. Parsing and translation – check syntax, validate tables & attributes,
translate into relational algebra
2. Optimization – finds the most efficent execution plan (which index is
used, join algorithms, cost estimation)
3. Evaluation – executes the plan against the actual data and get the
results
Relational Algebra Operations
Query Processing (Cont.)
• Cost difference between a good and a bad way
of evaluating a query can be enormous
• Cost factors: disk I/O access needed, seek time
required, CPU load, number of tuples affected
• Need to estimate the cost of operations
– Depends critically on statistical information about
relations which the database must maintain
– Need to estimate statistics for intermediate results
to compute cost of complex expressions
Transactions
• Example: transferring $100 from a bank
account to another account in a different bank
1. The sender’s account must be deducted by $100
2. Then, the $100 fund is added to the destination
account
• What if the system fails during the operation?
• What if more than one user is concurrently
updating the same data?
Transaction Management
• A transaction is a collection of operations that
performs a single logical function in a database
application
• Atomicity : All operations must be performed or none
at all
• 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 Users and Administrators
Database
Access to database via Query Processor
Database System Internals
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 (2-tier, 3-tier)
• Parallel (multi-processor)
• Distributed
Two-Tier
Three-tier
Data Warehouse, Data Mining
• Data warehouse:
– Data is gathered from multiple transaction
systems in an organization
– Especially designed for query / data retrieval,
reporting, and analysis
• Data Mining:
– Find useful patterns inside large sets of data
– Uses artificial intelligence
History of Database Systems
• 1950s and early 1960s:
– Data processing using magnetic tapes for storage
• Tapes provided only sequential access
– Punched cards for input
• Late 1960s and 1970s:
– Hard disks allowed direct access to data
– Network and hierarchical data models in widespread
use
– Dr. Edgar F. Codd defined the relational data model
• IBM Research begins System R prototype
• UC Berkeley begins Ingres prototype
– High-performance (for the era) transaction processing
History (cont.)
• 1980s:
– Research relational prototypes evolve into commercial systems
• SQL becomes industrial standard
– Parallel and distributed database systems
– Object-oriented database systems
• 1990s:
– Large decision support and data-mining applications
– Large multi-terabyte data warehouses
– Emergence of Web commerce
– Object-Relational DBMS
• Early 2000s:
– XML and XQuery standards
– Automated database administration
• Later 2000s:
– Giant data storage systems with massive parallel processing
• Oracle Exadata, Teradata, Greenplum, Google BigTable, Yahoo PNuts, ..
End of Chapter 1

More Related Content

What's hot

Cp 121 lecture 01
Cp 121 lecture 01Cp 121 lecture 01
Cp 121 lecture 01
ITNet
 
CS3270 - DATABASE SYSTEM - Lecture (1)
CS3270 - DATABASE SYSTEM -  Lecture (1)CS3270 - DATABASE SYSTEM -  Lecture (1)
CS3270 - DATABASE SYSTEM - Lecture (1)
Dilawar Khan
 
DBMS Bascis
DBMS BascisDBMS Bascis
RDBMS Arch & Models
RDBMS Arch & ModelsRDBMS Arch & Models
RDBMS Arch & Models
Sarmad Ali
 
Dbms unit 1
Dbms unit 1Dbms unit 1
Dbms unit 1
SaiGupta18
 
Database an introduction
Database an introductionDatabase an introduction
Database an introduction
Anwarul Islam, PhD
 
Database Concept by Luke Lonergan
Database Concept by Luke LonerganDatabase Concept by Luke Lonergan
Database Concept by Luke Lonergan
Luke Lonergan
 
DBMS an Example
DBMS an ExampleDBMS an Example
DBMS an Example
Dr. C.V. Suresh Babu
 
DBMS
DBMSDBMS
Info systems databases
Info systems databasesInfo systems databases
Info systems databases
MR Z
 
overview of database concept
overview of database conceptoverview of database concept
overview of database concept
gourav kottawar
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
Marlon Jamera
 
Dbms Basics
Dbms BasicsDbms Basics
DBMS FOR STUDENTS MUST DOWNLOAD AND READ
DBMS FOR STUDENTS MUST DOWNLOAD AND READDBMS FOR STUDENTS MUST DOWNLOAD AND READ
DBMS FOR STUDENTS MUST DOWNLOAD AND READ
amitp26
 
Unit 01 dbms
Unit 01 dbmsUnit 01 dbms
Unit 01 dbms
anuragmbst
 
DBMS
DBMS DBMS
Managing knowledge
Managing knowledgeManaging knowledge
Relational databases
Relational databasesRelational databases
Relational databases
Fiddy Prasetiya
 
INTRODUCTION TO DATABASE
INTRODUCTION TO DATABASEINTRODUCTION TO DATABASE
INTRODUCTION TO DATABASE
Muhammad Bilal Tariq
 
Chapter 6 Database SC025 2017/2018
Chapter 6 Database SC025 2017/2018Chapter 6 Database SC025 2017/2018
Chapter 6 Database SC025 2017/2018
Fizaril Amzari Omar
 

What's hot (20)

Cp 121 lecture 01
Cp 121 lecture 01Cp 121 lecture 01
Cp 121 lecture 01
 
CS3270 - DATABASE SYSTEM - Lecture (1)
CS3270 - DATABASE SYSTEM -  Lecture (1)CS3270 - DATABASE SYSTEM -  Lecture (1)
CS3270 - DATABASE SYSTEM - Lecture (1)
 
DBMS Bascis
DBMS BascisDBMS Bascis
DBMS Bascis
 
RDBMS Arch & Models
RDBMS Arch & ModelsRDBMS Arch & Models
RDBMS Arch & Models
 
Dbms unit 1
Dbms unit 1Dbms unit 1
Dbms unit 1
 
Database an introduction
Database an introductionDatabase an introduction
Database an introduction
 
Database Concept by Luke Lonergan
Database Concept by Luke LonerganDatabase Concept by Luke Lonergan
Database Concept by Luke Lonergan
 
DBMS an Example
DBMS an ExampleDBMS an Example
DBMS an Example
 
DBMS
DBMSDBMS
DBMS
 
Info systems databases
Info systems databasesInfo systems databases
Info systems databases
 
overview of database concept
overview of database conceptoverview of database concept
overview of database concept
 
Basic Concept of Database
Basic Concept of DatabaseBasic Concept of Database
Basic Concept of Database
 
Dbms Basics
Dbms BasicsDbms Basics
Dbms Basics
 
DBMS FOR STUDENTS MUST DOWNLOAD AND READ
DBMS FOR STUDENTS MUST DOWNLOAD AND READDBMS FOR STUDENTS MUST DOWNLOAD AND READ
DBMS FOR STUDENTS MUST DOWNLOAD AND READ
 
Unit 01 dbms
Unit 01 dbmsUnit 01 dbms
Unit 01 dbms
 
DBMS
DBMS DBMS
DBMS
 
Managing knowledge
Managing knowledgeManaging knowledge
Managing knowledge
 
Relational databases
Relational databasesRelational databases
Relational databases
 
INTRODUCTION TO DATABASE
INTRODUCTION TO DATABASEINTRODUCTION TO DATABASE
INTRODUCTION TO DATABASE
 
Chapter 6 Database SC025 2017/2018
Chapter 6 Database SC025 2017/2018Chapter 6 Database SC025 2017/2018
Chapter 6 Database SC025 2017/2018
 

Similar to Database Systems - Lecture Week 1

01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
TOUSEEQHAIDER14
 
(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)
Dr. Mazin Mohamed alkathiri
 
PPT-UEU-Basis-Data-Pertemuan-1.pptx
PPT-UEU-Basis-Data-Pertemuan-1.pptxPPT-UEU-Basis-Data-Pertemuan-1.pptx
PPT-UEU-Basis-Data-Pertemuan-1.pptx
UbaidURRahman78
 
Ch 2-introduction to dbms
Ch 2-introduction to dbmsCh 2-introduction to dbms
Ch 2-introduction to dbms
Rupali Rana
 
Database Lecture Notes
Database Lecture NotesDatabase Lecture Notes
Database Lecture Notes
FellowBuddy.com
 
INTRODUCTION OF DATA BASE
INTRODUCTION OF DATA BASEINTRODUCTION OF DATA BASE
INTRODUCTION OF DATA BASE
AMUTHAG2
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
NILESH UCHCHASARE
 
Database part1-
Database part1-Database part1-
Database part1-
Taymoor Nazmy
 
Anshu Joshi_2371050_DBMS.pptxData base management system
Anshu Joshi_2371050_DBMS.pptxData base management systemAnshu Joshi_2371050_DBMS.pptxData base management system
Anshu Joshi_2371050_DBMS.pptxData base management system
anshjoshi7417
 
Rdbms
RdbmsRdbms
Unit 2 DATABASE ESSENTIALS.pptx
Unit 2 DATABASE ESSENTIALS.pptxUnit 2 DATABASE ESSENTIALS.pptx
Unit 2 DATABASE ESSENTIALS.pptx
Nirmalavenkatachalam
 
System Analysis And Design
System Analysis And DesignSystem Analysis And Design
System Analysis And Design
Lijo Stalin
 
dbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodungadbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodunga
VaradKadtan1
 
Dbms
DbmsDbms
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.pptweek1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
RidoVercascade
 
Database Systems Lec 1.pptx
Database Systems Lec 1.pptxDatabase Systems Lec 1.pptx
Database Systems Lec 1.pptx
NishaTariq1
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptx
AshmitKashyap1
 
Unit01 dbms 2
Unit01 dbms 2Unit01 dbms 2
Unit01 dbms 2
Venkat Reddy
 
1_DBMS_Introduction.pdf
1_DBMS_Introduction.pdf1_DBMS_Introduction.pdf
1_DBMS_Introduction.pdf
JubairAhmedNabin
 
DBMS introduction and functionality of of dbms
DBMS introduction and functionality of  of dbmsDBMS introduction and functionality of  of dbms
DBMS introduction and functionality of of dbms
ranjana dalwani
 

Similar to Database Systems - Lecture Week 1 (20)

01-Database Administration and Management.pdf
01-Database Administration and Management.pdf01-Database Administration and Management.pdf
01-Database Administration and Management.pdf
 
(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)(Dbms) class 1 & 2 (Presentation)
(Dbms) class 1 & 2 (Presentation)
 
PPT-UEU-Basis-Data-Pertemuan-1.pptx
PPT-UEU-Basis-Data-Pertemuan-1.pptxPPT-UEU-Basis-Data-Pertemuan-1.pptx
PPT-UEU-Basis-Data-Pertemuan-1.pptx
 
Ch 2-introduction to dbms
Ch 2-introduction to dbmsCh 2-introduction to dbms
Ch 2-introduction to dbms
 
Database Lecture Notes
Database Lecture NotesDatabase Lecture Notes
Database Lecture Notes
 
INTRODUCTION OF DATA BASE
INTRODUCTION OF DATA BASEINTRODUCTION OF DATA BASE
INTRODUCTION OF DATA BASE
 
Database Management System
Database Management SystemDatabase Management System
Database Management System
 
Database part1-
Database part1-Database part1-
Database part1-
 
Anshu Joshi_2371050_DBMS.pptxData base management system
Anshu Joshi_2371050_DBMS.pptxData base management systemAnshu Joshi_2371050_DBMS.pptxData base management system
Anshu Joshi_2371050_DBMS.pptxData base management system
 
Rdbms
RdbmsRdbms
Rdbms
 
Unit 2 DATABASE ESSENTIALS.pptx
Unit 2 DATABASE ESSENTIALS.pptxUnit 2 DATABASE ESSENTIALS.pptx
Unit 2 DATABASE ESSENTIALS.pptx
 
System Analysis And Design
System Analysis And DesignSystem Analysis And Design
System Analysis And Design
 
dbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodungadbms Unit 1.pdf arey bhai teri maa chodunga
dbms Unit 1.pdf arey bhai teri maa chodunga
 
Dbms
DbmsDbms
Dbms
 
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.pptweek1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
week1-thursday-2id50-q2-2021-2022-intro-and-basic-fd.ppt
 
Database Systems Lec 1.pptx
Database Systems Lec 1.pptxDatabase Systems Lec 1.pptx
Database Systems Lec 1.pptx
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptx
 
Unit01 dbms 2
Unit01 dbms 2Unit01 dbms 2
Unit01 dbms 2
 
1_DBMS_Introduction.pdf
1_DBMS_Introduction.pdf1_DBMS_Introduction.pdf
1_DBMS_Introduction.pdf
 
DBMS introduction and functionality of of dbms
DBMS introduction and functionality of  of dbmsDBMS introduction and functionality of  of dbms
DBMS introduction and functionality of of dbms
 

Recently uploaded

managing Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptxmanaging Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptx
nabaegha
 
nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...
chaudharyreet2244
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
Kalna College
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
Kalna College
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
ShwetaGawande8
 
Interprofessional Education Platform Introduction.pdf
Interprofessional Education Platform Introduction.pdfInterprofessional Education Platform Introduction.pdf
Interprofessional Education Platform Introduction.pdf
Ben Aldrich
 
A Quiz on Drug Abuse Awareness by Quizzito
A Quiz on Drug Abuse Awareness by QuizzitoA Quiz on Drug Abuse Awareness by Quizzito
A Quiz on Drug Abuse Awareness by Quizzito
Quizzito The Quiz Society of Gargi College
 
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
biruktesfaye27
 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
roshanranjit222
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Kalna College
 
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
Nguyen Thanh Tu Collection
 
Keynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse CityKeynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse City
PJ Caposey
 
How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17
Celine George
 
Creating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptxCreating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptx
Forum of Blended Learning
 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
MJDuyan
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
Friends of African Village Libraries
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Quiz Club IIT Kanpur
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
Kalna College
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
khabri85
 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
Kalna College
 

Recently uploaded (20)

managing Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptxmanaging Behaviour in early childhood education.pptx
managing Behaviour in early childhood education.pptx
 
nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...nutrition in plants chapter 1 class 7...
nutrition in plants chapter 1 class 7...
 
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx78 Microsoft-Publisher - Sirin Sultana Bora.pptx
78 Microsoft-Publisher - Sirin Sultana Bora.pptx
 
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
220711130083 SUBHASHREE RAKSHIT  Internet resources for social science220711130083 SUBHASHREE RAKSHIT  Internet resources for social science
220711130083 SUBHASHREE RAKSHIT Internet resources for social science
 
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
INTRODUCTION TO HOSPITALS & AND ITS ORGANIZATION
 
Interprofessional Education Platform Introduction.pdf
Interprofessional Education Platform Introduction.pdfInterprofessional Education Platform Introduction.pdf
Interprofessional Education Platform Introduction.pdf
 
A Quiz on Drug Abuse Awareness by Quizzito
A Quiz on Drug Abuse Awareness by QuizzitoA Quiz on Drug Abuse Awareness by Quizzito
A Quiz on Drug Abuse Awareness by Quizzito
 
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
Ethiopia and Eritrea Eritrea's journey has been marked by resilience and dete...
 
IoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdfIoT (Internet of Things) introduction Notes.pdf
IoT (Internet of Things) introduction Notes.pdf
 
Contiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptxContiguity Of Various Message Forms - Rupam Chandra.pptx
Contiguity Of Various Message Forms - Rupam Chandra.pptx
 
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
BỘ BÀI TẬP TEST THEO UNIT - FORM 2025 - TIẾNG ANH 12 GLOBAL SUCCESS - KÌ 1 (B...
 
Keynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse CityKeynote given on June 24 for MASSP at Grand Traverse City
Keynote given on June 24 for MASSP at Grand Traverse City
 
How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17How to Create User Notification in Odoo 17
How to Create User Notification in Odoo 17
 
Creating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptxCreating Images and Videos through AI.pptx
Creating Images and Videos through AI.pptx
 
Information and Communication Technology in Education
Information and Communication Technology in EducationInformation and Communication Technology in Education
Information and Communication Technology in Education
 
Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024Library news letter Kitengesa Uganda June 2024
Library news letter Kitengesa Uganda June 2024
 
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT KanpurDiversity Quiz Prelims by Quiz Club, IIT Kanpur
Diversity Quiz Prelims by Quiz Club, IIT Kanpur
 
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
220711130100 udita Chakraborty  Aims and objectives of national policy on inf...220711130100 udita Chakraborty  Aims and objectives of national policy on inf...
220711130100 udita Chakraborty Aims and objectives of national policy on inf...
 
Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024Brand Guideline of Bashundhara A4 Paper - 2024
Brand Guideline of Bashundhara A4 Paper - 2024
 
220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science220711130082 Srabanti Bag Internet Resources For Natural Science
220711130082 Srabanti Bag Internet Resources For Natural Science
 

Database Systems - Lecture Week 1

  • 1. Week 1 - Introduction IS220 - Database Systems Dios Kurniawan, MSc
  • 2. Text Book • Database System Concepts 6th Edition, Abraham Silberschatz, et al, McGraw-Hill • Additional reading: Connolly, T. M. (2005). Database Systems: A Practical Approach to Design, Implementation, and Management, (4th Ed.), Essex: Addison Wesley Note: you must have the printed copy of the book
  • 3. Course Structure 1. Introduction to DBMS (week 1) 2. File Organization (week 2) 3. Indexing and Hashing (week 3-4) 4. Query Processing and Optimization (week 5-6) 5. Transactions (week 7) 6. OO DBMS, XML (week 8-9) 7. DB Architectures, parallel, distributed DB (week 10-12) 8. Advanced Application Development (week 13)
  • 4. Class Activity • 70% theory • 30% hands-on assignments – Students will work in pairs (2 students each group) – Each group to prepare A MS Windows 7/8 laptop
  • 5. Assessment • 35% Group work & individual homework • 30% Mid-term Tests • 35% Final Exam • Minimum 80% class attendance
  • 6. Class Rules • Class normally starts at 7:30 and stops at 9:10 (but there might be times that it will start at 7:20) • Attendance check will be done at 7:45 – I cannot accept excuses such as “macet”, “cannot find parking spot” or “flat tyre” • No phones inside the class – tablets are OK but do not use them for social media or chat • If anytime you feel you need to go to the washroom, or make a phone call outside, please do so – no need to ask for my permission • English to be used at all times • Please sit in the front rows whenever possible • Please dress professionally
  • 8. What is A Database? • Is an organized collection of data • Computer program can quickly select the desired pieces of data • Typically a database is organized by: – Fields (=single piece of information) – Records (=complete set of fields) – Files (=collection of records)
  • 9. Data is Produced … • Each time you make a phone call or send messages • Each time you withdraw money from an ATM • Each time you purchase a merchandise in a retail shop • Each time you book an airline ticket • ..and many many more Picture source: google.com
  • 10. An Example – call detail record • The telephone number of the caller and the calling partner • The time when the conversation started • How long the call lasted • How much the cost • What cell tower identification was serving the caller 6282346376766 +6285334692755 2014/02/01 00:26:20.0 63 500 510101630030573 6282291065057 +6285259187902 2014/02/01 00:49:25.0 430 2000 510100910840061 6285367034197 +6281354260056 2014/02/01 00:51:23.0 163 750 510100917165221 6282198087732 +6282292261026 2014/02/01 00:13:12.0 54 250 510101221640754 6281360050554 +6282372171347 2014/02/01 00:28:50.0 391 1750 510100980136873 6282170311008 +6282238722355 2014/02/01 00:44:29.0 104 500 510100036500045 A telecommunication company could generate hundreds of million of such records in a day! freepatentsonline.com field record
  • 11. Database Management System (DBMS) • DBMS contains information about a particular organization: – Collection of interrelated data – Set of programs to access the data – An environment that is both convenient and efficient to use • Database Applications: – Banking: transactions – Airlines: reservations, schedules – Universities: registration, grades – Sales: customers, products, purchases – Online retailers: order tracking, customized recommendations – Manufacturing: production, inventory, orders, supply chain – Human resources: employee records, salaries, tax deductions • Databases touch all aspects of our lives • Databases can be very large.
  • 12. Popular DBMS Products >40% market share >15 % market share >20% market share 3% market share Open source: Source: Oracle.com, Teradata.com, Microsoft.com, Postgresql.org
  • 13. University Database Example • Application program examples – Add new students, instructors, and courses – Register students for courses, and generate class rosters – Assign grades to students, compute grade point averages (GPA) and generate transcripts • In the early days, database applications were built directly on top of file systems
  • 14. Drawbacks of Using File Systems • 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 (e.g., account balance must be > 0) become “buried” in program code rather than being stated explicitly – Hard to add new constraints or change existing ones
  • 15. Drawbacks of using file systems to store data (Cont.) – Atomicity of updates • Failures may leave database in an inconsistent state with partial updates carried out • Example: Transfer of students 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 (say 100) and updating it by withdrawing money (say 50 each) at the same time – Security problems • Hard to provide user access to some, but not all, data Database systems offer solutions to all the above problems Database systems provide abstract view of the data
  • 16. View of Data An architecture for a database system
  • 17. Levels of Abstraction • Physical level: describes how a record (e.g., customer) is stored. • Logical level: describes what data stored in database, and the relationships among the data. type instructor = record ID : string; name : string; dept_name : string; salary : integer; end; • View level: application programs hide details of data types. Views can also hide information (such as an employee’s salary) for security purposes.
  • 18. Instances and Schemas • Similar to types and variables in programming languages : schema is when variables are declared, instance is when the program is run • Schema – the logical structure of the database – Example: 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.
  • 19. Data Models • A collection of tools for describing – Data – Data relationships – Data semantics – Data constraints • Categories: 1. Relational model 2. Entity-Relationship data model (mainly for database design) 3. Object-based data models (Object-oriented and Object- relational) 4. Semistructured data model (XML) • Other older models: – Network model – Hierarchical model
  • 20. Relational Model • Relation = table = file • Tuples = rows = Records. • Column = field • Example of tabular data in the relational model: Columns Rows (Tuples)
  • 22. How to Access The Data • Use these languanges: 1. DML 2. DDL
  • 23. Data Manipulation Language (DML) • Language for accessing and manipulating the data organized by the appropriate data model – DML also known as query language • Query = request to retrieve some information • Two classes of languages – Procedural – user specifies what data is required and how to get those data – Declarative (non-procedural) – user specifies what data is required without specifying how to get those data – easier to learn • SQL is the most widely used non-procedural query language
  • 24. Data Definition Language (DDL) • Specification notation for defining the database schema Example: create table instructor ( ID char(5), name varchar(20), dept_name varchar(20), salary numeric(6)) • DDL compiler generates a set of table templates stored in a data dictionary • Data dictionary contains metadata (data about data) – Database schema – Integrity constraints • Primary key (ID uniquely identifies instructors) • Referential integrity (references constraint in SQL) – e.g. dept_name value in any instructor tuple must appear in department relation – Authorization
  • 25. SQL • SQL: widely used non-procedural language – Example: Find the name of the instructor with ID 22222 select name from instructor where instructor.ID = ‘22222’ – Example: Find the ID and building of instructors in the Physics dept. select instructor.ID, department.building from instructor, department where instructor.dept_name = department.dept_name and department.dept_name = ‘Physics’ • 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 • Chapters 3, 4 and 5
  • 26. Database Design The process of designing the general structure of the database: • Logical Design – Deciding on the database schema. Database design requires that we find a “good” collection of relation schemas. – 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? • Physical Design – Deciding on the physical layout of the database
  • 27. Database Design? • Is there any problem with this design?
  • 28. Yes, Many Problems • Redundant/repetition of tuples : so many departments are repeated • Waste of space • Complicates updates on the table : if we want to change a budget of a department, many tuples must be changed • Cannot create new department unless at least one instructor is present in the department
  • 29. Design Approaches • Normalization Theory – Dividing large tables into smaller ones, and defining the relationships between them – Reduce repetitions – Isolates data, thus inserts/deletes/updates can be made in just one table • Entity Relationship Model – An abstract way to describe a database
  • 30. The Entity-Relationship Model • Models an enterprise as a collection of entities and relationships – Entity: a “thing” or “object” in the organization that is distinguishable from other objects • Described by a set of attributes – Relationship: an association among several entities • Represented diagrammatically by an entity-relationship diagram: 1..10..*
  • 31. Individual Homework #1 • Name one IT application you find in your daily life that uses DBMS – What it does and how it works – What information is stored in the DBMS • What tables (each with its column names) might be there • Estimated size of the data (number of records) • You may use your own assumptions as needed • Submit your paper via LMS in PDF or XPS format • Deadline : Tuesday March 11, 23:59 WIB
  • 32. Object-Relational Data (ORD) Models • Relational model: flat, “atomic” values • Object Relational Data Models: – Extend the relational data model by including object orientation and constructs to deal with added data types – Adapt OOP concepts: Encapsulation, object/classes, inheritance – Allow attributes of tuples to have complex types, including non-atomic values such as nested relations – Preserve relational foundations, provide upward compatibility with existing relational languages
  • 33. Object Data Type • Object contains : – Attributes – Methods Source: Oracle.com
  • 35. Objects (cont’d) “person_typ” is now a data type, can be used just like any other kind of data type : Attributes and methods of the object are accessed using the dot (“.”) : Source: Oracle.com
  • 36. XML: Extensible Markup Language • Defined by the WWW Consortium (W3C) • Originally intended as a document markup language, not a database language • The ability to specify new tags, and to create nested tag structures made XML a great way to exchange data, not just documents • XML has become the basis for all new generation data interchange formats. • A wide variety of tools is available for parsing, browsing and querying XML documents/data – example: XPath, XQuery language
  • 38. Example of XML Application Web Service ProviderDBMS Applications Data exchanged in XML format
  • 39. Main Components of A DBMS 1. Query Processor – Provide simplified access to the data – Handle queries 2. Storage Manager – Interfaces with the operating system
  • 40. 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 file manager (operating system files) – Efficient storing, retrieving and updating of data – Translates DML into file system commands • Issues it must handle: – Storage access – File organization – Indexing and hashing
  • 41. Query Processing 1. Parsing and translation – check syntax, validate tables & attributes, translate into relational algebra 2. Optimization – finds the most efficent execution plan (which index is used, join algorithms, cost estimation) 3. Evaluation – executes the plan against the actual data and get the results
  • 43. Query Processing (Cont.) • Cost difference between a good and a bad way of evaluating a query can be enormous • Cost factors: disk I/O access needed, seek time required, CPU load, number of tuples affected • Need to estimate the cost of operations – Depends critically on statistical information about relations which the database must maintain – Need to estimate statistics for intermediate results to compute cost of complex expressions
  • 44. Transactions • Example: transferring $100 from a bank account to another account in a different bank 1. The sender’s account must be deducted by $100 2. Then, the $100 fund is added to the destination account • What if the system fails during the operation? • What if more than one user is concurrently updating the same data?
  • 45. Transaction Management • A transaction is a collection of operations that performs a single logical function in a database application • Atomicity : All operations must be performed or none at all • 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.
  • 46. Database Users and Administrators Database Access to database via Query Processor
  • 48. 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 (2-tier, 3-tier) • Parallel (multi-processor) • Distributed
  • 51. Data Warehouse, Data Mining • Data warehouse: – Data is gathered from multiple transaction systems in an organization – Especially designed for query / data retrieval, reporting, and analysis • Data Mining: – Find useful patterns inside large sets of data – Uses artificial intelligence
  • 52. History of Database Systems • 1950s and early 1960s: – Data processing using magnetic tapes for storage • Tapes provided only sequential access – Punched cards for input • Late 1960s and 1970s: – Hard disks allowed direct access to data – Network and hierarchical data models in widespread use – Dr. Edgar F. Codd defined the relational data model • IBM Research begins System R prototype • UC Berkeley begins Ingres prototype – High-performance (for the era) transaction processing
  • 53. History (cont.) • 1980s: – Research relational prototypes evolve into commercial systems • SQL becomes industrial standard – Parallel and distributed database systems – Object-oriented database systems • 1990s: – Large decision support and data-mining applications – Large multi-terabyte data warehouses – Emergence of Web commerce – Object-Relational DBMS • Early 2000s: – XML and XQuery standards – Automated database administration • Later 2000s: – Giant data storage systems with massive parallel processing • Oracle Exadata, Teradata, Greenplum, Google BigTable, Yahoo PNuts, ..
  翻译: