Dbms File Format Shubham
Dbms File Format Shubham
of
Database Management
System
(Software Lab-4)
___________________________________________________________________________________________
Deenbandhu Chhotu Ram University of Science and Technology
Murthal, Sonipat- INDIA,
A Haryana State Government University
INDEX
10
Experiment No : 1
Aim: Basics of SQL : DDL, DML, TCL, DCL and DQL.
EXPERIMENT NO: 2
AIM: Detailed explanation of DBMS architecture.
DBMS Architecture
o The DBMS design depends upon its architecture. The basic
client/server architecture is used to deal with a large number
of PCs, web servers, database servers and other components
that are connected with networks.
o The client/server architecture consists of many PCs and a
workstation which are connected via the network.
o DBMS architecture depends upon how users are connected
to the database to get their request done.
Types of DBMS Architecture
Database architecture can be seen as a single tier or multi-tier. But
logically, database architecture is of two types like: 2-tier
architecture and 3-tier architecture.
1-Tier Architecture
o In this architecture, the database is directly available to the
user. It means the user can directly sit on the DBMS and
uses it.
o Any changes done here will directly be done on the database
itself. It doesn't provide a handy tool for end users.
o The 1-Tier architecture is used for development of the local
application, where programmers can directly communicate
with the database for the quick response.
2-Tier Architecture
o The 2-Tier architecture is same as basic client-server. In the
two-tier architecture, applications on the client end can
directly communicate with the database at the server side.
For this interaction, API's like: ODBC, JDBC are used.
o The user interfaces and application programs are run on the
client-side.
o The server side is responsible to provide the functionalities
like: query processing and transaction management.
o To communicate with the DBMS, client-side application
establishes a connection with the server side.
3-Tier Architecture
o The 3-Tier architecture contains another layer between the
client and server. In this architecture, client can't directly
communicate with the server.
o The application on the client-end interacts with an
application server which further communicates with the
database system.
o End user has no idea about the existence of the database
beyond the application server. The database also has no idea
about any other user beyond the application.
o The 3-Tier architecture is used in case of large web
application.
EXPERIMENT NO : 3
AIM : Keys in Database Management System.
What are the different types of Keys in DBMS?
Keys are of seven broad types in DBMS:
1. Candidate Key
2. Primary Key
3. Foreign Key
4. Super Key
5. Alternate Key
6. Composite Key
7. Unique Key
1. Primary Key
The primary key refers to a column or a set of columns of a table
that helps us identify all the records uniquely present in that table.
A table can consist of just one primary key. Also, this primary key
cannot consist of the same values reappearing/repeating for any
of its rows. All the values of a primary key have to be different,
and there should be no repetitions.
The PK (PRIMARY KEY) constraint that we put on a column/set
of columns won’t allow these to have a null value or a duplicate.
Any table can consist of only a single primary key constraint. A
foreign key (explained below) that refers to it can never change
the values present in the primary key.
2. Super Key
A super key refers to the set of all those keys that help us
uniquely identify all the rows present in a table. It means that all
of these columns present in a table that can identify the columns
of that table uniquely act as the super keys.
A super key is a candidate key’s superset (candidate key has been
explained below). We need to pick the primary key of any table
from the super key’s set so as to make it the table’s identity
attribute.
3. Candidate Key
The candidate keys refer to those attributes that identify rows
uniquely in a table. In a table, we select the primary key from a
candidate key. Thus, a candidate key has similar properties as that
of the primary keys that we have explained above. In a table,
there can be multiple candidate keys.
4. Alternate Key
As we have stated above, any table can consist of multiple
choices for the primary key. But, it can only choose one. Thus, all
those keys that did not become a primary key are known as
alternate keys.
5. Foreign Key
We use a foreign key to establish relationships between two
available tables. The foreign key would require every value
present in a column/set of columns to match the referential table’s
primary key. A foreign key helps us to maintain data as well as
referential integrity.
6. Composite Key
The composite key refers to a set of multiple attributes that help
us uniquely identify every tuple present in a table. The attributes
present in a set may not be unique whenever we consider them
separately. Thus, when we take them all together, it will ensure
total uniqueness.
7. Unique Key
A unique key refers to a column/a set of columns that identify
every record uniquely in a table. All the values in this key would
have to be unique. Remember that a unique key is different from
a primary key. It is because it is only capable of having one null
value. A primary key, on the other hand, cannot have a null value.