Vous êtes sur la page 1sur 5

Q:1 what is dbms?explain its dvantages and disadvantages?

DBMS A database management system is the software system that allows users to define,
create and maintain a database and provides controlled access to the data.
A Database Management System (DBMS) is basically a collection of programs that enables
users to store, modify, and extract information from a database as per the requirements. DBMS is
an intermediate layer between programs and the data. Programs access the DBMS, which then
accesses the data. There are different types of DBMS ranging from small systems that run on
personal computers to huge systems that run on mainframes. The following are main examples
of database applications:

Advantages of Database Management System:
The DBMS has a number of advantages as compared to traditional computer file processing
approach. The DBA must keep in mind these benefits or capabilities during designing databases,
coordinating and monitoring the DBMS.
The major advantages of DBMS are described below.
1. Controlling Data Redundancy:
In non-database systems (traditional computer file processing), each application program has its
own files. In this case, the duplicated copies of the same data are created at many places. In
DBMS, all the data of an organization is integrated into a single database. The data is recorded at
only one place in the database and it is not duplicated. For example, the dean's faculty file and
the faculty payroll file contain several items that are identical. When they are converted into
database, the data is integrated into a single database so that multiple copies of the same data are
reduced to-single copy.
In DBMS, the data redundancy can be controlled or reduced but is not removed completely.
Sometimes, it is necessary to create duplicate copies of the same data items in order to relate
tables with each other.
By controlling the data redundancy, you can save storage space. Similarly, it is useful for
retrieving data from database using queries.
2. Data Consistency:
By controlling the data redundancy, the data consistency is obtained. If a data item appears only
once, any update to its value has to be performed only once and the updated value (new value of
item) is immediately available to all users.
If the DBMS has reduced redundancy to a minimum level, the database system enforces
consistency. It means that when a data item appears more than once in the database and is
updated, the DBMS automatically updates each occurrence of a data item in the database.
3. Data Sharing:
In DBMS, data can be shared by authorized users of the organization. The DBA manages the
data and gives rights to users to access the data. Many users can be authorized to access the same
set of information simultaneously. The remote users can also share same data. Similarly, the data
of same database can be shared between different application programs.
4. Data Integration:
In DBMS, data in database is stored in tables. A single database contains multiple tables and
relationships can be created between tables (or associated data entities). This makes easy to
retrieve and update data.
5. Integrity Constraints:
Integrity constraints or consistency rules can be applied to database so that the correct data can
be entered into database. The constraints may be applied to data item within a single record or
they may be applied to relationships between records.

Disadvantages of Database Management System:
The disadvantages of the database approach are summarized as follows:
1. Complexity : The provision of the functionality that is expected of a good DBMS makes the
DBMS an extremely complex piece of software. Database designers, developers, database
administrators and end-users must understand this functionality to take full advantage of it.
Failure to understand the system can lead to bad design decisions, which can have serious
consequences for an organization.
2. Size : The complexity and breadth of functionality makes the DBMS an extremely large piece
of software, occupying many megabytes of disk space and requiring substantial amounts
of memory to run efficiently.
3. Performance: Typically, a File Based system is written for a specific application, such as
invoicing. As result, performance is generally very good. However, the DBMS is written to be
more general, to cater for many applications rather than just one. The effect is that some
applications may not run as fast as they used to.
4. Higher impact of a failure: The centralization of resources increases the vulnerability of the
system. Since all users and applications rely on the ~vailabi1ity of the DBMS, the failure of any
component can bring operations to a halt.

5. Cost of DBMS: The cost of DBMS varies significantly, depending on the environment and
functionality provided. There is also the recurrent annual maintenance cost.
Q:4 Define integrative constraints,foreign key constraints,primary key
constraints,not null key constraints?
A constraint (rule) that must remain true for a database to preserve data
integrity. Integrity constraints are specified at database creation time and
enforced by the database management system.
Examples from a genealogical database would be that every individual must
be their parent's child or that they can have no more than two natural
parents.
(1995-11-11)
FOREIGN KEY Constraint
A FOREIGN KEY in one table points to a PRIMARY KEY in another table.
Let's illustrate the foreign key with an example. Look at the following two tables:
The "Persons" table:
P_Id LastName FirstName Address City
1 Kumar Suraj derabassi
2 gupta Sampy derabassi
3 mohan anand derabassi r
The "Orders" table:
O_Id OrderNo P_Id
1 77895 3
2 44678 3
3 22456 2
4 24562 1
Note that the "P_Id" column in the "Orders" table points to the "P_Id" column in the
"Persons" table.
The "P_Id" column in the "Persons" table is the PRIMARY KEY in the "Persons" table.
The "P_Id" column in the "Orders" table is a FOREIGN KEY in the "Orders" table.
The FOREIGN KEY constraint is used to prevent actions that would destroy links
between tables.
The FOREIGN KEY constraint also prevents invalid data from being inserted into the
foreign key column, because it has to be one of the values contained in the table it
points to.


FOREIGN KEY Constraint on CREATE TABLE
The following SQL creates a FOREIGN KEY on the "P_Id" column when the "Orders"
table is created:
MySQL:
CREATE TABLE Orders
(
O_Id int NOT NULL,
OrderNo int NOT NULL,
P_Id int,
PRIMARY KEY (O_Id),
FOREIGN KEY (P_Id) REFERENCES Persons(P_Id)
)
SQL Server / Oracle / MS Access:
CREATE TABLE Orders
(
O_Id int NOT NULL PRIMARY KEY,
OrderNo int NOT NULL,
P_Id int FOREIGN KEY REFERENCES Persons(P_Id)
)
To allow naming of a FOREIGN KEY constraint, and for defining a FOREIGN KEY
constraint on multiple columns, use the following SQL syntax:
PRIMARY KEY Constraint
The PRIMARY KEY constraint uniquely identifies each record in a database table.
Primary keys must contain unique values.
A primary key column cannot contain NULL values.
Most tables should have a primary key, and each table can have only ONE primary key.
PRIMARY KEY Constraint on CREATE TABLE
The following SQL creates a PRIMARY KEY on the "P_Id" column when the "Persons"
table is created:
MySQL:
CREATE TABLE Persons
(
P_Id int NOT NULL,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255),
PRIMARY KEY (P_Id)
)
SQL Server / Oracle / MS Access:
CREATE TABLE Persons
(
P_Id int NOT NULL PRIMARY KEY,
LastName varchar(255) NOT NULL,
FirstName varchar(255),
Address varchar(255),
City varchar(255)
)
To allow naming of a PRIMARY KEY constraint, and for defining a PRIMARY KEY
constraint on multiple columns, use the following SQL syntax:
NOT NULL Constraints
When using query rewrite, you should consider whether NOT NULL constraints are required.
The primary situation where you will need to use them is for join back query rewrite.
See Chapter 18, "Advanced Query Rewrite" for further information
regarding NOT NULL constraints when using query rewrite.
Q:5 what do you mean by functional dependency ?

Vous aimerez peut-être aussi