C Language

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

RDBMS (UNIT – I)

Q1) Explain DBMS .Write the advantages of DBMS over file-based system?

Ans) Any organized collection of data is known as database. Once a database is


created it has to be maintained properly to keep the database up-to-date. Maintenance of
database refers to adding of records, deleting of records, editing records as and when
required.

Hence , a database management system (DBMS) refers to create, retrieve, update and
manage data. The DBMS works as an interface between the database and the end-user.
DBMS is useful for providing a centralized view of data that can be accessed by multiple
users, from multiple locations in a controlled manner.

Advantages of DBMS :

1. REDUCES DATA REDUNDANCY: In a normal file-based system data are kept in


individual files . Some time same data is kept in many places and unnecessary
memory wastage is done. In case of DBMS as data is stored in a centralized way once
a data is entered in one place same data is not required in any other place. This
reduces duplication of data known as data redundancy.
2. DATA INTEGRITY: Integrity refers to accurate data. Incorrect data is not allowed
in the database. For example a phone number field should not have text and a name
field should not have numbers.
3. DATA INCONSISTENCY: In a DBMS uniformity can be maintained for all the
data i.e size of a field or data type of a field. This refers to data consistency. That
means in all places one type of data is present . There is no inconsistency of data.
4. DATA SHARING: As data is stored in a central place data can be accessed by all the
users this helps in data sharing.
5. SECURITY: In a DBMS as username & password facility is there no unauthorized
person can enter into database and misuse the data. Only authorized persons are
allowed to handle the database. This maintains the data security.
6. BACK-UP & RECOVERY: In a DBMS as there is facility for back-up of data the
user can keep a copy of the data and when it is necessary the user can recover the
data.
_________________________________________________________________

Q2) Explain DBMS three level architecture.

Ans) The three level DBMS architecture are :

1. EXTERNAL LEVEL: This refers to logical records and the relationship. This is only
for the view purpose of the End-user. What ever the end-user requires that is only
displayed other things are hiding .
2. CONCEPTUAL LEVEL: This refers to the records and relationship in the database.
This is managed by the DBA (Data Base Administrator) who designs and manipulates
the data using the physical data base.

3. INTERNAL LEVEL: This refers to how the data is stored and describes the
structure and accessed methods by the database. This is the actual or raw data which
is stored in the database in physical form by the Data Administrator.

Q3) Explain the types of databases.

Ans) The different types of databases are :

1. OPERATIONAL DATABASE: These database related to operations of an


organization for example : production, marketing etc.
2. END-USER DATABASE: This refers to customer feedback, marketing trends,
competitors activities which are required by the managers.
3. CENTRALIZED DATABASE: When the database is kept in a central place i.e
head office and all the branches use the database from the central server it is called as
centralized database.
4. DISTRIBUTED DATABASE: When the organization is very large and different
locations different branches are present database is kept in several servers and several
locations .This is called as distributed database as the data is not present in one place.
5. PERSONAL DATABASE: These are small database used by single users in their
personal systems for day to day activities.
6. COMMERCIAL DATABASE: Database regarding financial consultancy,stock
exchange , foreign exchange comes under this category. A number of users use this
service by paying a nominal fee.

Q4) Define DBA . Explain the functions of DBA.

Ans)

A Database base administrator (DBA) is a person responsible for the installation,


administration & maintenance of database in an organization. A DBA plans ,co-ordinate and
implement database management and its security in the organization.

The following are some of the functions of DBA:

1. Database Designing
2. Database implementation
3. Maintaining Database
4. Database Security
5. Back up & Recovery

Database Design

The DBA creates the structure of the table by executing DDL commands. Designing
includes the logical structure of database table , their relations , the attributes and integrity
constraints. The DBA prepares the structure of the data in the tables. DBA creates the fields,
its size ,constraints of the fields.

Data Implementation

The DBA provides necessary instructions to manage the database up-to-date. A DBA takes
care of installing necessary software and database for the users . Gives the required data to
the user as per their requirement and department . A DBA is responsible to give training to
his/her sub-ordinates about handling database.
Maintaining Database

