SlideShare a Scribd company logo
1 of 54
Download to read offline
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 (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.pdfTOUSEEQHAIDER14
 
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.pptxUbaidURRahman78
 
Ch 2-introduction to dbms
Ch 2-introduction to dbmsCh 2-introduction to dbms
Ch 2-introduction to dbmsRupali Rana
 
INTRODUCTION OF DATA BASE
INTRODUCTION OF DATA BASEINTRODUCTION OF DATA BASE
INTRODUCTION OF DATA BASEAMUTHAG2
 
System Analysis And Design
System Analysis And DesignSystem Analysis And Design
System Analysis And DesignLijo 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 chodungaVaradKadtan1
 
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.pptRidoVercascade
 
Database Systems Lec 1.pptx
Database Systems Lec 1.pptxDatabase Systems Lec 1.pptx
Database Systems Lec 1.pptxNishaTariq1
 
Database management system.pptx
Database management system.pptxDatabase management system.pptx
Database management system.pptxAshmitKashyap1
 
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 dbmsranjana 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-
 
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
 
DBMS introduction
DBMS introductionDBMS introduction
DBMS introduction
 

Recently uploaded

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...Nguyen Thanh Tu Collection
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024Elizabeth Walsh
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17Celine George
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...Nguyen Thanh Tu Collection
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jisc
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Jisc
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsTechSoup
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfagholdier
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.MaryamAhmad92
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Pooja Bhuva
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17Celine George
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfPoh-Sun Goh
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...Poonam Aher Patil
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxDr. Sarita Anand
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - Englishneillewis46
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfAdmir Softic
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfSherif Taha
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxJisc
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.christianmathematics
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...pradhanghanshyam7136
 

Recently uploaded (20)

TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
TỔNG ÔN TẬP THI VÀO LỚP 10 MÔN TIẾNG ANH NĂM HỌC 2023 - 2024 CÓ ĐÁP ÁN (NGỮ Â...
 
FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024FSB Advising Checklist - Orientation 2024
FSB Advising Checklist - Orientation 2024
 
How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17How to Create and Manage Wizard in Odoo 17
How to Create and Manage Wizard in Odoo 17
 
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
80 ĐỀ THI THỬ TUYỂN SINH TIẾNG ANH VÀO 10 SỞ GD – ĐT THÀNH PHỐ HỒ CHÍ MINH NĂ...
 
Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)Jamworks pilot and AI at Jisc (20/03/2024)
Jamworks pilot and AI at Jisc (20/03/2024)
 
Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)Accessible Digital Futures project (20/03/2024)
Accessible Digital Futures project (20/03/2024)
 
Introduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The BasicsIntroduction to Nonprofit Accounting: The Basics
Introduction to Nonprofit Accounting: The Basics
 
Holdier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdfHoldier Curriculum Vitae (April 2024).pdf
Holdier Curriculum Vitae (April 2024).pdf
 
ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.ICT role in 21st century education and it's challenges.
ICT role in 21st century education and it's challenges.
 
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
Beyond_Borders_Understanding_Anime_and_Manga_Fandom_A_Comprehensive_Audience_...
 
How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17How to Give a Domain for a Field in Odoo 17
How to Give a Domain for a Field in Odoo 17
 
Micro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdfMicro-Scholarship, What it is, How can it help me.pdf
Micro-Scholarship, What it is, How can it help me.pdf
 
General Principles of Intellectual Property: Concepts of Intellectual Proper...
General Principles of Intellectual Property: Concepts of Intellectual  Proper...General Principles of Intellectual Property: Concepts of Intellectual  Proper...
General Principles of Intellectual Property: Concepts of Intellectual Proper...
 
Google Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptxGoogle Gemini An AI Revolution in Education.pptx
Google Gemini An AI Revolution in Education.pptx
 
Graduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - EnglishGraduate Outcomes Presentation Slides - English
Graduate Outcomes Presentation Slides - English
 
Key note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdfKey note speaker Neum_Admir Softic_ENG.pdf
Key note speaker Neum_Admir Softic_ENG.pdf
 
Food safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdfFood safety_Challenges food safety laboratories_.pdf
Food safety_Challenges food safety laboratories_.pdf
 
Wellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptxWellbeing inclusion and digital dystopias.pptx
Wellbeing inclusion and digital dystopias.pptx
 
This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.This PowerPoint helps students to consider the concept of infinity.
This PowerPoint helps students to consider the concept of infinity.
 
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...Kodo Millet  PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
Kodo Millet PPT made by Ghanshyam bairwa college of Agriculture kumher bhara...
 

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, ..