Professional Documents
Culture Documents
1
DBMS UNIT-1
2
DBMS UNIT-1
difference between DDL and DML
DDL DML
4. It is further classified
4. It doesn’t have any further
into Procedural and Non-
classification.
Procedural DML.
6. DDL does not use WHERE 6. While DML uses WHERE clause in its
clause in its statement. statement.
3
DBMS UNIT-1
DDL DML
1. Relational Data Model: This type of model designs the data in the form of rows
and columns within a table. Thus, a relational model uses tables for representing
data and in-between relationships.
4
DBMS UNIT-1
4. Network Model: In network model data is organized like a graph and are allowed
to have more than one parent node. In this database model data is more related as
more relationships are established. Accessing the data is also easier and fast. This
database model was used to map many-to-many data relationships.
5
DBMS UNIT-1
5. Hierarchical Data Model: Hierarchical data model is the oldest type of the data
model. It organizes data in the tree-like structure. It contains nodes which are
connected by branches. The topmost node is called the root node. If there are
multiple nodes appear at the top level, then these can be called as root segments.
Each node has exactly one parent. One parent may have many child.
6
DBMS UNIT-1
It implements
It implements 1:1 ,1:n
It implements 1:1 1:1 ,1:n and many
3. and many to many
and 1:n relations. to many
relationships.
relationships.
The logical
Pointers are used to A linked list is used representation is used
establish relationships to establish a with rows and
4.
among records relationship among columns to establish a
physically. records physically. relationship among
records physically.
There is insertion
anomaly in this model
There is no insertion There is no insertion
5. i.e. child node cannot
anomaly. anomaly.
be inserted without
the parent node.
There is deletion
anomaly in this model
There is no deletion There is no deletion
6. i.e. it is difficult to
anomaly. anomaly.
delete the parent
node.
Update leads to
Updating a record is easy
inconsistency
No such problem as and simple with the
problems because of
7. only one instance of process of normalization,
the existence of
records exist. the redundant data gets
multiple instances of
removed.
a child record.
7
DBMS UNIT-1
Difficult to design a
database and
It is easy to comprehend
Difficult to design a manipulate a
due to concealed
11. database because of database because of
physical level details
its complexity. its complexity. Hence,
from end-users.
it imposes a burden
on the programmer.
Integrity Constraints
• Integrity constraints are a set of rules.
• It is used to maintain the quality of information.
• Integrity constraints ensure that the data insertion, updating, and other processes
must be performed in such a way that data integrity is not affected.
• Integrity constraint is used to guard against accidental damage to the database.
Types of Integrity Constraint
8
DBMS UNIT-1
Domain constraints
• Domain constraints can be
defined as the definition of a
valid set of values for an
attribute.
• The data type of domain
includes string, character,
integer, time, date, currency,
etc. The value of the attribute
must be available in the corresponding domain.
Entity integrity constraints
• The entity integrity constraint states that primary key value can't be null.
• This is because the primary key value is used to identify individual rows in relation
and if the primary key has a null value, then we can't identify those rows.
• A table can contain a null value other than the primary key field.
Key constraints
• Keys are the entity set that is used to identify an entity within its entity set
uniquely.
• An entity set can have multiple keys, but out of which one key will be the primary
key. A primary key can contain a unique and null value in the relational table.
10