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

Refer To Q. No 4 From March 2015

The document provides information about database management systems (DBMS), normalization, comparing tables and views, database administrators (DBA), distributed databases, Oracle databases, foreign keys, Boyce-Codd normal form (BCNF), components of a DBMS, risks and costs of databases, normal forms, and relational algebra. Key points include: - A DBMS allows users to create, access, manage and analyze data in a database. Normalization is used to eliminate redundant data and ensure logical data storage. - Tables can be modified directly while views provide security and prevent direct modification. A DBA manages database security, performance and maintenance. A distributed database spreads data across multiple computers. - Relational
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
55 views

Refer To Q. No 4 From March 2015

The document provides information about database management systems (DBMS), normalization, comparing tables and views, database administrators (DBA), distributed databases, Oracle databases, foreign keys, Boyce-Codd normal form (BCNF), components of a DBMS, risks and costs of databases, normal forms, and relational algebra. Key points include: - A DBMS allows users to create, access, manage and analyze data in a database. Normalization is used to eliminate redundant data and ensure logical data storage. - Tables can be modified directly while views provide security and prevent direct modification. A DBA manages database security, performance and maintenance. A distributed database spreads data across multiple computers. - Relational
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 13

B.

Com II year March 2016

RDBMS

I. Answer any five

1. what is DBMS?

A database management system (DBMS) is a collection ofprograms that enables you to store,


modify, and extract information from a database. There are many different types of database
management systems, ranging from small  systems that run on personal computers to huge
systems that run on mainframes.

Examples: Microsoft Access, MySQL, Microsoft SQL Server, Oracle and FileMaker Pro are all
examples of database management systems.

2. What is normalization

Database Normalisation is a technique of organizing the data in the database. Normalization is


a systematic approach of decomposing tables to eliminate data redundancy and undesirable
characteristics like Insertion, Update and Deletion Anamolies. It is a multi-step process that
puts data into tabular form by removing duplicated data from the relation tables.
Normalization is used for mainly two purpose,

 Eliminating reduntant(useless) data.


 Ensuring data dependencies make sense i.e data is logically stored.

3. Compare table with view

Table:

1. A table is a relation that is not a derived relation.


2. While it can manipulate the conceptual or physical relations stored 
in the data.
3. It does not provide security.
4. Modification may be done with a table.

Views:

1. This is one type of relation which is not a part of the physical 


database.
2. It has no direct or physical relation with the database.
3. Views can be used to provide security mechanism.
4. Modification through a view (e.g. insert, update, delete) generally 
not permitted

We can assign the view, a name & relate it the query expression as
Create View <View Name> as <Query Expression>

4. What is DBA

Refer to Q. No 4 from March 2015


5. What do you mean by distributed database?

Refer to Q. No 5 from March 2014

6. Write about ORACLE

An Oracle database is a collection of data treated as a unit. The purpose of a database is to


store and retrieve related information. A database server is the key to solving the problems of
information management. In general, a server reliably manages a large amount of data in a
multiuser environment so that many users can concurrently access the same data. All this is
accomplished while delivering high performance. A database server also prevents
unauthorized access and provides efficient solutions for failure recovery.

Oracle Database is the first database designed for enterprise grid computing, the most flexible
and cost effective way to manage information and applications.

The database has logical structures and physical structures. Because the physical and


logical structures are separate, the physical storage of data can be managed without affecting
the access to logical storage structures.

7. What is foreign key?

In an SQL database, a foreign key is a column, or set of columns, which creates a link between
its table and another table. The main table that the link is created from contains a primary key,
which links to the foreign key of the second table. This primary key > foreign key link allows
one or more rows of data in one table to link, or relate, to one or more rows of data in another
table.
A foreign key is created by using the "FOREIGN KEY" constraint when either creating a new
database table or altering an existing database table. The column designated as a foreign key
also inherently has the "NOT NULL" constraint, which means it must contain a value and
cannot be blank.

8. What is BCNF?

Boyce and Codd Normal Form is a higher version of the Third Normal form. This form deals
with certain type of anamoly that is not handled by 3NF. A 3NF table which does not have
multiple overlapping candidate keys is said to be in BCNF. For a table to be in BCNF, following
conditions must be satisfied:

R must be in 3rd Normal Form

and, for each functional dependency ( X -> Y ), X should be a super Key.

PART B

9. (a) What are the components of DBMS

Refer to Q. No 9 from UNIT I of Question Bank.

OR
(b) write the risks and costs associated with the database

