0% found this document useful (0 votes)
12 views

Database management system

The document provides an overview of Database Management Systems (DBMS), including its definition, advantages, types of databases, and the architecture of Relational Database Management Systems (RDBMS). It explains various database languages such as DDL, DML, and DCL, along with concepts like normalization, transaction states, and entity-relationship models. Additionally, it covers different types of keys and includes SQL query examples for creating tables and inserting records.

Uploaded by

tokeye5819
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Database management system

The document provides an overview of Database Management Systems (DBMS), including its definition, advantages, types of databases, and the architecture of Relational Database Management Systems (RDBMS). It explains various database languages such as DDL, DML, and DCL, along with concepts like normalization, transaction states, and entity-relationship models. Additionally, it covers different types of keys and includes SQL query examples for creating tables and inserting records.

Uploaded by

tokeye5819
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA

ENROLLMENT NO:

Q1- What is DBMS? Where to use it and what is benefits of DBMS


explain.

Answer:

Database Management System (DBMS) is a software for storing


and retrieving users' data while considering appropriate security measures.
It consists of a group of programs which manipulate the database. The
DBMS accepts the request for data from an application and instructs the
operating system to provide the specific data. In large systems, a DBMS
helps users and other third-party software to store and retrieve data.

DBMS allows users to create their own databases as per their requirement.
The term “DBMS” includes the user of the database and other application
programs. It provides an interface between the data and the software
application.

Advantages of DBMS

 DBMS offers a variety of techniques to store & retrieve data


 DBMS serves as an efficient handler to balance the needs of multiple
applications using the same data
 Uniform administration procedures for data
 Application programmers never exposed to details of data
representation and storage.
 A DBMS uses various powerful functions to store and retrieve data
efficiently.
 Offers Data Integrity and Security
 The DBMS implies integrity constraints to get a high level of
protection against prohibited access to data.
 A DBMS schedules concurrent access to the data in such a manner
that only one user can access the same data at a time
 Reduced Application Development Time

BCA (INFOSYS) PAGE NO: 1


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Q2-Types of Databases? And explain any two.

Answer:

1. Centralized Databases

2. Distributed Database

3. NoSQL Database

4. Cloud Database

5. Relational Database

6. Network Database

7. Object-oriented Database

8. Hierarchical Database

1. Centralised Database
The information(data) is stored at a centralized location and the users from
different locations can access this data. This type of database contains
application procedures that help the users to access the data even from a
remote location.
Various kinds of authentication procedures are applied for the verification
and validation of end users, likewise, a registration number is provided by
the application procedures which keeps a track and record of data usage.
The local area office handles this thing.
2.NoSQL Database
These are used for large sets of distributed data. There are some big data
performance issues which are effectively handled by relational databases,
such kind of issues are easily managed by NoSQL databases. There are
very efficient in analyzing large size unstructured data that may be stored at
multiple virtual servers of the cloud.

BCA (INFOSYS) PAGE NO: 2


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Q3-What is RDBMS? Explain RDBMS Architecture.

Answer-

> RDBMS stands for Relational Database Management Systems..

All modern database management systems like SQL, MS SQL Server, IBM
DB2, ORACLE, My-SQL and Microsoft Access are based on RDBMS.

It is called Relational Data Base Management System (RDBMS) because it


is based on relational model introduced by E.F. Codd.

> DBMS ARCHITECTURE

1.1Tire architecture

2.2Tire architecture

3.3Tire architecture

BCA (INFOSYS) PAGE NO: 3


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Q4-Exaplain three schema of architecture.

Answer-

Three schema Architecture :


o The three schema architecture is also called ANSI/SPARC
architecture or three-level architecture.
o This framework is used to describe the structure of a specific
database system.
o The three schema architecture is also used to separate the user
applications and physical database.
o The three schema architecture contains three-levels. It breaks the
database down into three different categories.

The three-schema architecture is as follows:

1. Internal Level
o The internal level has an internal schema which describes the
physical storage structure of the database.
o The internal schema is also known as a physical schema.
o It uses the physical data model. It is used to define that how the
data will be stored in a block.
o The physical level is used to describe complex low-level data
structures in detail.

2. Conceptual Level
o The conceptual schema describes the design of a database at the
conceptual level. Conceptual level is also known as logical level.
o The conceptual schema describes the structure of the whole
database.
o The conceptual level describes what data are to be stored in the
database and also describes what relationship exists among those
data.
o In the conceptual level, internal details such as an implementation
of the data structure are hidden.
o Programmers and database administrators work at this level.

