Introduction To Database Systems Database Introduction
Introduction To Database Systems Database Introduction
Database Introduction
COSC 304 - Dr. Ramon Lawrence
What is a database?
A database is a collection of logically related data for a
particular domain.
Page 2
COSC 304 - Dr. Ramon Lawrence
Example Problem
Implement a system for managing products for a retailer.
Data: Information on products (SKU, name, desc, inventory)
Add new products, manage inventory of products
Page 4
COSC 304 - Dr. Ramon Lawrence
PROGRAM 1
Data
Redundant Data
Management FILE 1
PROGRAM 2
Data
Management
FILE 2
PROGRAM 3
Data
Management
Page 6
COSC 304 - Dr. Ramon Lawrence
Page 7
COSC 304 - Dr. Ramon Lawrence
DBMS
Query Processor
Integrated
PROGRAM 1
Transaction Mgr Database
...
Storage Mgr
PROGRAM 2
Collection of
Data Management
Functions
Page 8
COSC 304 - Dr. Ramon Lawrence
DBMS
A database management system provides efficient, convenient,
and safe multi-user storage and access to massive amounts of
persistent data.
Schemas
A database designer uses a DDL to define a schema for the
database. The schema is maintained and stored in the system
catalog. The schema is one type of metadata.
SQL Examples
Retrieve all products in the database:
SELECT sku, name, desc, inventory FROM product;
Page 13
COSC 304 - Dr. Ramon Lawrence
A) true
B) false
Page 14
COSC 304 - Dr. Ramon Lawrence
A) Objects
B) Classes
C) Inheritance
D) Polymorphism
Page 15
COSC 304 - Dr. Ramon Lawrence
A) DML
B) DDL
C) schemas
D) Java
Page 16
COSC 304 - Dr. Ramon Lawrence
Components of a DBMS
A DBMS is a complicated software system containing many
components:
Query processor - translates user/application queries into low-
level data manipulation actions.
Sub-components: query parser, query optimizer
Page 17
COSC 304 - Dr. Ramon Lawrence
DBMS Architecture
End-User Direct (SQL) Database
Users Programs Users Administrators
Parser + Result
Compiler Formatting Query
Processor
Query Optimizer Execution
Planner Engine
Transaction Buffer
Manager Manager Storage
Manager
Recovery File
System Manager
DB Operating
Files System Page 18
COSC 304 - Dr. Ramon Lawrence
Database Architectures
There are several different database architectures:
File-server (embedded) architecture - files are shared but
DBMS processing occurs at the clients (e.g. Microsoft Access
or SQLite)
Page 19
COSC 304 - Dr. Ramon Lawrence
Advantages:
Only one copy of DBMS software on dedicated machine.
Increased performance.
Reduced hardware and communication costs.
Easier to maintain consistency and manage concurrency.
Page 20
COSC 304 - Dr. Ramon Lawrence
Database
Tier 3: Database Server
•Data validation
•Data storage/management
Advantages:
Reduced client administration and cost using thin web clients.
Easy to scale architecture and perform load balancing.
Page 21
COSC 304 - Dr. Ramon Lawrence
Database People
There are several different types of database personnel:
Database administrator (DBA) - responsible for installing,
maintaining, and configuring the DBMS software.
Data administrator (DA) - responsible for organizational
policies on data creation, security, and planning.
Database designer - defines and implements a schema for a
database and associated applications.
Logical/Conceptual database designer - interacts with users to
determine data requirements, constraints, and business rules.
Physical database designer - implements the logical design for a data
model on a DBMS. Defines indexes, security, and constraints.
DBMS developer - writes the DBMS software code.
Application developer - writes code that uses the DBMS.
User - uses the database directly or through applications.
Page 22
COSC 304 - Dr. Ramon Lawrence
ANSI/SPARC Architecture
One of the major advantages of database systems is data
abstraction. Data abstraction is achieved by defining different
views of the data. Each view isolates higher-level views from
data representation details.
ANSI/SPARC Architecture
Users
3-schema
architecture
Conceptual
Conceptual
view
Schema
Internal
Internal view
Schema DBMS
DB
Page 24
COSC 304 - Dr. Ramon Lawrence
ANSI/SPARC Architecture
Three Levels of Views
Question: What are the three levels of views in the
ANSI/SPARC architecture starting with the view closest to the
user?
Page 27
COSC 304 - Dr. Ramon Lawrence
ANSI/SPARC Architecture
Abstraction with Views
Question: Assume you have a Java program accessing data
stored in a file. Select one true statement.
Conclusion
A database is a collection of logically related data stored and
managed by a database management system (DBMS).
Objectives
Define: database, DBMS, database application/system
Describe the features of a file-based system and some
limitations inherent in that architecture.
Define program-data independence and explain how it is
achieved by databases but not by file systems.
Define DDL and DML. What is the difference?
List some modules of a DBMS.
List different people associated with a DBMS and their roles.
Explain how a schema differs from data.
Draw a diagram of the 3-schema architecture and explain what
each level provides. List benefits of the architecture.
How does a schema provide data independence?
Compare/contrast two-tier and three-tier architectures.
Page 30