In database approach in order to maintain or develop database we should take a risk and we
should invest money , time and environment. Database approach when we develop a new
database or when we maintain an existing database we should consider the following points.

 New specialized persons.


 Installation and manage cost and complexity.
 Conversion costs.
 Need for explicit back up and recovery.
 Organizational conflict.

New, Specialized Personnel: Frequently, organizations that adopt the database approach


need to hire or train individuals to design and implement databases. This personnel increase
seems to be expensive, but an organization should not minimize the need for these specialized
skills.

Installation and Management Cost and Complexity: A multi-user database management


system is large and complex software that has a high initial cost. It requires trained personnel
to install and operate, and also has annual maintenance costs. Installing such a system may
also require upgrades to the hardware and data communications systems in the organization.  

Conversion Costs: The term “legacy systems” is used to refer to older applications in an


organization that are based on file processing. The cost of converting these older systems to
modern database technology may seem prohibitive to an organization.

Need for Explicit Backup and Recovery: A shared database must be accurate and available
at all times. This raises the need to have backup copies of data for restoring a database when
damage occurs.  A modern database management system normally automates recovery tasks. 

Organizational Conflict: A database requires an agreement on data definitions and


ownership as well as responsibilities for accurate data maintenance. The conflicts on data
definitions, data formats and coding causes updating of shared data. Handling these issues
requires organizational commitment to the database approach. 

10(a). Explain any three normal forms

Refer to Q. No 10(b) from October 2014

OR

(b) Write about Relational Algebra

Relational algebra is a procedural query language, which takes instances of relations as input
and yields instances of relations as output. It uses operators to perform queries. An operator
can be either unary or binary. They accept relations as their input and yield relations as their
output. Relational algebra is performed recursively on a relation and intermediate results are
also considered relations.

The fundamental operations of relational algebra are as follows −


 Select
 Project
 Union
 Set different
 Cartesian product
 Rename
Select Operation (σ)
It selects tuples that satisfy the given predicate from a relation.

Notation − σp(r)

Where σ stands for selection predicate and r stands for relation. p is prepositional logic


formula which may use connectors like and, or, and not. These terms may use relational
operators like − =, ≠, ≥, < ,  >,  ≤.

For example −

σsubject = "database"(Books)

Output − Selects tuples from books where subject is 'database'.

σsubject = "database" and price = "450"(Books)

Output − Selects tuples from books where subject is 'database' and 'price' is 450.

σsubject = "database" and price = "450" or year > "2010"(Books)

Output − Selects tuples from books where subject is 'database' and 'price' is 450 or those
books published after 2010.

Project Operation (∏)


It projects column(s) that satisfy a given predicate.

Notation − ∏A1, A2, An (r)

Where A1, A2 , An are attribute names of relation r.

Duplicate rows are automatically eliminated, as relation is a set.

For example −

∏subject, author (Books)


Selects and projects columns named as subject and author from the relation Books.

Union Operation (∪)


It performs binary union between two given relations and is defined as −

r ∪ s = { t | t ∈ r or t ∈ s}

Notion − r U s

Where r and s are either database relations or relation result set (temporary relation).

For a union operation to be valid, the following conditions must hold −

 r, and s must have the same number of attributes.


 Attribute domains must be compatible.
 Duplicate tuples are automatically eliminated.

∏ author (Books) ∪ ∏ author (Articles)

Output − Projects the names of the authors who have either written a book or an article or
both.

Set Difference (−)


The result of set difference operation is tuples, which are present in one relation but are not in
the second relation.

Notation − r − s

Finds all the tuples that are present in r but not in s.

∏ author (Books) − ∏ author (Articles)

Output − Provides the name of authors who have written books but not articles.

Cartesian Product (Χ)


Combines information of two different relations into one.

Notation − r Χ s

Where r and s are relations and their output will be defined as −

r Χ s = { q t | q ∈ r and t ∈ s}

σauthor = 'tutorialspoint'(Books Χ Articles)


Output − Yields a relation, which shows all the books and articles written by tutorialspoint.

Rename Operation (ρ)


The results of relational algebra are also relations but without any name. The rename
operation allows us to rename the output relation. 'rename' operation is denoted with small
Greek letter rho ρ.

Notation − ρ x (E)

Where the result of expression E is saved with name of x.

Additional operations are −

 Set intersection
 Assignment
 Natural join

11 (a). Write about SQL. Explain any two DDL and DML commands

