Sie sind auf Seite 1von 8

ASSIGHNMENT:-

MANAGING
DATABASE

SUBMITTED TO: SUBMITTED


BY:
Respected ANKUR
SINGH
Gargi mam RE3801A29
CAP 200
Part A

Q1. Elaborate the Components of DBMS environment using


appropriate diagram and their linking.

Ans:- DBMS:-Database management system. It is a collection of


interrelated data and the set of programs to access those data. The
primary goal of a DBMS is to provide a way to store and retrieve
database information that is both convenient and efficient.

DBMS Engine accepts logical request from the various other DBMS
subsystems, converts them into physical equivalents, and actually
accesses the database and data dictionary as they exist on a
storage device.
Data Definition Subsystem helps user to create and maintain the
data dictionary and define the structure of the files in a database.
Data Manipulation Subsystem helps user to add, change, and delete
information in a database and query it for valuable information.
Software tools within the data manipulation subsystem are most
often the primary interface between user and the information
contained in a database. It allows user to specify its logical
information requirements.
Application Generation Subsystem contains facilities to help users
to develop transaction-intensive applications. It usually requires
that user perform a detailed series of tasks to process a
transaction. It facilitates easy-to-use data entry screens,
programming languages, and interfaces.
Data Administration Subsystem helps users to manage the overall
database environment by providing facilities for backup and
recovery, security management, query optimization, concurrency
control, and change management.

Q2. With the help of a query give different types of


character data types supported by SQL2 standard? Describe
the difference in meaning between the terms Relation &
Relational Schema for a example of a bank database.

Ans:-

Fundamental concepts in Relational Data Model:-A relational


database is a collection of relations (frequently called tables). Other
items are frequently considered part of the database, as they help
to organize and structure the data, in addition to forcing the
database to conform to a set of requirements.
A Schema for a relation is represented by the name of the relation
followed by a parenthesized list of attributes.
Example:accounts(account#:int, balance: real)
1.)Domain:- A domain D is the original sets of atomic values used
to model data.
By atomic, we mean that each value in the domain is indivisible as
far as the relational model is concerned. For example:
The domain of day shift is the set of all possible days : {Mon, Tue,
Wed…}
The domain of salary is the set of all floating-point numbers greater
than 0 and less than 200,000 (say).
The domain of name is the set of character strings that represents
names of person
2.Relation:- (Relation state): A relation is a subset of the Cartesian
product of a list of domains characterised by a name.
Given n domains denoted by D1, D2, …, Dn , r is a relation defined
on these domains if r⊆D1×D2×...×Dn
Relation can be viewed as a “table”. In that table, each row
represents a tuple of data values and each column represents an
attribute.
3.Attribute: A column of a relation designated by name. The name
associated should be meaningful. Each attributes associates with a
domain.
4. A relation schema denoted by R is a list of attributes (A1, A2, …,
An)

Q3. Design the single-database architecture, multi-


database architecture and multi-location architecture with
examples.

Ans:-3
• Client performs
– Application
– User interface
– DBMS Client model
– Multiple Client - Single Server
– Single Server accessed by multiple clients
Multi-DBMS
• Mapping is from local conceptual schema to a global schema
• Bottom-up design
• Consists of two layers, local system layer and multi database layer.
• Local system layer , present to the multi-database layer the part of
their local database they are willing share with users of other
database.
• System views are constructed above this layer
• Responsibility of providing access to multiple database is delegated to
the mapping between the external schemas and the local conceptual
schemas.
• Full-fledged DBMs, exists each of which manages a different database
Part B

Q4. Why null values might be introduced into the database.


Give at least two reasons for the same with the help of
queries.

Ans:- Null is a special marker used in Structured Query Language


(SQL)to indicate that a data value does not exist in the database.
Introduced by the creator of the relational database model, SQL
Null serves to fulfill the requirement that all true relational
database management systems (RDBMS) support a representation
of "missing information and inapplicable information".
The two reason which shows why we introduce NULL values in the
database are discussed below:-

When we don’t want to enter any value.


Example/query:-Insert into tablename(id,name)values(1,’’)
When we use alter command in that case, by default the system
takes the NULL value.
Syntax:-Alter table table name add couloum name data types
Example/query:-Alter table emp add salary int

Q5. Consider the relational database:


employee(empname, street, city)
works(empname, companyname, salary)
company(companyname, city)
manages(empname, managername).
Give an expression in the relational algebra for each
request.
(i) Find the names, street addresses and cities of
residence of all employees who work for first bank
corporation and earn more than 200000 per annum.
(ii) Find the names of all employees in this database who
live in the same city as the company for which they work.
(iii) Find the names of all employees who earn more than
every Employees of small Bank Corporation.

Ans(i)
Query:- Π(employeename, street, city) (Employee) (σsalary>200000 (work))

Ans:-(ii)Query:- Πname (Employee) (σcity=’Kolkatal’ (company))

Ans:-(iii)Query:-Πemployeename(work)(σsalary.companyname=’firstbankcor.’

>salary.companyname=’small bank cor.’(work))

Q6.Consider the following database.


Employee (employee-name, street, city)
Works (employee-name, company-name, salary)
Company (company-name, city)
Manager (employee-name, manager-name)

Give an expression in the relational algebra, the tuple


relational calculus, and the domain relational calculus, for
the following queries.
i.Find the names of all employees who work for “XYZ” bank.

ii.Find the street, city of the employee working under


manager “Krishna”.

Ans:-i) Πname(σcompany_name=’xyz’ (company))

Ans:-ii) Πstreet,city(σmanager=’krishna’ (employee))

Das könnte Ihnen auch gefallen