A DBA is responsible to create ,insert,delete and update record as & when required. A
DBA prepares different Queries to retrieve the data from the database. A DBA takes care of
different database errors, memory space, speed of the database etc.

Security

DBA is responsible for the safety & security of the data & information of the organization.
Data must be secured. Proper protection to the data & system should be used as a security
aspect.

Backup & Recovery

DBA is responsible to take & keep back up of all data. In case of failure of the system due to
any natural calamities or virus and other untoward incidence data can be recovered from the
back up media so that work should go smoothly

Q5)Explain different Data Models. Explain different relationships.

Ans) A data model describes the dataflow and logical inter-relationship among different data
elements. Different data models are:

1. ENTITY-RELATIONSHIP MODEL: This refers to the relationships of entity sets


stored in a database. The main components of E-R model are:
a) Entity : Entity is a thing in the organization that we want to keep
information.For example : customer,student,employee etc. In a E-R diagram
entities are displayed as rectangle shape. Entities are written in capital letters.

b) Attribute : Attribute is a property of entity. For example student rollno,name etc.


Attributes are displayed as oval shape.

c) Relationships : This tells how the entities are linked to each other. Relationships
are displayed as diamond shape.

Iih.uu
Yumm
.G
Example:

2. RELATIONAL MODEL: When the database is based on relations it is treated as


relational model. In a relational model tables are interlinked with each other using
primary key concept.
In a relational model data is stored in table consist of rows & columns. A relational
model adopts data redundancy, data integrity and data consistency.

3. OBJECT-ORIENTED MODEL: In this model every data is treated as an object. The


objects are working under a class concept. An object oriented model is based on
encapsulation, inheritance and polymorphism.
4. HIERARCHICAL MODEL: In a hierarchical model the data models is having a top-
to-bottom approach. The data flows from top to bottom in a hierarchical way. This
model is based on ONE- TO- MANY relations. For example a company hierarchical
models is:
.

5. NETWORK MODEL: This is based on MANY- TO – MANY relations. In network


model many database can be accessed by many users simultaneously. So data access
is very easy.
Q6) What is a key ? Explain different keys.

Ans) The concept of key is used to maintain data integrity.

Different kinds of keys in database are:

1. PRIMARY KEY: A primary key is a unique key identifies every row of the
database
For example : Hall ticket number in a student database. No two students will have the
same hall ticket no.

2. FOREIGN KEY: When two tables are having relationships then the primary key of a
child table when present in the parent table it is treated as a foreign key in the parent
or base table. For example in an employee database the empno is primary key where
as deptid is a foreign key in employee table. But in the department table deptid is the
primary key.

3. CANDIDATE KEY: When we combine two keys which gives a unique value for
every row of the table that combination keys are known as candidate key. For
example:
Emp_no & Dept_id
4. SUPER KEY: When we combine the primary key of a table with other fields of the
table such keys are called super keys. For example : ENO.NAME, ENO.PHNO etc.

5. COMPOSITE KEY:When there is no primary key in a table by joining two fields


such as EMPNO and DOB a unique key can be formed. This is called as composite
key.

6. ALTERNATE KEY: Any other key except primary key when used for unique then
that field is treated as alternate key. For example instead of EMP_NO when we use
DEPT_ID for unique identification this DEPT_ID is treated as alternate key.

Q7) Explain constraints. Write the different constraints.

Ans) Restrictions on the contents of the database are treated as constraints. For example in a
student table name field should not be null. That means any other field may be empty but
while saving data at least name should be present.

There are three types of constraints:

1. ENTITY CONSTRAINTS (NOT NULL) : Some fields must have values those
fields can’t have null values. For example :employee name in a employee database.

2. DOMAIN CONSTRAINTS (DATA TYPE MUST BE SAME) : we can’t insert a


wrong data type in the fields . for example : in a phone filed we can’t enter text data.

3. REFERENTIAL CONSTRAINTS: We can’t delete a record from a primary table if


matching records are present in other related table

You might also like