Ch2 Database System Concept
Ch2 Database System Concept
Database Systems
Database Systems Concepts, Data Schema and Architecture
Ms. Veeramani
Outline
• Data models and its categories
• Schema and instances
• Database languages
Data Models
• A set of concepts to describe the structure of a database, the
operations for manipulating these structures, and certain constraints
that the database should obey
• Logical
• Physical
Conceptual vs. Logical vs. Physical Data Model
ERD Feature Conceptual Logical Physical
Entity (name) Yes Yes Yes
Relationship Yes Yes Yes
Attribute (column) - Yes Yes
Attribute’s type - Optional Yes
Primary key - - Yes
Foreign key - - Yes
Schemas
• Database schema
• The description of a database
• Includes descriptions of the database structure, data types, and the
constraints on the database
• Defines the database using the schema diagram
• Schema diagram
• An illustrative display of (most aspects of) a database schema
• Schema construct
• A component of the schema or an object within the schema, e.g., STUDENT,
COURSE
Example of Schema
Instances
and State
• The actual data stored in a
database at a particular
moment in time (state)
• Also called database
instance (or occurrence or
snapshot)
Database state
Three-Schema Architecture
DDL DML
DCL TCL
Data Definition Language (DDL)
• Used by the DBA and database designers to specify the conceptual
schema of a database
• In many DBMSs, the DDL is also used to define internal and external
schemas (views) Create • Create objects in the database
• Some of the tasks that
Alter • To alter the structure of the database
come under DDL
Drop • To delete objects from the database
Truncate • To remove all records from a table
Rename • To rename an object
• To comment on the data dictionary
Comment
(metadata)
Data Manipulation Language (DML)
• Used to specify database retrievals and updates
• Can be embedded in a general-purpose programming language (host
language)
• Some of the tasks that Select • To retrieve data from a database
come under DML
Insert • To insert data into a table
• To temporarily save a
transaction so that you can
Savepoint
rollback to that point
whenever necessary
Summary
• The Conceptual Model is to establish the entities, their attributes, and
their relationships
• The Logical Data Model defines the structure of the data elements and set
the relationships between them
• The Physical Data Model describes the database-specific implementation
of the data model
• The database schema changes very infrequently
• The database state changes every time the database is updated
• In order to support multiple user views and program-data independence in
database approach, three-schema architecture was proposed.