BCA (INFOSYS) PAGE NO: 4


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

3. External Level
o At the external level, a database contains several schemas that
sometimes called as subschema. The subschema is used to
describe the different view of the database.
o An external schema is also known as view schema.
o Each view schema describes the database part that a particular
user group is interested and hides the remaining database from
that user group.
o The view schema describes the end user interaction with database
systems.

BCA (INFOSYS) PAGE NO: 5


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Q5-What is DBMS language? Explain any DDL,DML and DCL.

Answer-

> A DBMS has appropriate language and interfaces to express database


queries and updates.

> Database language can be used to read,store and update the data in the
database.

DDL :

DDL is short name of Data Definition Language, which deals with database
schemas and descriptions, of how the data should reside in the database.

 CREATE - to create a database and its objects like (table, index, views,
store procedure, function, and triggers)
 ALTER - alters the structure of the existing database
 DROP - delete objects from the database
 TRUNCATE - remove all records from a table, including all spaces
allocated for the records are removed
 COMMENT - add comments to the data dictionary
 RENAME - rename an object

DML :
DML is short name of Data Manipulation Language which deals with data
manipulation and includes most common SQL statements such SELECT,
INSERT, UPDATE, DELETE, etc., and it is used to store, modify, retrieve,
delete and update data in a database.

 SELECT - retrieve data from a database


 INSERT - insert data into a table
 UPDATE - updates existing data within a table
 DELETE - Delete all records from a database table
 MERGE - UPSERT operation (insert or update)

BCA (INFOSYS) PAGE NO: 6


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

 CALL - call a PL/SQL or Java subprogram


 EXPLAIN PLAN - interpretation of the data access path
 LOCK TABLE - concurrency Control

DCL :
DCL is short name of Data Control Language which includes commands
such as GRANT and mostly concerned with rights, permissions and other
controls of the database system.

 GRANT - allow users access privileges to the database


 REVOKE - withdraw users access privileges given by using the GRANT
command

BCA (INFOSYS) PAGE NO: 7


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Q6-What is ER-MODEL? Explain component of ER-Diagram.

Answer-

ER model :
o ER model stands for an Entity-Relationship model. It is a high-level
data model. This model is used to define the data elements and
relationship for a specified system.
o It develops a conceptual design for the database. It also develops a
very simple and easy to design view of data.
o In ER modeling, the database structure is portrayed as a diagram
called an entity-relationship diagram.

For example:Suppose we design a school database. In this database, the


student will be an entity with attributes like address, name, id, age, etc. The
address can be another entity with attributes like city, street name, pin
code, etc and there will be a relationship between them.

BCA (INFOSYS) PAGE NO: 8


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Component of ER Diagram :

1. Entity:

An entity may be any object, class, person or place. In the ER diagram, an


entity can be represented as rectangles.

BCA (INFOSYS) PAGE NO: 9


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Consider an organization as an example- manager, product, employee,


department etc. can be taken as an entity

2. Attribute :

The attribute is used to describe the property of an entity. Eclipse is used to


represent an attribute.

3. Relationship :

A relationship is used to describe the relation between entities. Diamond or


rhombus is used to represent the relationshi

BCA (INFOSYS) PAGE NO: 10


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Q7-Explain Different types of keys.

Answer-

The different types of keys in DBMS are :−

 Candidate Key - The candidate keys in a table are defined as the set
of keys that is minimal and can uniquely identify any data row in the
table.

 Primary Key - The primary key is selected from one of the candidate
keys and becomes the identifying key of a table. It can uniquely
identify any data row of the table.

 Super Key - Super Key is the superset of primary key. The super key
contains a set of attributes, including the primary key, which can
uniquely identify any data row in the table.

 Composite Key - If any single attribute of a table is not capable of


being the key i.e it cannot identify a row uniquely, then we combine
two or more attributes to form a key. This is known as a composite
key.

 Secondary Key - Only one of the candidate keys is selected as the


primary key. The rest of them are known as secondary keys.

 Foreign Key - A foreign key is an attribute value in a table that acts


as the primary key in another another. Hence, the foreign key is
useful in linking together two tables. Data should be entered in the
foreign key column with great care, as wrongly entered data can
invalidate the relationship between the two tables.

