Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 23

DATA MODELS

Lec/Lab – Week 3
Learning Outcomes
LO1: Categorize the contents of external, conceptual, and internal levels of a
database.

LO2: Illustrate the purpose of external/conceptual and internal/conceptual


mappings.

LO3: Recognize data modeling and data models

LO4: Differentiate Data Definition Language (DDL) and Data Manipulation


Language (DML).
Overview of
3-Levels of a
Database
The ANSI-SPARC database
architecture is the basis of most
of the modern databases.

The three levels present in this


architecture are Physical level,
Conceptual level and External
level.
This is the lowest level in the three-level architecture, also known as the internal
level. It describes how data is stored in the database. In the lowest level, this
data is stored in the external hard drives in the form of bits and at a little high
level, it can be said that the data is stored in files and folders. The physical
level also discusses compression and encryption techniques.
The conceptual level is at a higher level than the physical level. It is
also known as the logical level. It describes how the database appears
to the users conceptually and the relationships between various
data tables. The conceptual level does not care for how the data in
the database is stored.
This is the highest level in the three-level architecture and closest to
the user. It is also known as the view level. The external level only
shows the relevant database content to the users in the form of views
and hides the rest of the data. So different users can see the database
as a different view as per their individual requirements..
This is the highest level in the three-level architecture and closest to
the user. It is also known as the view level. The external level only
shows the relevant database content to the users in the form of views
and hides the rest of the data. So different users can see the database
as a different view as per their individual requirements..

The conceptual level is at a higher level than the physical level. It is


also known as the logical level. It describes how the database appears
to the users conceptually and the relationships between various
data tables. The conceptual level does not care for how the data in
the database is stored.

This is the lowest level in the three-level architecture, also known as the internal
level. It describes how data is stored in the database. In the lowest level, this
data is stored in the external hard drives in the form of bits and at a little high
level, it can be said that the data is stored in files and folders. The physical
level also discusses compression and encryption techniques.
Database
Languages in DBMS
DBMS
Languages

Data Data Transaction


Data Control
Definition Manipulation
Language
Control
Language Language Language
Data Definition Language (DDL)
• It is used to create schema, tables, indexes, constraints, etc. in the database.
• Using the DDL statements, you can create the skeleton of the database.
• Data definition language is used to store the information of metadata like the number of
tables and schemas, their names, indexes, columns in each table, constraints, etc.

Commands
• Create: It is used to create objects in the database.
• Alter: It is used to alter the structure of the database.
• Drop: It is used to delete objects from the database.
• Truncate: It is used to remove all records from a table.
• Rename: It is used to rename an object.
• Comment: It is used to comment on the data dictionary.
Data Manipulation Language (DML)
• It is used for accessing and manipulating data in a database.
• It handles user requests.

Commands
• Select: It is used to retrieve data from a database.
• Insert: It is used to insert data into a table.
• Update: It is used to update existing data within a table.
• Delete: It is used to delete all records from a table.
• Merge: It performs UPSERT operation, i.e., insert or update operations.
• Call: It is used to call a structured query language or a Java subprogram.
• Explain Plan: It has the parameter of explaining data.
• Lock Table: It controls concurrency.
Data Control Language (DCL)
• It is used to retrieve the stored or saved data.
• The DCL execution is transactional. It also has rollback parameters.
(But in Oracle database, the execution of data control language does not have
the feature of rolling back.)

Commands
• Grant: It is used to give user access privileges to a database.
• Revoke: It is used to take back permissions from the user.
• There are the following operations which have the authorization of Revoke:
CONNECT, INSERT, USAGE, EXECUTE, DELETE, UPDATE and SELECT.
Transaction Control Language (TCL)
• It is used to run the changes made by the DML statement.
• TCL can be grouped into a logical transaction.

Commands
• Commit: It is used to save the transaction on the database.
• Rollback: It is used to restore the database to original since
the last Commit.
Data Models and
Conceptual Modeling
Introduction to Data Modeling

Data modeling reduces the complexities


Various degrees of data abstraction help
Designers, programmers, Different views of the same of database design. It is an iterative and
reconcile varying views of same data.
data lead to designs that do progressive process that begins with a
When done properly, the final data
and end-users see data in not reflect how an
simple understanding of the problem
model effectively is a “blueprint” with all
domain, and as your understanding
different ways. organization operates. increases, so does the level of detail in
the instructions to build the database
that will meet all end-user requirements.
the data model.
Introduction to Data Modeling
Semantic data models attempt to capture the “meaning” of a
database. Practically, they provide an approach for conceptual data
modeling.

Over the years there have been several different semantic data
models that have been proposed.

By far the most common is the entity-relationship data model, most


often referred to as simply the ER data model.

The ER model is often used as a form of communication between


database designers and the end-users during the developmental
stages of a database.
Introduction to Data Modeling
The ER model contains an extensive set of modeling tools, some of which we
will not be concerned with a sour primary objective is to give you some insight
into conceptual database design and not learning all the ins and outs of the ER
model.

Another conceptual modeling which is becoming more common is the Object


Definition Language (ODL) which is an object-oriented approach to database
design that is emerging as a standard for object-oriented database systems.
Database Design
Requirement Analysis
• What data is to be stored in the database?
• What applications must be built on top of it?
• What operations are most frequent and subject
to performance requirements?
Database Design
Conceptual Database Design
• The information gathered in the requirements
analysis step is used to develop a high-level
description of the data to be stored in the database,
along with the constraints that are known to hold on
this data.
Database Design

Logical Database Design


• What DBMS?
• Convert conceptual database design into a database
schema within the data model of the chosen DBMS.
Database Design

Schema Refinement
• What DBMS?
• Convert conceptual database design into a database
schema within the data model of the chosen DBMS.
Thank you!
ANY QUESTIONS?

You might also like