Database System: Md. Ariful Islam Khandaker Lecturer, CSE Department Iiuc
Database System: Md. Ariful Islam Khandaker Lecturer, CSE Department Iiuc
Introduction
Database Definition Database Management System View of Data Data Models Data Definition Language
1.2
Database Definition
What is Database?
A database system is basically just a computerized recordkeeping system. The database itself can be regarded as a king of electronic filing cabinet; i.e., it is repository or container for a collection of computerized data files.
Difference between Data and Information
Data refer to what is actually stored in the database and Information refers to the meaning of that data as understood by some user. Actually the terms data and information are treated as synonymous.
1.3
Database Continued
Components of Database System
1.4
transactions.
Airlines: For reservations and schedule information. Universities: For student information, course registrations, and grades. Credit card transactions: For purchases on credit cards and generation
of monthly statements.
Telecommunication: For keeping records of calls made, generating
monthly bills, maintaining balances on prepaid calling cards, and storing information about the communication networks.
Finance: For storing information about holdings, sales, and purchases of
inventories
of
items
in
1.5
DBMS
What is DBMS?
o A database-management system (DBMS) is a piece of software that is a collection of interrelated data and a set of programs to access those data.
o The collection of data, usually referred to as the database, contains information relevant to an enterprise. o The primary goal of a DBMS is- to provide a way to store and retrieve database information that is both convenient and efficient.
1.6
DBMS Continue
Advantages of DBMS
o Data isolation: The DBMS can provide an abstract view of the
data access: A DBMS utilizes a variety of sophisticated techniques to store and retrieve data efficiently.
1.7
DBMS Continued
o Data integrity and Consistency: Integrity means condition to
data. Provide some checks and key constraints not to data miss use. Consistency means before transaction and after transaction database will remain consistence.
o Data administration: When several users share the data,
concurrent accesses to the data in such a manner that users can think of the data as being accessed by only one user at a time. Further, the DBMS protects users from the effects of system failures.
o Data Security:
malicious techniques.
DBMS provides a robust security from the destruction using authorization and authentic
1.8
1. Operating system accesses data directly and it manages itself. 2. It is Flat file which means it can be opened anywhere. 3. Operating systems provide only a password mechanism for security. This is not sufficient flexible to enforce security policies. 4. If the size of the file large (above 500GB), RAM size must be large.
1. Operating system can not access data directly when computer switch on. 2. It is not Flat file. Database Management System program needs to open data. 3. DBMS provides security system for accessing data. That is why, improper user cannot access data randomly. 4. RAM size does not depend on data, because DBMS always selective type. That is required data are stored in RAM. 5. A DBMS schedules concurrent accesses to the data in such a manner that users can think of the data as being accessed by only on user at a time. Further, the DBMS protects users from the effects of system failures.
5. Concurrent access and crash recovery can not possible. Operating system does not responsible for this.
1.9
View of Data
Abstraction: Data Abstraction means hiding basic data or meta data
from all kind of users using views.
Levels of Abstraction
Physical level describes how a record (e.g., customer) is stored. Logical level: describes data stored in database, and the
relationships among the data. type customer = record name : string; street : string; city : integer; end;
View level: application programs hide details of data types.
Views can also hide information (e.g., salary) for security purposes.
1.11
languages
Schema the logical structure of the database
o e.g., the database consists of information about a set of customers and accounts and the relationship between them)
1.12
Data Models
Model means structure. A collection of tools for describing data data relationships data semantics data constraints Types of Data Models 1. 2. 3.
1.13
Entity-Relationship Model
1.14
o Entities (objects)
o Example.-customers, accounts, bank branch
Database design in E-R model usually converted to design in the relational model (coming up next) which is used for storage and processing
1.15
Relational Model
Relational Model is a tabular representation of ERD Model. Example of tabular data in the relational model
Customerid 192-83-7465 019-28-3746 192-83-7465 321-12-3123 019-28-3746 customername Johnson Smith Johnson Jones Smith customerstreet Alma North Alma Main North customercity accountnumber Attributes
Palo Alto
Rye Palo Alto
A-101
A-215 A-201
Harrison
Rye
A-217
A-201
1.16
1.17
Database Language
Language is a way of communication. Database Language means a way to communicate with
Two types of Database Languages1. Data Definition Language( DDL ), 2. Data Manipulation Language ( DML).
1.18
dictionary
Data dictionary contains metadata (i.e., data about data)
1.19
Procedural user specifies what data is required and how to get those data
Nonprocedural user specifies what data is required without specifying how to get those data
SQL is the most widely used query language
1.20
SQL
SQL: widely used non-procedural language
E.g. find the name of the customer with customer-id 192-83-7465 select customer.customer-name from customer where customer.customer-id = 192-83-7465 E.g. find the balances of all accounts held by the customer with customer-id 192-83-7465 select account.balance from depositor, account where depositor.customer-id = 192-83-7465 and depositor.account-number = account.account-number
Application programs generally access databases through one of
Language extensions to allow embedded SQL Application program interface (e.g. ODBC/JDBC) which allow SQL queries to be sent to a database
1.21
Database Users
Users are differentiated by the way they expect to interact with
the system
Application programmers interact with system through DML
calls
Sophisticated users form requests in a database query
language
Specialized users write specialized database applications that
1.22
Database Administrator
database administrator has a good understanding of the enterprises information resources and needs.
Database administrator's duties include:
Schema definition Storage structure and access method definition Schema and physical organization modification Granting user authority to access the database Specifying integrity constraints Acting as liaison with users Monitoring performance and responding to changes in requirements
1.23
Transaction Management
A transaction is a collection of operations that performs a single
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
1.24
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 efficient storing, retrieving and updating of data
1.25
1.26
Application Architectures
Two-tier architecture: E.g. client programs using ODBC/JDBC to communicate with a database Three-tier architecture: E.g. web-based applications, and applications built using middleware
1.27
Thanks to All
1.28