Dbms Assignment 1
Dbms Assignment 1
Dbms Assignment 1
The main characteristics of the database approach versus the file-processing approach are the following:
Self-describing nature of a database system
Insulation between programs and data, and data abstraction
Support of multiple views of the data
Sharing of data and multiuser transaction processing
Self- Nature of a Database System Describing
DB approach
• A fundamental characteristic of the database approach is that the database system contains not only the
database itself but also a complete definition or description of the database structure and constraints.
• This definition is stored in the DBMS catalog, which contains information such as the structure of each
file, the type and storage format of each data item, and various constraints on the data.
• The information stored in the catalog is calledmeta-data, and it describes the structure of the primary
database.
• Whenever a request is made to access, say, the Name of a STUDENT record, the DBMS software refers
to the catalog to determine the structure of the STUDENT file and the position and size of the Name data
item within a STUDENT record
Traditional file processing
• In traditional file processing, data definition is typically part of the application programs themselves.
Hence, these programs are constrained to work with only one specific database, whose structure is
declared in the application programs.
• In a typical file-processing application, the file structure and, in the extreme case, the exact location of
Name within a STUDENT record are already coded within each program that accesses this data item
2a. List advantages of DBMS over traditional file systems. Briefly explain them.
1.Controlling Redundancy: Data redundancy (such as tends to occur in the "file processing" approach)
leads to wasted storage space, duplication of effort (when multiple copies of a datum need to be updated),
and a higher likelihood of the introduction of inconsistency. On the other hand, redundancy can be used to
improve performance of queries. Indexes, for example, are entirely redundant, but help the DBMS in
processing queries more quickly. A DBMS should provide the capability to automatically enforce the rule
that no inconsistencies are introduced when data is updated.
2. Restricting Unauthorized Access: A DBMS should provide a security and authorization subsystem,
which the DBA uses to create accounts and to specify account restrictions. Then, the DBMS should
enforce these restrictions automatically.
3. Providing Persistent Storage for Program Objects: Object-oriented database systems make it easier
for complex runtime objects (e.g., lists, trees) to be saved in secondary storage so as to survive beyond
program termination and to be retrievable at a later time.
4. Providing Storage Structures and Search Techniques for Efficient Query Processing: Database
systems must provide capabilities for efficiently executing queries and updates. The query processing and
optimization module of the DBMS is responsible for choosing an efficient query execution plan for each
query based on the existing storage structures.
5. Providing Backup and Recovery: A DBMS must provide facilities for recovering from hardware or
software failures. The backup and recovery subsystem of the DBMS is responsible for recovery. The
recovery subsystem could ensure that the transaction is resumed from the point at which it was interrupted
so that its full effect is recorded in the database
6. Providing Multiple User Interfaces: Many types of users with varying levels of technical knowledge
use a database, a DBMS should provide a variety of user interfaces. For example, query languages for
casual users, programming language interfaces for application programmers, forms and/or command
codes for parametric users, menu-driven interfaces for standalone users.
7. Representing Complex Relationships Among Data: A DBMS must have the capability to represent a
variety of complex relationships among the data, to define new relationships as they arise, and to retrieve
and update related data easily and efficiently.
8. Enforcing Integrity Constraints: Most database applications have certain integrity constraints that
must hold for the data. The simplest type of integrity constraint involves specifying a data type for each
data item. A more complex type of constraint that frequently occurs involves specifying that a record in
one file must be related to records in other files. This is known as a referential integrity constraint.
Another type of constraint specifies uniqueness on data item values, this is known as a key or uniqueness
constraint
9. Permitting Inferencing and Actions Via Rules:
In a deductive database system, one may specify declarative rules that allow the database to infer new
data
E.g., Figure out which students are on academic probation. Such capabilities would take the place of
application programs that would be used to ascertain such information otherwise.
Active database systems go one step further by allowing "active rules" that can be used to initiate actions
automatically
4b. Explain different types of end users with main activities of each.
End users are the people whose jobs require access to the database for querying, updating, and generating
report.
There are several categories of end users:
■Casual end users occasionally access the database, but they may need different information each time.
They use a sophisticated database query language to specify their requests and are typically middle- or
high-level managers or other occasional browsers.
■Naive or parametric end users make up a sizable portion of database end users. Their main job function
revolves around constantly querying and updating the database, using standard types of queries and
updates—called canned transactions—that have been carefully programmed and tested.
The tasks that such users perform are varied:
Bank tellers check account balances and post withdrawals and deposits.
Reservation agents for airlines, hotels, and car rental companies check availability for a given request
and make reservations.
shipping clerks (e.g., at UPS) who use buttons, bar code scanners, etc., to update status of in-transit
packages.
■Sophisticated end users include engineers, scientists, business analysts, and others who thoroughly
familiarize themselves with the facilities of the DBMS in order to implement their own applications to
meet their complex requirements
■Stand-alone users Use "personal" databases, possibly employing a special purpose (e.g., financial)
software package. Mostly maintain personal databases using ready-to-use packaged applications.
An example is a tax program user that creates its own internal database.
5a. List the summary of the notations for ER diagrams. Include symbols used in ER diagrams and their
meaning
5b. Explain different types of attributes that occur in ER model with an example.
Types of attributes occur in the ER model
simple versus composite
single valued versus multivalued
stored versus derived
Attributes that are not divisible are called simple or atomic attributes.
For eg: attribute Age cannot be divided
Single valued
Most attributes have a single value for a particular entity
For eg: Age is a single-valued attribute of a person
Multivalued
An entity having multiple values for that attribute
For eg: color of a color color={black ,red},Person’s degree degree={BE, MTech, PhD}
NULL Values
In some cases, a particular entity may not have an applicable value for an attribute. For eg, the
Apartment number attribute of an address applies only to addresses that are in apartment buildings and
not to other types of residences, such as single-family homes College_degrees attribute applies only to
people with college degrees
Complex Attributes
composite and multivalued attributes can be nested arbitrarily
arbitrary nesting by grouping components of a composite attribute between parentheses ( ) and
separating the components with commas, and by displaying multivalued attributes between braces { }.
Such attributes are called complex attributes
For example, if a person can have more than one residence and each residence can have a single address
and multiple phones, an attribute Address_phone for a person
{Address phone({phone(Area code,phone number)}Address (street address(street,number, apartment
number)citi,statezip)}
A data model:-
—a collection of concepts that can be used to describe the structure of a database—provides the necessary
means to achieve this abstraction
Meta data:- The DBMS stores the descriptions of the schema constructs and constraints—also called the
meta-data.
Data base:-
A database is a collection of related data.
A data mean known facts that can be recorded and that have implicit meaning.
Schema:- The description of a database is called the database schema, which is specified during database
design and is not expected to change frequently.
Instance:-
The data in the database at a particular moment in time is called a database state or SNAPSHOT. It is also
called the currentset of occurrences or instances in the database.
Canned transaction:-
User main job function revolves around constantly querying and updating the database, using standard
types of queries and updates—called canned transactions—that have been carefully programmed and
tested.
Cardinality ratio:-
the maximum number of relationship instances that an entity can participate in.
attribute:- An attribute represents some property of interest that further describes an entity, such as the
employee’s name and salary
database state:-
The data in the database at a particular moment in time is called a database state or SNAPSHOT
Primary key:-
Candidate key:-
Catalogue:-
Entity and attribute:- An entity represents a real-world object or concept, such as an employee or a
project from the miniworld that is described in the database.
attribute:- An attribute represents some property of interest that further describes an entity, such as the
employee’s name and salary
entity type:-
entity type defines a collection (or set) of entities that have the same attributes
each entity type in the database is described by its name and attributes
Entity set:-
The collection of all entities of a particular entity type in the database at any point in time is called an
entity set or entity collection.
entity set is usually referred to using the same name as the entity type
We call this other entity type the identifying or owner entity type, and we call the relationship type that
relates a weak entity type to its owner the identifying relationship of the weak entity type
Degree of a relationship type:- The degree of a relationship type is the number of participating entity
types
Role name:- the role name signifies the role that a participating entity from the entity type plays in each
relationship instances.
Participation constraints:-
The participation constraint specifies whether the existence of an entity depends on its being related to
another entity via the relationship type
There are two types of participation constraints—total and partial