260 likes | 276 Views
Learn about databases, DBMS, advantages, disadvantages, and key elements, with examples in banking, airlines, universities, and beyond. Explore data models, relational databases, data abstraction levels, and more.
E N D
Chapter 1 Introduction
Data Banking: For customer information, accounts, loans & other banking transactions Airlines: For reservation & schedule information Universities: For student information, course registration,grades etc.
What is a database? A structured collection of related data An filing cabinet, an address book, a telephone directory, a timetable, etc. Google and your email is a database School Student Information System
Database Management System (DBMS) • Collection of interrelated data • Set of programs to access the data • DBMS contains information about a particular enterprise • DBMS provides an environment that is both convenient and efficient to use. • Database Applications: • Banking: all transactions • Airlines: reservations, schedules • Universities: registration, grades • Sales: customers, products, purchases • Manufacturing: production, inventory, orders, supply chain • Human resources: employee records, salaries, tax deductions • Databases touch all aspects of our lives
The DBMS Manages the Interaction Between the End User and the Database
Using file system for storing data Hệ Thống Quản Lý Tập Tin Tập tin Chương trình ứng dụng 1 Tập tin Quản lý dữ liệu Chương trình ứng dụng 2 Tập tin Quản lý dữ liệu Dữ liệu Chương trình ứng dụng 3 Quản lý dữ liệu Tập tin File
Using file system for storing data Disadvantages: Data redundancy and inconsistency (dư thừa dữ liệu và tính không nhất quán). Difficulty in Accessing data (Khó khăn trong việc truy xuất dữ liệu) Data isolation (sự cô lập dữ liệu). Integrity Problems(vấn đề toàn vẹn). Concurrent access Problems(vấn đề truy xuất đồng thời). Atomicity problems (vấn đề về tính nguyên tử). Security problems (vấn đề an toàn)
Advantages of the Database Approach Hệ Quản Trị CSDL Chương trình ứng dụng 1 Quản lý dữ liệu Chương trình ứng dụng 2 CSDL Quản lý dữ liệu Chương trình ứng dụng 3 Quản lý dữ liệu Database
Advantages of the Database Approach Program-data independence (độc lập) Planned data redundancy(dư thừa) Improved data consistency(vững chãi) Improved data sharing Increased application development productivity Enforcement of standards Improved data quality Improved data accessibility and responsiveness Reduced program maintenance(giảm bớt việc bảo quản) Improved decision support
Elements of the Database Approach • Data models • Graphical system capturing nature and relationship of data • Enterprise Data Model–high-level entities and relationships for the organization • Project Data Model–more detailed view, matching data structure in database or data warehouse • Relational Databases • Database technology involving tables (relations) representing entities and primary/foreign keys representing relationships • Use of Internet Technology • Networks and telecommunications, distributed databases, client-server, and 3-tier architectures • Database Applications • Application programs used to perform database activities (create, read, update, and delete) for database users
Data Models • Entity-Relationship model • Relational model • Other models: • object-oriented model • semi-structured data models • Older models: network model and hierarchical model
Data Models Data Abstraction: hiding details of data storage that are not needed for most database users. There are several levels of abstraction:
Physical Level • How the data are stored. • Lowest level of abstraction. • Complex low-level structures described in detail. • Deals with physical storage of data • Structure of records on disk - files, pages, blocks • Indexes and ordering of records • Used by database system programmers • Internal Schema • Example: RECORD EMP LENGTH=44 HEADER: BYTE(5) OFFSET=0 NAME: BYTE(25) OFFSET=5 SALARY: FULLWORD OFFSET=30 DEPT: BYTE(10) OFFSET=34
Conceptual Level • Next highest level of abstraction. • Describes what data are stored. • Describes the relationships among data. • Database administrator level. • Deals with the organisation of the data as a whole • Abstractions are used to remove unnecessary details of the internal level • Used by DBAs and application programmers • Example: CREATE TABLE Employee ( Name VARCHAR(25), Salary REAL, Dept_Name VARCHAR(10))
View Level • Highest level. • Describes part of the database for a particular group of users. • Can be many different views of a database. • E.g. tellers in a bank get a view of customer accounts, but not of payroll data. • Provides a view of the database tailored to a user • Parts of the data may be hidden • Data is presented in a useful form • Used by end users and application programmers • Example: • Payroll: String Name double Salary • Personnel: char *Name char *Department
The Database System Environment • Database system is composed of 5 main parts: • Hardware • Software • Operating system software • DBMS software • Application programs and utility software • People • Procedures • Data
DBMS Functionality Define a particular database in terms of its data types,structures, and constraints Construct or Load the initial database contents on a secondary storage medium Manipulating the database: Retrieval: Querying, generating reports Modification: Insertions, deletions and updates to its content Accessing the database through Web applications Processing and Sharing by a set of concurrent users and application programs – yet, keeping all data valid andconsistent
DBMS Functionality Other features: Protection or Security measures to prevent unauthorized access “Active” processing to take internal actions on data Presentation and Visualization of data Maintaining the database and associated programs over the lifetime of the database application Called database, software, and system maintenance
Role and Advantages of DBMS • End users have better access to more and better-managed data – Promotes integrated view of organization’s operations – Probability of data inconsistency is greatly reduced – Possible to produce quick answers to queries
Database system architecture • The three levels – not necessarily for a relational system • Internal level (storage level) – closest to physical storage • Concerned with the way the data is stored inside the system • One/Implementation level • External level ([individual] user logical level) – closest to users • Concerned with the way the data is seen by individual users • Many/Model level • Conceptual level ([community] logical level) • Indirection between the above two levels • One/Model level