4. DBMS components
• Hardware
– The physical computer system that allows physical access to
data
• Software
– The actual program that allows users to access, maintain, and
update physical data
• Data: stored physically on the storage devices
• User: include end users and application programs
• Procedure
– A set of procedures (rules) that should be clearly defined and
followed by the users of the database
6. Database architecture
ANSI/SPARC
• Internal level
– The internal level determines where data are
actually stored on the storage device
• Conceptual level
– The conceptual level defines the logical view of
the data
• External level
– The external level interacts directly with the user
8. Database models
• Hierarchical model
• Network model
• Relational model
– In a relational model, data are organized in two-
dimensional tables called relations.
12. RDBMS
• RDBMS: the relational database management
system (RDBMS)
• Relation: a relation is a 2D table has the following
features:
– Name
– Attributes
– Tuples
Figure 14-6
13. 13
SQL Environment
Structured Query Language
• Catalog
– A set of schemas that constitute the description of a database
• Schema
– The structure that contains descriptions of objects created by a
user (base tables, views, constraints)
• Data Definition Language (DDL)
– Commands that define a database, including creating, altering, and
dropping tables and establishing constraints
• Data Manipulation Language (DML)
– Commands that maintain and query a database
• Data Control Language (DCL)
– Commands that control a database, including administering
privileges and committing data
22. OBJECTIVES OF DBMS
• Provides mass storage of relevant date
• Easy access to the data for the end user
• Ensure prompt response to users request for
relevant date
• Update the database with available information
• Eliminates redundant data
• Permits the access of data for multiple users at a
time.
• Protects the data from physical harm and
unauthorized access.
23. Functions of DBMS
• To store data
• To organize data
• To control access the data
• To protect data
24. Uses of DBMS
• To provide decision support
• Managers and analysts retrieve information
generated by the DBMS for inquiry, analysis
and decision-making
• To provide transaction processing
• To provide integrated information
25. CIS552 Query Processing 25
Query Processing
• Overview
• Catalog Information for Cost Estimation
• Measures of Query Cost
• Selection Operation
• Sorting
• Join Operation
• Other Operations
• Evaluation of Expressions
• Transformation of Relational Expressions
• Choice of Evaluation Plans
26. CIS552 Query Processing 26
Basic Steps in Query Processing
1. Parsing and translation
2. Optimization
3. Evaluation
Query
Query
Output
Relational Algebra
Expression
Execution Plan
Parser &
Translator
Evaluation Engine
Optimizer
Data Statistics
About Data
27. CIS552 Query Processing 27
Basic Steps in Query Processing (Cont.)
Parsing and translation
• translate the query into its internal form. This is then
translated into relational algebra.
• Parser checks syntax, verifies relations
Evaluation
• The query-execution engine takes a query-evaluation plan,
executes that plan, and returns the answers to the query.
28. SQL(STRUCTURED QUERY LANGUAGE)
TYPES
Data Definition Language(DDL)
Data Manipulation Language (DML)
Data Query Language(DQL)
Data Control Language (DCL)
Data Administration Statements(DAS)
Transaction control statements(TCS)
29. DDL (CREATE, ALTER, DROP)
DML (INSERT, UPDATE, DELETE)
DQL (ENABLE THE USER TO QUERY ONE OR
MORE TABLE)
DCL(PREVENTS UNAUTHORISED ACCESS TO
DATA)
DAS(ENABLES TO AUDIT AND ANALYSIS ON
OPERATION)
TCS(MANAGE ALL THE AHANGES MADE BY THE
DML)
30. DATA WAREHOUSING
• DATA WAREHOUSING:
• The father of data warehousing was W.H .Inmon
• What?
• Data warehousing is a collection of data designed
to support management decision making.
• The term “data warehousing” generally refer to
combine many different database across an
entire enterprise.
31.
32.
33. • DATA MART:
• A data mart is the access layer of the data
warehouse environment that is used to get
data out to the users.
• What?
• A data mart stores only that information ,
which is needed to address a particular
subject area and this can be translate as
supporting the needs of a specific group of
user.
34.
35. • Data Definition Language:
• It is used to create, alter and delete database object.
• Command:
• CREATE TABLE, CREATE VIEW, CREATE INDEX,ALTER TABLE
DROP TABLE,DROP VIEW AND DROP INDEX.
• CREATE creates an object (a table, for example) in the
database.
• ALTER modifies the structure of an existing object in various
ways, for example, adding a column to an existing table or a
constraint.
• TRUNCATE deletes all data from a table in a very fast way,
deleting the data inside the table and not the table itself. It
usually implies a subsequent COMMIT operation, i.e., it
cannot be rolled back (data is not written to the logs for
rollback later, unlike DELETE).
• DROP deletes an object in the database, usually
irretrievably
36. • insert, modify and delete the data in the
database.
• Command:
• INSERT, DELETE,UPDATE
• INSERT adds rows (formally tuples) to an
existing table.
• UPDATE modifies a set of existing table rows.
• DELETE removes existing rows from a table