SQL (Structured Query Language) is a standardized programming language used for managing
relational databases and performing various operations on the data in them. 

The uses of SQL include modifying database table and index structures; adding, updating and
deleting rows of data; and retrieving subsets of information from within a database for
transaction processing and analytics applications. Queries and other SQL operations take the
form of commands written as statements -- commonly used SQL statements include select,
add, insert, update, delete, create, alter and truncate.

DDL Commands

Data definition language defines the schema for the database by specifying entities and the
relationship among them. In addition to this, DDL even defines certain security constraints.

create command
create is a DDL command used to create a table or a database.

Creating a Database
To create a database in RDBMS, create command is uses.
Syntax : create database database-name;
Example for Creating Database
create database Test;
The above command will create a database named Test.
Creating a Table
create command is also used to create a table. We can specify names and datatypes of various
columns along.Following is the Syntax,
create table table-name
{
column-name1 datatype1,
column-name2 datatype2,
column-name3 datatype3,
column-name4 datatype4
};
create table command will tell the database system to create a new table with given table
name and column information.
Example for creating Table
create table Student(id int, name varchar, age int);
The above command will create a new table Student in database system with 3 columns,
namely id, name and age.
alter command
alter command is used for alteration of table structures. There are various uses
of alter command, such as,

 to add a column to existing table


 to rename any existing column
 to change datatype of any column or to modify its size.
 alter is also used to drop a column.

To Add Column to existing Table


Using alter command we can add a column to an existing table.
Syntax : alter table table-name add(column-name datatype);
Example : alter table Student add(address char);
The above command will add a new column address to the Student table
To Add Multiple Column to existing Table
Using alter command we can even add multiple columns to an existing table.
Syntax : alter table table-name add(column-name1 datatype1, column-name2 datatype2,
column-name3 datatype3);
Example : alter table Student add(father-name varchar(60), mother-name varchar(60), dob
date);
The above command will add three new columns to the Student table
To Add column with Default Value
alter command can add a new column to an existing table with default values.
Syntax : alter table table-name add(column-name1 datatype1 default data);
example :alter table Student add(dob date default '1-Jan-99');
The above command will add a new column with default value to the Student table
To Modify an existing Column
alter command is used to modify data type of an existing column .
Syntax : alter table table-name modify(column-name datatype);
Example : alter table Student modify(address varchar(30));
The above command will modify address column of the Student table
To Rename a column
Using alter command you can rename an existing column.
Syntax : alter table table-name rename old-column-name to column-name;
Example : alter table Student rename address to Location;
The above command will rename address column to Location.
To Drop a Column
alter command is also used to drop columns also.
Syntax : alter table table-name drop(column-name);
Example : alter table Student drop(address);
The above command will drop address column from the Student table

DML Command

Data Manipulation Language (DML) statements are used for managing data in database. DML
commands are not auto-committed. It means changes made by DML command are not
permanent to database, it can be rolled back.
1) INSERT command
Insert command is used to insert data into a table.
Syntax : INSERT into table-name values(data1,data2,..)
Example
Consider a table Student with following fields.

S_id S_Name age

INSERT into Student values(101,'Adam',15);


The above command will insert a record into Student table.

S_id S_Name age

101 Adam 15

2) UPDATE command
Update command is used to update a row of a table.
Syntax :UPDATE table-name set column-name = value where condition;
Example:
update Student set age=18 where s_id=102;

S_id S_Name age

101 Adam 15

102 Alex 18

103 chris 14

OR

(b) Explain about database change operations like arithmetic operators and logical
operators.

Arithmetic Operators in SQL


Arithmetic operators can perform arithmetical operations on numeric operands involved.
Arithmetic operators are addition(+), subtraction(-), multiplication(*) and division(/). The +
and - operators can also be used in date arithmetic.

Operator Meaning

+ (Add) Addition

- (Subtract) Subtraction

* (Multiply) Multiplication

/ (Divide) Division
% (Modulo) Returns the integer remainder of a division. For example, 17 % 5 = 2
because the remainder of 17 divided by 5 is 3.

Syntax :
SELECT <Expression>[arithmetic operator]<expression>...

FROM [table_name]

WHERE [expression];

Parameter Description

Expression Expression made up of a single constant, variable,


scalar function, or column name and can also be the
pieces of a SQL query that compare values against other
values or perform arithmetic calculations.

arithmetic operator Plus(+), minus(-), multiply(*), and divide(/).

table_name Name of the table.

Logical Operators in SQL