BCA (INFOSYS) PAGE NO: 11


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Q8-What is normalizaation?

Answer-

NORMALIZATION is a database design technique that reduces data


redundancy and eliminates undesirable characteristics like Insertion,
Update and Deletion Anomalies. Normalization rules divides larger tables
into smaller tables and links them using relationships. The purpose of
Normalization in SQL is to eliminate redundant (repetitive) data and ensure
data is stored logically.

The inventor of the relational model Edgar Codd proposed the theory of
normalization with the introduction of the First Normal Form, and he
continued to extend theory with Second and Third Normal Form. Later he
joined Raymond F. Boyce to develop the theory of Boyce-Codd Normal

Database Normal Forms :

Here is a list of Normal Forms

 1NF (First Normal Form)


 2NF (Second Normal Form)
 3NF (Third Normal Form)
 BCNF (Boyce-Codd Normal Form)

BCA (INFOSYS) PAGE NO: 12


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Q9-Explain transaction state and its schedule.

Answer-

Transaction States in DBMS

Last Updated: 15-05-2020

States through which a transaction goes during its lifetime. These are the
states which tell about the current state of the Transaction and also tell how
we will further do processing we will do on the transactions. These states
govern the rules which decide the fate of the transaction whether it will
commit or abort.

These are different types of Transaction States :


1. Active State –
When the instructions of the transaction is running then the transaction
is in active state. If all the read and write operations are performed
without any error then it goes to “partially committed state”, if any
instruction fails it goes to “failed state”.
2. Partially Committed –
After completion of all the read and write operation the changes are
made in main memory or local buffer. If the the changes are made
permanent on the Data Base then state will change to “committed
state” and in case of failure it will go to “failed state”.

BCA (INFOSYS) PAGE NO: 13


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

3. Failed State –
When any instruction of the transaction fails it goes to “failed state” or
if failure occurs in making permanent change of data on Data Base.

4. Aborted State –
After having any type of failure the transaction goes from “failed state”
to “aborted state” and in before states the changes are only made to
local buffer or main memory and hence these changes are deleted or
rollback.
5. Committed Stage –
It is the stage when the changes are made permanent on the Data
Base and transaction is complete and therefore terminated in
“terminated state”.
6. Terminated State –
If there is any roll back or the transaction come from “committed state”
then the system is consistent and ready for new transaction and the
old transaction is terminated.

BCA (INFOSYS) PAGE NO: 14


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

Q10-Explain Queries.

a).Make Table-Employee

b).Insert five record of any employee.

c).Find Record which emp_name start with (m character)

Answer-
+-----------------+--------------+------+-----+---------+-------
+
| Field | Type | Null | Key | Default | Extra
|
+-----------------+--------------+------+-----+---------+-------
+
| DEPARTMENT_ID | decimal(4,0) | NO | PRI | 0 |
|
| DEPARTMENT_NAME | varchar(30) | NO | | NULL |
|
| MANAGER_ID | decimal(6,0) | NO | PRI | 0 |
|
| LOCATION_ID | decimal(4,0) | YES | | NULL |
|
+-----------------+--------------+------+-----+---------+-------
+

Sample Solution:
CREATE TABLE IF NOT EXISTS employees (
EMPLOYEE_ID decimal(6,0) NOT NULL PRIMARY KEY,
FIRST_NAME varchar(20) DEFAULT NULL,
LAST_NAME varchar(25) NOT NULL,
EMAIL varchar(25) NOT NULL,
PHONE_NUMBER varchar(20) DEFAULT NULL,
HIRE_DATE date NOT NULL,
JOB_ID varchar(10) NOT NULL,
SALARY decimal(8,2) DEFAULT NULL,
COMMISSION_PCT decimal(2,2) DEFAULT NULL,
MANAGER_ID decimal(6,0) DEFAULT NULL,
DEPARTMENT_ID decimal(4,0) DEFAULT NULL,
FOREIGN KEY(DEPARTMENT_ID,MANAGER_ID)
REFERENCES departments(DEPARTMENT_ID,MANAGER_ID)
)ENGINE=InnoDB;

BCA (INFOSYS) PAGE NO: 15


DATABASE MANAGEMENT SYSTEM NAME: BHAVDEEP VADADORIYA
ENROLLMENT NO:

BCA (INFOSYS) PAGE NO: 16

You might also like