The Logical operators are those that are true or false. They returns a true or false values to
combine one or more true or false values.
The Logical operators are :

Operator Description

AND Logical AND compares between two Booleans as expression and return
true when both expressions are true...

OR Logical OR compares between two Booleans as expression and return true


when one of the expression is true...

NOT Not takes a single Boolean as an argument and changes its value from false
to true or from true to false....

IN The IN operator checks a value within a set of values separated by commas


and retrieve the rows from the table which are matching....

BETWEEN The SQL BETWEEN operator tests an expression against a range. The range
consists of a beginning, followed by an AND keyword and an end
expression....

ANY ANY compares a value to each value in a list or results from a query and
evaluates to true if the result of an inner query contains at least one row....

ALL ALL is used to select all records of a SELECT STATEMENT. It compares a


value to every value in a list or results from a query. The ALL must be
preceded by the comparison operators and evaluates to TRUE if the query
returns no rows....

SOME SOME compares a value to each value in a list or results from a query and
evaluates to true if the result of an inner query contains at least one row...

EXISTS The EXISTS checks the existence of a result of a subquery. The EXISTS
subquery tests whether a subquery fetches at least one row. When no data
is returned then this operator returns 'FALSE'...

Syntax
SELECT [column_name | * | expression] [logical operator]

[column_name | * | expression .....]

FROM <table_name>

WHERE <expressions> [ logical operator |

arithmetic operator | ...] <expressions>;

Parameters

Name Description

column_name Name of the column of a table.

* All the columns of a table.

expression Expression made up of a single constant, variable, scalar


function, or column name and can also be the pieces of a SQL
query that compare values against other values or perform
arithmetic calculations.

table_name Name of the sable.

logical operator AND, OR , NOT etc.


arithmetic operator Plus(+), minus(-), multiply(*) and divide(/).

12 (a). write the functions of DBA.

Refer to Q. No 12(b) from September 2015

OR

(b) Explain about database security.

Database security concerns the use of a broad range of information security controls to


protect databases (potentially including the data, the database applications or stored
functions, the database systems, the database servers and the associated network links)
against compromises of their confidentiality, integrity and availability. It involves various
types or categories of controls, such as technical, procedural/administrative and
physical. Database security is a specialist topic within the broader realms of computer
security,information security and risk management.
Types of Security
Database security is a broad area that addresses many issues, including the following:
■ Various legal and ethical issues regarding the right to access certain information
for example, some information may be deemed to be private and cannot be accessed legally by
unauthorized organizations or persons. In the United States, there are numerous laws
governing privacy of information.
■ Policy issues at the governmental, institutional, or corporate level as to what kinds of
information should not be made publicly available
for example, credit ratings and personal medical records.
■ System-related issues such as the system levels at which various security functions should
be enforced
for example, whether a security function should be handled at the physical hardware level, the
operating system level, or the DBMS level.
■ The need in some organizations to identify multiple security levels and to categorize the
data and users based on these classifications
for example, top secret, secret, confidential, and unclassified. The security policy of the
organization with respect to permitting access to various classifications of data must be
enforced.
Threats to Databases.
Threats to databases can result in the loss or degradation of some or all of the following
commonly accepted security goals: integrity, availability, and confidentiality.
■ Loss of integrity.
Database integrity refers to the requirement that information be protected from improper
modification. Modification of data includes creation, insertion, updating, changing the status of
data, and deletion. Integrity is lost if unauthorized changes are made to the data by either
intentional or accidental acts. If the loss of system or data integrity is not corrected, continued
use of the contaminated system or corrupted data could result in inaccuracy, fraud, or
erroneous decisions.
■ Loss of availability.
Database availability refers to making objects available to a human user or a program to which
they have a legitimate right.
■ Loss of confidentiality.
Database confidentiality refers to the protection of data from unauthorized disclosure. The
impact of unauthorized disclosure of confidential information can range from violation of the
Data Privacy Act to the jeopardization of national security. Unauthorized, unanticipated, or
unintentional disclosure could result in loss of public confidence, embarrassment, or legal
action against the organization. To protect databases against these types of threats, it is
common to implement
Four main control measures are used to provide security of data in databases:
■ Access control
■ Inference control
■ Flow control
■Data encryption
13(a). Explain DBMS functionalities and capabilities

Refer to Q. No : 6 from UNIT V of Question Bank

OR

(b) Write about distributed Query processing

Refer to Q. No 13(a) from October 2014

You might also like