0% found this document useful (0 votes)
692 views128 pages

DBMS (1 - 5 Units)

The document outlines the syllabus for a database management systems course. It covers 5 units: 1) Advantages and components of DBMS, feasibility studies, class diagrams, data types, events, normal forms, and converting class diagrams to normalized tables. 2) Query basics, computation with queries, subtotals, joins, data definition and manipulation languages, and testing queries. 3) Designing effective forms and reports, creating forms, custom reports, and programs to retrieve and save data. 4) Application structure, user interface features, transactions, distributing applications, data storage methods, and object-oriented databases. 5) Database administration, development stages, backup/recovery, security, distributed

Uploaded by

jagan nathan
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)
692 views128 pages

DBMS (1 - 5 Units)

The document outlines the syllabus for a database management systems course. It covers 5 units: 1) Advantages and components of DBMS, feasibility studies, class diagrams, data types, events, normal forms, and converting class diagrams to normalized tables. 2) Query basics, computation with queries, subtotals, joins, data definition and manipulation languages, and testing queries. 3) Designing effective forms and reports, creating forms, custom reports, and programs to retrieve and save data. 4) Application structure, user interface features, transactions, distributing applications, data storage methods, and object-oriented databases. 5) Database administration, development stages, backup/recovery, security, distributed

Uploaded by

jagan nathan
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/ 128

DATA BASE MANAGEMENT SYSTEMS

For Fifth Semester B.Sc. (Computer Science) / B.C.A. Students


(Common to two branches)
UNIVERSITY OF MADRAS
Syllabus for B.Sc. (Computer Science) / B.C.A. Degree Course

UNIT I :

Advantages and Components of a Database Management Systems - Feasibility Study - Class


Diagrams - Data Types - Events - Normal Forms - Integrity - Converting Class Diagrams to
Normalized Tables - Data Dictionary.

UNIT II :

Query Basics - Computation Using Queries - Subtotals and GROUP BY Command - Queries
with Multiple Tables - Subqueries - Joins - DDL & DML - Testing Queries.

UNIT III :

Effective Design of Forms and Reports - Form Layout - Creating Forms - Graphical Objects -
Reports - Procedural Languages - Data on Forms - Programs to Retrieve and Save Data -
Error Handling.

UNIT IV :

Power of Application Structure - User Interface Features - Transaction - Forms Events -


Custom Reports - Distributing Application - Table Operations - Data Storage Methods -
Storing Data Columns - Data Clustering and Partitioning.

UNIT V :

Database Administration - Development Stages - Application Types - Backup and Recovery -


Security and Privacy - Distributed Databases - Client/Server Databases Web as a
Client/Server System - Objects - Object Oriented Databases - Integrated Applications.

Text:

1. G. V. Post - Database Management Systems Designing and Building Business Application


- McGraw Hill International edition - 1999.

References:

1. Raghu Ramakrishnan - Database Management Systems - WCB/McGraw Hill - 1998.

2. C.J. Date - An Introduction to Database Systems - 7th Edition - Addison Wesley - 2000.


DATABASE MANAGEMENT SYSTEMS

UNIT – I

Question & Answers for Two marks:


1. Define entity. (APR. 2012)
Something in the real world that you wish to describe or track is called entity.
E.g. Customer, sales

2. What is a Primary key? (APR. 2012)


The Primary Key is a column or set of columns that identifies a particular row. Every
table must have a primary key. It can never point to more than one row or object in a data
base.

3. What is DBMS? (NOV. 2010, 2011, 2013, 2014)


A Data Base Management System is a software that defines a database, stores the
data, supports a query language, produces reports and creates data entry screens.

4. What is RDBMS? (NOV. 2010, APR. 2015)


A Relational Data Base Management System is a collection of carefully designed
tables which is a collection of columns that describe an entity.

5. What is Normalization? (NOV. 2010, APR. 2015)


Normalization is the process of reorganizing data in a database so that it meets two
basic requirements: (1) There is no redundancy of data (all data is stored in only one place),
and (2) data dependencies are logical (all related data items are stored together).
6. What are the basic data types to define an attribute? (NOV. 2010, 2013)
The basic data types are Text, Number, Date and Time, Interval, Image, auto number .

7. What is a Feasibility study? (NOV. 2011)


An analysis and evaluation of a proposed project to determine if it is technically worth
with in the cost and if it is benefit or profitable is called feasibility study.

9. What is meant by Data Dictionary or Data repository? (NOV. 2011, NOV .2012,
NOV.2015, APR. 2012)
The Data Dictionary holds the definitions of all the data tables. It describes the
type of data being stored. It allows the DBMS to keep track of the data. It helps developers
and users to find the data they need.

10. What are the basic components of a DBMS? (NOV. 2012, APR. 2016)
The basic components of DBMS are
Data Base Engine
Data Dictionary
Query Processor
Report Writer
Forms Generator
Application Generator
Communication and Integration
Security

11. What is meant by first Normal Form? (NOV .2012, APR. 2016)
When a table has no repeating groups it is said to be in first Normal form (1NF).For
each cell in a table there can be only one value, it cannot be decomposed into smaller pieces.

12. What is the usage of the Report Writer? (NOV. 2013)


The Report Writer enables to set up the report on the screen to specify how items will
be displayed or calculated.

13. What is the purpose of a class diagram? (NOV .2014)


The purpose of a class diagram is to visualize the model of the classes and
associations connected to them. It gives more information about the classes and associations.

14. What are the primary data types used in Business Applications? (NOV. 2014)
The primary data types used in Business Application are Text, Number, Date and
Time, Interval, Image, auto number.

15. What is the purpose of a feasibility study? (NOV .2015)


The purpose of a feasibility study is to analyse and evaluate a proposed project to
determine if it is technically worth with in the cost and if it is benefit or profitable in an
organization.

16. List down the advantages of DBMS. (APR .2013)


The advantages of DBMS are
Minimal Data redundancy
Data Consistency
Integration of Data
Sharing of Data
Enforcement of standards
Ease of Application Development
Uniform security, privacy and Integrity
Data Independence

17. Define class Diagrams (NOV .2015, APR .2013)


A class Diagram is a visual model of the classes and associations in an organization.
The basic features are class names (entities) in boxes and associations (relationships)
connecting them.
18. What are Events? (APR .2013)
Events are actions that are dependent on time .It is an important component of
modern data base system. Business events, Data change, user interface are the types of events
occur in a Data Base Environment.

19. Define Foreign key (APR. 2015)


A Foreign key is a field or collection of fields in one that uniquely identifies a row of
another table. The foreign key is defined in the second table but it refers to the primary key in
the first table.

20. What is meant by Table? (APR. 2016)


A Table is a collection of columns and rows that describes an entity.

21. What is a Data Base? (APR .2014)


A Data Base is collection of data stored in a standardized format, designed to be
shared by multiple users.

22. Define Entity, class and objects (APR. 2014)


Entity:
Something in the real world that you wish to describe or track is called entity.
E.g. Customer, sales
Class:
Description of an entity that includes its attributes (properties) and behaviour
(methods) is a class.
Objects:
One instance of a class with specific data is called an object of that class.

23. What is encapsulation and why it is important? (APR. 2014)


Defining properties and methods with in the class is known as encapsulation.
Encapsulation is important because it places all relevant definitions in one location and also
provides security and control features.

Question & Answers for Five marks:


1.What are the primary benefits or advantages provided by a DBMS(APR. 2014,
NOV .2015 ,10 MARKS IN NOV. 2012)
The advantages of DBMS are
Minimal Data redundancy
Data Consistency
Integration of Data
Sharing of Data
Enforcement of standards
Ease of Application Development
Uniform security, privacy and Integrity
Data Independence
Minimal Data redundancy:
DBMS stores data efficiently. If we have some rules in our database, the data will be
stored in a minimal wasted space. The data can be retrieved rapidly to answer any query.
Data Consistency:
DBMS has systems to maintain data consistency with minimal effort. Most systems
enable to create basic business rules when defining a data.
Integration of Data:
The DBMS , particularly the query language makes it easy to integrate data. With
DBMS any data can be easily retrieved , combined and compared using the query system.
Sharing of Data:
The database approach focus on data, it defines the data then all the queries, reports
and programs that access the data .

Enforcement of standards:
DBMS is responsible for efficient data storage and retrieval , concurrency and data
security.
Ease of Application Development:
Once data structure is defined , the tools like report writer, forms generator and query
language makes it faster and easier to develop business applications.
Uniform security, privacy and Integrity:
The focus on data and careful design enable database systems to avoid the problems.
Data Independence:
The separation of the data definition from the program is known as data
independence. It enables to change the data definition with out altering the program.

2.Write short notes on The Feasibility Study:(APR. 2012,APR. 2015, 2016, NOV.2014)
Need:
If the project involve critical areas within the organization , require expensive
hardware , require substantial development time the formal feasibility study is
undertaken.
Goal:
The goal of a Feasibility Study is to determine whether a proposed project is worth
pursuing.
Fundamental categories:
 Cost
 Potential benefit

Cost:

Cost is divided into


 Upfront or one time cost
 On going cost
Upfront or one time cost:
This includes in purchasing additional hardware, software and communication
equipment (eg:expand a local area network).
On going cost:
This includes the hardware and software costs for modification,replacing and
maintenance.

Benefits:

Benefits can be found in three categories


i. Cost savings
ii. Increased value
iii. Strategic advantages.

Cost Savings:
The cost can be saved by maintaining the software ,fewer errors, less data maintenance, less
user training.
Increased value
The value can be increased by better access to data,better decisions, better
communication, more timely reports, faster reaction to change,new products and services.
Strategic advantages:
The strategic advantage is occurred by locking out of competitors.

3. Describe briefly on first and second normal forms with examples(APR. 2012)
1st Normal Form
A database is in first normal form if it satisfies the following conditions:
 Contains only atomic values
 There are no repeating groups
An atomic value is a value that cannot be divided. For example, in the table shown below, the
values in the [Color] column in the first row can be divided into "red" and "green", hence
[TABLE_PRODUCT] is not in 1NF.
A repeating group means that a table contains two or more columns that are closely related.
1st Normal Form Example
Consider the following example:
This table is not in first normal form because the [Color] column can contain multiple values.
For example, the first row includes values "red" and "green."
To bring this table to first normal form, we split the table into two tables and now we have
the resulting tables:

Now first normal form is satisfied, as the columns on each table all hold just one value.
2nd Normal Form Definition
A database is in second normal form if it satisfies the following conditions:
 It is in first normal form
 All non-key attributes are fully functional dependent on the primary key
A table that is in 1st normal form and contains only a single key as the primary key is
automatically in 2nd normal form.
2nd Normal Form Example
Consider the following example:
This table has a composite primary key [Customer ID, Store ID]. The non-key attribute is
[Purchase Location]. In this case, [Purchase Location] only depends on [Store ID], which is
only part of the primary key. Therefore, this table does not satisfy second normal form.
To bring this table to second normal form, we break the table into two tables, and now we
have the following:

What we have done is to remove the partial functional dependency that we initially had.
Now, in the table [TABLE_STORE], the column [Purchase Location] is fully dependent on
the primary key of that table, which is [Store ID].

4.What is Functional Dependency?Explain 2NF(APR . 2015,NOV. 2010)


Functional dependency is a relationship that exists when one attribute uniquely
determines another attribute. If R is a relation with attributes X and Y, a functional
dependency between the attributes is represented as X->Y, which specifies Y
isfunctionally dependent on X.
2nd Normal Form Example
Consider the following example:

This table has a composite primary key [Customer ID, Store ID]. The non-key attribute is
[Purchase Location]. In this case, [Purchase Location] only depends on [Store ID], which is
only part of the primary key. Therefore, this table does not satisfy second normal form.
To bring this table to second normal form, we break the table into two tables, and now we
have the following:
What we have done is to remove the partial functional dependency that we initially had.
Now, in the table [TABLE_STORE], the column [Purchase Location] is fully dependent on
the primary key of that table, which is [Store ID].

5.Explain Associations and Relationships with examples(APR. 2013)


Associations and Relationships represent Business rules. An important step in
designing is identifying associations and relationships among entities. Entities are related to
other entities and attributes with in the entity can be related to other attributes.
There are three typed of relationships.
 One to one
 One to many
 Many to man
Unified Modelling Language refer to the association role. It uses numbers and
asterisks to indicate the multiplicity in an association.
Example:
In Customer / sale association the association and relationship can be shown as

customer 1 * sale

Here the relation shows the one to many relationship between customer and sale
tables. The asterisk(*) represents many.
* *
Employee Tasks

This shows the many to many relationship between the employee and the tasks
table.

6.Write short notes on Domain Key Normal Form(APR.2013)


In 1981 Fagin described the Domain Key Normal Form(DKNF). It gives the ultimate
goal in designing a database.
If a table is in DKNF Fagin proved it must be in 4NF,3NF and all other normal forms.
DKNF is important for application developers because it is a goal to work towards when
designing applications.
Example
Student Table Advisor Table

FID Name Office Discipline


SID Name Major Advisor
155 Hari Computer Bsc
345 akash cs Hari
160 Raja English BA
433 Banu Tamil Arun
165 Arun Tamil B.com
450 Chndru commerce Raja
This table is not in DKNF because a student
can have more than one major. So SID would not be a unique primary key. Also advisor is
related to major which is a hidden relationship.
Solution:
 Splitting the tables and makes the primary key unique.
 The hidden relationship between Major and Discipline is made explicit through a
foreign key constraint.
The spitted table will be
Student Table Advisor table Faculty Table

SID Name SID Major FID FID Name Office Discipline


345 akash 345 cs 155 155 Hari Computer Bsc
433 Banu 433 Tamil 160 160 Raja English BA
450 Chndru 450 commerce 165 165 Arun Tamil B.A
Here the primary key SID is unique and the hidden relationship is explicitly shown by the
foreign key FID. Hence the table is in DKNF.
7.Write short notes on Class diagrams (APR. 2016)
A class Diagram is a visual model of the classes and associations in an organization.
The basic features are class names (entities) in boxes and associations (relationships)
connecting them.
The properties of class name or entities are included in the boxes. The associations
or the relationships have several options.(1) The maximum number of objects that can be
related and (2) The minimum number of objects must be included.

A small class diagram for a basic order system.

Customer Salesperson
1
1 *
order
*
1
*
orderitem
1
*
Item

Here the numbers indicate the relationships. Each customer can place many orders , but a
given order can come from only one customer.

8. Discuss about various Association details(APR. 2014)


The Association details are
*N-ary Associations
*Aggregation
*Composition
*Generalization
*Reflexive Associations
N-ary Associations:
Many to many relationship between classes cause problems in the database design.
Hence many to many associations are converted into one to many associations with an N-ary
associations which include a new class.
When more than two classes are related to each other through an Assembly
Association ,the relationship is called an N-ary association and is drawn as Diamond.
Many to many relationship:

Employee

*
* *
Component product

N-ary Associations:
Employee

name
Product
Component ProductID
Assembly
Comp id Type
Type Name
Name
Assembly

EmployeeID

CompID

ProductID

Aggregation:
UML defined some special technique of association called Aggregation or Collection.
This is indicated by a small diamond on the association line next to the class that is the
aggregate. This can be shown as

Sale Item

Sale Date Description

Employee
Composition: cost
Composition is a stronger aggregate association that arise most often. In a
composition, the individual items become a new object. The individual classes are separated
and marked with a filled diamond.
Wheels
Bicycle Rims
Size
Crank
Model Type
Item id

Stem

Item id

Weight

Generalization:
Generalization is a common association that arises in business settings. This generates
a class hierarchy. The most general description is given at the top and the specific classes are
derived from it.
A small unfilled triangle is used to indicate a generalization relationship. An
important characteristics of generalization is that lower level classes inherit the properties and
methods of the classes above. It can be shown as

Animal

DateBorn

Name

Gender

Mammal
fish
Spider
Litter size
Fresh Water
Venomous
Tail Length
Scale Condition
Habitat
claws

Reflexive Associations:
A reflexive Association is a relationship from one class back to itself. It arises in
business that requires special handling. This can be shown as

manager
worker
Employee

This shows a manager is an employer who manages other workers.

9.Explain the entity relationship diagram with class(NOV. 2013)


An entity-relationship diagram (ERD) is a data modelling technique that graphically
illustrates an information system's entities and the relationships between those entities. The
major components of this diagram are
Attributes
Attributes are the properties of entities. Attributes are represented by means of
ellipses. Every ellipse represents one attribute and is directly connected to its entity
(rectangle).

Multivalued attributes are depicted by double ellipse.

Derived attributes are depicted by dashed ellipse.


Relationship
Relationships are represented by diamond-shaped box. Name of the relationship is
written inside the diamond-box. All the entities (rectangles) participating in a relationship,
are connected to it by a line.

Participation Constraints
 Total Participation − each entity is involved in the relationship. Total participation
is represented by double lines.
 Partial participation − Not all entities are involved in the relationship. Partial
participation is represented by single lines.
10. Write short notes on Data type (NOV. 2015, NOV .2012)
The data types are
*Text
*Numbers
* Date and Time
* Binary objects
* computed values
*User defined data types
Text:
Text data type is used for characters. It is limited to 255 characters.
Fixed Length Strings take up the amount of space we allocate and useful to improve in short
strings. Variable Length Strings are stored so that they take space as needed for the data.
Memo or note columns is used to hold Variable length text data. It is used for long comments
or short reports.

Numbers:
Numbers is for numeric data. It is of Integers and floating Point.
Integers cannot hold fractions and store 2 or 4 bytes of data. Floating Point include fractional
values and store 4 or 8 bytes. Most systems support long integers and double precision
floating point values.
Data and Time:
All database need a special data type for dates and time. Most system combine the
two in one domain and some provide two separate definitions.
It is stored as single numbers, and as integers that count the number of days from
some basic date.
Binary Object:
A relatively new domain is a separate category for objects or binary large objects. It
enables to store any type of object created by the computer. It can hold images and files from
other software packages.
Computed Values:
The business attributes can be computed using computing values. The UML notation
is used to proceed the name with a slash (/) and then describe the computation in a note.
User Defined Types:
We can build our own domain as a combination of existing types. Any time we want
to use the data we can pass all values to our code.
11. What are events? How they are describe in a database design? (NOV. 2011)
Events are actions that are independent of time. It is a component of modern database
systems. There are three types of events occur in a database environment.
Business events trigger some function, such as sale triggering a reduction in inventory.
Data changes events gives some alert, such as inventory that drops below a present level,
which triggers a new purchase order.
User Interface events that trigger some action .such as user clicking on an icon to send a
purchase order to a supplier.
UML provide several diagrams to illustrate events.
Collaboration diagram:
An interaction diagram that shows, for one system event described by one use case,
how a group of objects collaborate with one another. It is useful for recording business
processes and events.
Sequence diagram:
Complex user interface events can be displayed in the sequence diagrams.
Process diagram:

For complex chain of events we draw a process diagram. The combined model can be shown
as

Inventory
Order Subtract (prod, Qty sold)
Subtract
Analyse
Analyse
Ship order
Reorder (product, quantity)
Purchase

Reorder

Question & Answers for Ten marks:


1. Explain the components of DataBase Management Systems.(APR. 2014,APR.2012,
NOV. 2010,NOV. 2013,NOV. 2015,NOV.2011,NOV .2010)
The basic components of DBMS are
Data Base Engine
Data Dictionary
Query Processor
Report Writer
Forms Generator
Application Generator
Communication and Integration
Security
Data Base Engine:
It is the heart of DBMS responsible for storing ,retrieving and updating the
data. It affects the performance and handle large problems. It is responsible for
enforcing business rules regarding the data (i.e.) it will not allow any negative values.
Data Dictionary:
The Data Dictionary holds the definitions of all the data tables. It describes
the type of data being stored. It allows the DBMS to keep track of the data. It helps
developers and users to find the data they need.
Query Processor:
All database operations can be run through query language. It is necessary to
minimize the communication problem. When query runs, DBMS Query Processor works
with a database engine to find the appropriate data.
Report Writer:
The summaries of data with common format is called report. The Report Writer
enables to set up the report on the screen to specify how items will be displayed or calculated.
It also formats the data according to the report template and creates the report complete with
page numbers, headings and footers
Forms Generator:
It helps the developer to create input forms. The goal of Forms Generator is to
create forms to make it easy for users to enter data. It includes graphs and images.
Application Generator:
Application is a collection of forms and reports designed for a specific user
task. It can be small and consists few input forms and reports or they can be large,
complex systems that integrate data from several databases with hundreds of forms
and reports.
Communication and Integration:
It is designed to store and use data in several database running on different
machines, even if they are in different locations. Modern operating systems and
independent networks including internet made easier to connect databases running in
different locations.
Security:
Security is a complex issue with database running on personal computers.
DBMS is responsible for establishing and maintaining security access controls.

2. Explain about BCNF and 4 NF with examples (APR. 2013)


BCNF:
To overcome the problems in first three normal forms Codd and Boyce
defined a version called Boyce-Codd Normal Form.
Defn:
A secondary relationship between columns with in a table can cause problems
with duplication and lost data.
Example:
Employee_speciality(E#,speciality,manager)
In this example the employee can have many specialities, Each speciality has many
managers , Employee has only one manager for each speciality, and each manager has only
one speciality. The speciality in the column shows hidden dependency in the table
To solve this problem the table can be split into simple tables as
Employee(e#, manager)
Manager(manager,speciality)
In the table manager the hidden dependency is explicitly shown. Each speciality can
have manager.
Now this table is in BCNF.
Fourth Normal form:
Fourth normal form (4NF) is a level of database normalization where there are
no non-trivial multivalued dependencies other than a candidate key. 
It builds on the first three normal forms (1NF, 2NF and 3NF) and the Boyce-Codd
Normal Form (BCNF). It states that, in addition to a database meeting the
requirements of BCNF, it must not contain more than one multivalued dependency.
A relation R is in Fourth Normal Form (4NF) if and only if the following conditions
are satisfied simultaneously:

R is already in 3NF or BCNF.

If it contains no multi-valued dependencies.

Multi-Valued Dependency (MVD)

MVD is the dependency where one attribute value is potentially a 'multi-valued fact'
about another. Consider the table

                                    

In this example, 'Address' is a multi-valued fact 'Customer Name' and the converse is
also true.

For example, the attribute 'Address' takes on the two values 'New Delhi' and
'Amritsar'for the single 'Customer_Name' value 'Raj'. The attribute
'Customer_Name' takes on the values 'Raj' and 'Suneet' for the single 'address; value
'Amritsar'.
3..Describe the class diagram ,Association details.(NOV. 2014)
A class Diagram is a visual model of the classes and associations in an organization. The
basic features are class names (entities) in boxes and associations (relationships) connecting
them.
The properties of class name or entities are included in the boxes. The associations
or the relationships have several options.(1) The maximum number of objects that can be
related and (2) The minimum number of objects must be included

A small class diagram for a basic order system.

Customer Salesperson
1
1 *
order
*
1
*
orderitem

1
*
Item

Here the numbers indicate the relationships. Each customer can place many orders , but a
given order can come from only one customer.

The Association details are


*N-ary Associations
*Aggregation
*Composition
*Generalization
*Reflexive Associations
N-ary Associations:
Many to many relationship between classes cause problems in the database design.
Hence many to many associations are converted into one to many associations with an N-ary
associations which include a new class.
When more than two classes are related to each other through an Assembly
Association ,the relationship is called an N-ary association and is drawn as Diamond.
Many to many relationship:

Employee

*
* *
Component product

N-ary Associations:
Employee

name

Product
Component ProductID
Assembly
Comp id Type
Type Name
Name

Assembly

EmployeeID

CompID

ProductID

Aggregation:
UML defined some special technique of association called Aggregation or Collection.
This is indicated by a small diamond on the association line next to the class that is the
aggregate. This can be shown as

Sale Item

Sale Date Description

Employee cost
Composition:
Composition is a stronger aggregate association that arise most often. In a
composition , the individual items become a new object. The individual classes are separated
and marked with a filled diamond.
Wheels
Bicycle Rims
Size
Crank
Model Type
Item id

Stem

Item id

Weight
Generalization:
Generalization is a common association that arises in business settings. This generates
a class hierarchy. The most general description is given at the top and the specific classes are
derived from it.
A small unfilled triangle is used to indicate a generalization relationship. An
important characteristics of generalization is that lower level classes inherit the properties and
methods of the classes above. It can be shown as

Animal

DateBorn

Name

Gender

Mammal
fish
Spider
Litter size
Fresh Water
Venomous
Tail Length
Scale Condition
Habitat
claws

Reflexive Associations:
A reflexive Association is a relationship from one class back to itself. It arises in
business that requires special handling. This can be shown as
worker

Employee manager

This shows a manager is an employer who manages other workers.

5.Explain in detail about 1NF, 2NF and 3NF.(NOV. 2013)


1st Normal Form
A database is in first normal form if it satisfies the following conditions:
 Contains only atomic values
 There are no repeating groups
An atomic value is a value that cannot be divided. For example, in the table shown below, the
values in the [Color] column in the first row can be divided into "red" and "green", hence
[TABLE_PRODUCT] is not in 1NF.
A repeating group means that a table contains two or more columns that are closely related.
1st Normal Form Example
Consider the following example:

This table is not in first normal form because the [Color] column can contain multiple values.
For example, the first row includes values "red" and "green."
To bring this table to first normal form, we split the table into two tables and now we have
the resulting tables:

Now first normal form is satisfied, as the columns on each table all hold just one value.
2nd Normal Form Definition
A database is in second normal form if it satisfies the following conditions:
 It is in first normal form
 All non-key attributes are fully functional dependent on the primary key
A table that is in 1st normal form and contains only a single key as the primary key is
automatically in 2nd normal form.
2nd Normal Form Example
Consider the following example:

This table has a composite primary key [Customer ID, Store ID]. The non-key attribute is
[Purchase Location]. In this case, [Purchase Location] only depends on [Store ID], which is
only part of the primary key. Therefore, this table does not satisfy second normal form.
To bring this table to second normal form, we break the table into two tables, and now we
have the following:

What we have done is to remove the partial functional dependency that we initially had.
Now, in the table [TABLE_STORE], the column [Purchase Location] is fully dependent on
the primary key of that table, which is [Store ID].
3rd Normal Form Definition
A database is in third normal form if it satisfies the following conditions:
 It is in second normal form
 There is no transitive functional dependency
By transitive functional dependency, we mean we have the following relationships in the
table: A is functionally dependent on B, and B is functionally dependent on C. In this case, C
is transitively dependent on A via B.
3rd Normal Form Example
Consider the following example:
In the table able, [Book ID] determines [Genre ID], and [Genre ID] determines [Genre Type].
Therefore, [Book ID] determines [Genre Type] via [Genre ID] and we have transitive
functional dependency, and this structure does not satisfy third normal form.
To bring this table to third normal form, we split the table into two as follows:

Now all non-key attributes are fully functional dependent only on the primary key. In
[TABLE_BOOK], both [Genre ID] and [Price] are only dependent on [Book ID]. In
[TABLE_GENRE], [Genre Type] is only dependent on [Genre ID].
UNIT – II
PART - A
Question & Answers for Two marks:
1. What is a primary key? (APR. 2012, NOV. 2015)
A primary key is a special relational database table column (or combination of
columns) designated to uniquely identify all table records. 
A primary key’s main features are:
 It must contain a unique value for each row of data.
 It cannot contain null values.

2. Write the use of DISTINCT keyword with an example. (APR. 2012)


The SELECT DISTINCT statement is used to return only distinct (different)
values.(ie) In a table, a column may contain many duplicate values; and
sometimes we want to list the different (distinct) values.
Syntax :

SELECT DISTINCT column_name,column_name
FROM table_name;
Example :
SELECT DISTINCT BTITLE FROM BOOK;
3. What basic aggregation functions are available in the SELECT command?
(APR. 2012, APR. 2014)

Basic aggregation functions are available in the SELECT command are

MIN returns the smallest value in a given column

MAX returns the largest value in a given column

SUM returns the sum of the numeric values in a given column

AVG returns the average value of a given column

COUNT returns the total number of values in a given column

COUNT(*) returns the number of rows in a table

4. Define : Subqueries. (APR. 2012)

 A Subquery or Inner query or Nested query is a query within another SQL


query and embedded within the WHERE clause.
 A subquery is used to return data that will be used in the main query as a
condition to further restrict the data to be retrieved.
 Subqueries can be used with the SELECT, INSERT, UPDATE, and DELETE
statements along with the operators like =, <, >, >=, <=, IN, BETWEEN etc.
5. What is SQL? (NOV. 2012, NOV. 2013)
 SQL (Structured Query Language) is a standard interactive and
programming language for getting information from and updating
a database.
 Queries take the form of a command language that lets us to select, insert,
update, find out the location of data, and so forth.

6. What is a subquery and in what situations it is useful? (NOV. 2012, NOV.


2013)
 A Subquery or Inner query or Nested query is a query within another
SQL query and embedded within the WHERE clause.
Uses:
1. Finding Records
A common usage of a subquery is to find matches between two tables. 
Example :
SELECT * FROM Customer Where City IN (SELECT City FROM
ZipCodes WHERE State = ‘ID’ and Country = ‘ADA’)

2. Locating Mismatches

Another common usage for subqueries is to locate records in one table


that do not have a match in another table.

Example:

SELECT LastName, FirstName, CompanyName FROM Customer


WHERE CustomerID  NOT IN (SELECT CustomerID FROM Invoice
WHERE YEAR(OrderDate) = 2009)

7. What is the basic structure of the SQL SELECT command? (APR. 2013)
The SELECT statement is used to reteive data from a database.

Basic Structure:

SELECT <attribute 1>,<attribute 2>--<attribute n>


FROM table_name;

Example:
SELECT ISBN,Btitle FROM Book;

8. Define : DDL. (APR. 2013, APR. 2015)


A data definition language (DDL) is a computer language used for defining
data base schema and to create and modify the structure of database objects in a
database.
9. Write the purpose of the SAVEPOINT technique. (APR. 2013)
A SAVEPOINT is a point in a transaction when we can roll the transaction
back to a certain point without rolling back the entire transaction.

 Syntax:
SAVEPOINT savepoint_name;

This command serves only in the creation of a SAVEPOINT among transactional


statements. The ROLLBACK command is used to undo a group of transactions.

The syntax for rolling back to a SAVEPOINT is as follows:

ROLLBACK TO savpoint_name;

Example:

Sql>SAVEPOINT SP1;
savepoint created

10. Define : Relational algebra.( APR. 2012)


 It consists of a basic set of operations,which can be used for carrying out basic
retrieval operations.
 It uses a procedural approach by providing a step-by-step procedure for carrying
out a query.

11. What is the purpose of outer joins? (NOV. 2014,APR. 2015)


It is a type of equi-join that can be used to display all the tuples from one
relation,even if there are no corresponding tuples in the second relation,thus
preventing information loss.It is commonly used with relations having one-to-
many relationship.

12. What is view? (NOV. 2014)


A View is a virtual relation,whose contents are derived from already existing
relations and it does not exist in physical form.
It can be used like any other relation,which is, it can be queried,inserted
into,deleted from, and joined with other relations or views,though with some
limitations on update operations.
Example:
Create view Book1 as select * from Book where category in
(‘textbook’,’languagebook’);

13. Write the differences between DDL and DML. (APR. 2015)
DDL-Data Defintion Language provides commands that can be used to
create,modify and delete database objects.
DML-Data Manipulation Language provides commands that can be used to
access and manipulate the data,(ie) to retrieve, insert, delete and update data in a
database.
14. How to create a table? Give one example. (APR. 2015)
The CREATE TABLE command is used to define a new relation,its attributes
and its data types, constraints can also be specified on it.
Syntax:

CREATE TABLE table_name(<attribute 1> <datatype1> [constraint]-----


<attribute n> <datatypen>[constraint]);

Example:
CREATE TABLE Book(ISBN VARCHAR2(10) PRIMARY KEY,
Btitle VARCHAR2(15),category VARCHAR2(10));

15. Define: DML NOV-15


DML-Data Manipulation Language provides commands that can be used to
access and manipulate the data,(ie) to retrieve, insert, delete and update data in a
database.

16. What is meant by Table? APR-16


A table is a collection of related data held in a structured format within
a database. It consists of columns, and rows.

PART – B
Question & Answers for Five marks:

1. Write briefly on Query Basics with examples.(APR. 2012, NOV. 2015)

 A query is a request for information from a database. There are three general
methods for posing queries:
a) What output we want to see?
b) What constraints are given?
c) How are the tables joined?

In query basic, it is possible to sort, eliminate the duplicate tuples,condition


checking by using Boolean algebra(AND,OR,NOT) and Demorgans’ law
principle in retrival command.

Single Table:
Table consists of rows and columns. There are things to be in table.
a) What a table?
b) What conditions are given?
c) What do you want to see?

Example:

SELECT ISBN, Btitle, Price from Book;


1. Sorting (ordering tuples):
To display tuples arranged in a sorted order by using the clause ‘ORDER
BY’.In this clause, there are two keywords are used to sort the tuples.

a) ASC keyword – to arrange the tuples in ascending order.


b) DESC keyword – to arrange the tuples in descending order.

Example:

SELECT * from Book order by price ASC;

2. DISTINCT keyword:
This keyword is used to eliminate the duplicate tuples from the relation. This
command is used in SELECT command.

Example:

SELECT DISTINCT Btitle from Book;

3. Boolean Algebra:
The DBMS uses Boolean Algebra to evaluate the conditions that consists of
multiple clauses. The clauses are connected by the operators AND, OR & NOT.

Example:

SELECT * from Book where Btitle = ‘C++’ AND price >= 150;

4. De Morgan’s law:
The useful technique for simplifying the complex query by using De
Morgans’s law.

5. BETWEEN Operator:
The BETWEEN comparison operator in query basic used to simplify the
condition in where clause that specifies the numeric values based on rangers.

Example :

SELECT * from Book where price BETWEEN 150 AND 250;

2. Write Short Notes on: DDL Statements. (APR. 2012, NOV. 2012, NOV.2013,
NOV. 2014)
DDL-Data Defintion Language provides commands that can be used to
create,modify and delete database objects.  Common DDL statements are
CREATE, ALTER, and DROP.
(i) CREATE TABLE Command:
The CREATE TABLE command is used to define a new relation,its
attributes and its data types, constraints can also be specified on it.
Syntax:
CREATE TABLE table_name(<attribute 1> <datatype1> [constraint]-----
<attribute n> <datatype2>[constraint]);

Example:
CREATE TABLE Book(ISBN VARCHAR2(10) PRIMARY KEY,
Btitle VARCHAR2(15),category VARCHAR2(10));

DESCRIBE Command:
This command is used to view the structure of the table.
Syntax:

DESCRIBE <table_name> or DESC <table_name>; Example:


DESC Book;

(ii) ALTER TABLE Command:


This command is used to make changes in the structure of a relation in the
form of adding an new attribute, redefining an attribute or dropping attributes
from a relation.
1. Adding an attribute:
The new attribute can be added to the relation by using the ADD
Clause.
Syntax:

ALTER TABLE <table_name> ADD (<attribute 1> <datatype1> ---


<attribute n> <datatype n>);

Example:
ALTER TABLE Book ADD(price NUMBER(6,2));

2. Modifying an attribute:
It can be used to change either datatype or size or both.
Syntax:

ALTER TABLE <table_name> MODIFY(<attribute 1> <datatype1> ---


<attribute n> <datatype n>);

Example:
ALTER TABLE Book MODIFY(Btitle VARCHAR2(20));

3. Dropping or Deleting an attribute:


To remove an attribute from a relation, the ‘DROP COLUMN’ Clause
of Alter table is used.

Syntax:

ALTER TABLE <table_name> DROP COLUMN(<attribute>);


Example:
ALTER TABLE Book DROP COLUMN (category);

(iii) DROP TABLE Command:


This command is used to remove an existing relation.
Syntax:

DROP TABLE <table_name>;

Example:
DROP TABLE Book;

All the tuples stored in ‘Book’ relation is permanently removed and cannot be
recovered.

Clauses available in DROP TABLE command:


a. CASCADE --- If CASCADE clause is used, all constraints and views that
reference the relation to be removed are also dropped automatically.

Example:
DROP TABLE Book CASCADE;

b. RESTRICT---It prevents a relation to be dropped if it is referenced by any of


the constraints or views.

Example:
DROP TABLE Book RESTRICT;

3. What are SQL DML statements? Explain with examples. (APR. 2012, APR.
2014)
DML-Data Manipulation Language provides commands that can be used to
access and manipulate the data,(ie) to retrieve, insert, delete and update data in a
database.
(i) INSERT Commnd:
This command adds a single tuple at a time in a relation.
Syntax:

INSERT INTO <table_name> VALUES (<attribute list>;

Example:
INSERT INTO Book values(‘&ISBN’,’&Btile’,&price);
(or)
INSERT INTO Book values(‘001-987-760-9’,’DBMS’,100);

(ii)DELETE Command:
This command is used to remove tuples, which are no required as a part of a
relation. Tuples can be deleted from only one relation at a time.
Syntax:
DELETE FROM <table_name> [WHERE
Clause];

The WHERE Clause is used to specify the tuples to be deleted.If the WHERE
Clause is omitted, all the tuples of a relation are deleted.

Example:
DELETE FROM Book WHERE Btitle=’C++’;

(iii) UPDATE Command:


This command is used to make changes in the values of attributes of the
relation.
Syntax:

UPDATE <table_name> SET (<attribute> = New_value


[WHERE Clause];

Here ‘SET Clause’ -- specifies the attributes to be modified and the new values to
be assigned to them.
‘WHERE Clause’ – Specify the tuples for which the attributes are to be
modified otherwise all the tuples in the relation will be modified.

Example:
UPDATE Book SET price=price + 0.10 * price where Btitle = ‘DBMS’;

(iv) SELECT Command:


The SELECT statement is used to reteive data from a database.

Syntax:

SELECT <attribute 1>,<attribute 2>--<attribute


n> FROM table_name;

Example:
SELECT ISBN,Btitle,price FROM Book;
(or)
SELECT * FROM Book;
Here * denote ‘all attributes of the relation’ has to be retrieved.

4. Discuss about subtotals and GROUP BY statement in SQL.(NOV. 2014, APR.


2015)
The GROUP BY clause used in SELECT command divides the relation into
groups on the basis of values of 1 or more attributes. After dividing the relation
into groups, the aggregate function can be applied on the individual group
independently. That is, each subtotal can be calculated independently.

Example :
The command to calculate the average price for each category of Book in the
book relation can be specified as

SELECT AVG (price) from Book GROUP BY category;

HAVING clause
Conditions can also be placed on groups using HAVING clause. More than
one condition can be specified in this clause using logical operators.

Example:
The command to retrieve the book categories for which the number of books
published is less than 5 can be specified as

SELECT category, COUNT (*) from Book GROUP BY category HAVING


COUNT (*) < 5;

5. Write a note on aggregation operators.(APR. 2015)


Aggregate functions set of values taken as input and return a single value as a
result of SQL provides five built-in aggregate functions, namely AVG, MIN,
MAX,SUM and COUNT.

The SUM and AVG functions works for numeric values only, whereas other
functions can work for numeric as well as non-numeric values, like strings, date,
time etc.

Basic aggregation functions are available in the SELECT command are

MIN returns the smallest value in a given column

MAX returns the largest value in a given column

SUM returns the sum of the numeric values in a given column

AVG returns the average value of a given column

COUNT returns the total number of values in a given column

COUNT(*) returns the number of rows in a table

Example 1: To find the average price of only text books, the command can be
specified as

SELECT AVG (PRICE) FROM BOOK WHERE CATEGORY = ‘Text Book’;

Example 2: To find the maximum price of book belonging to the Novel category,
the command can be specified as
SELECT MAX (PRICE) FROM BOOK WHERE CATEGORY = ‘Novel’;

COUNT(*) function : It is used to count the total number of tuples in the


resultant relation, whereas COUNT() is used to count the number of non-null
values in a particular attribute.
Example 3: To find the number of tuples in the relation Book, the command can
be specified as

SELECT COUNT (*) FROM


BOOK

Example 4: To find non-null values in the particular attribute (Btitle), the


command can be specified as

SELECT COUNT (Btitle) FROM BOOK

Example 5: To find the number of non-null values in the attribute (Btitle), in duplicate values
are to be eliminated, the DISTINCT keyword can be used and the command can be specified
as

SELECT COUNT (Distinct Btitle) FROM BOOK

PART - C
Question & Answers for Ten marks:
1. Explain the computation using queries with suitable examples. (NOV. 2012,
NOV. 2013, APR. 2016)
The SELECT command can be used to perform numeric, arithmetic and
aggregate operations to compute the data stored in a relation.
Example for arithmetic operation:

SELECT ISBN, Btitle, price+price*0.10 from Book;

Moreover complex computation can also be done using Relation Operators

(=, < >, ≤, ≥) and Logical operators (AND, OR NOT) with the help of
WHERE clause command.
Example :

SELECT * from Book where Btitle = ‘C++’ AND price ≥ 150;

Aggregate operations:
Basic aggregation functions are available in the SELECT command are
MIN returns the smallest value in a given column

MAX returns the largest value in a given column

SUM returns the sum of the numeric values in a given column

AVG returns the average value of a given column

COUNT returns the total number of values in a given column

COUNT(*) returns the number of rows in a table

Example 1: To find the average price of only text books, the command can be
specified as

SELECT AVG (PRICE) FROM BOOK WHERE CATEGORY = ‘Text Book’;

Example 2: To find the maximum price of book belonging to the Novel category,
the command can be specified as

SELECT MAX (PRICE) FROM BOOK WHERE CATEGORY = ‘Novel’;

Example 3: To find the number of non-null values in the attribute (Btitle), in


duplicate values are to be eliminated, the DISTINCT keyword can be used and the
command can specified as

SELECT COUNT (Distinct Btitle) FROM


BOOK;

2. Explain about the sub queries in detail. (APR. 2015)


 The query defined in the ‘WHERE’ clause with another query is
known as Nested query or sub query.The query in which another query
is nested is known as ‘enclosing query’.
 The result returned by the subquery is used by the enclosing query for
specifying the conditions. Several levels of nested queries can be
defined.Query can be defined inside another query number of times.

Example :
The command to retrieve ISBN Btitle and catergory of book with minimum price
can be specified as
SELECT ISBN, Btitle, category from Book WHERE price = (SELECT min(price)
from Book;
Operators in subqueries:
SQL provides four useful operators that are generally used with
subqueries. They are
1. ANY 2. ALL 3. EXISTS . 4. IN
1. ANY operator:
It compares a value with any of the values in a list or returned by the
subquery. This operator returns false value if the subquery returns no tuple.
Example:
The command to retrieve detals of books with price equal to any of the books
belonging to ‘Novel’ category as
SELECT ISBN, Btitle, price from Book WHERE price = Any (SELECT price
from Book WHERE category = ‘Novel’);

2. IN operator:
It can be used to compare a single value to the set of multiple values.
Example:
The command to retrieve the data of books belonging to category with page count
> 300 as
SELECT * from Book WHERE category IN (SELECT category from Book
WHERE pagecount >300);

3. ALL operator:
It compares a value to every value in a list returned by the subquery.
The command to retrieve details of books with price > the price of all the books
belonging to ‘Textbook’ category.
SELECT ISBN, Btitle, price form Book WHERE price > ALL (SELECT price
from Book WHERE category = ‘Textbook’);

4. EXIT operator:
It evaluates to true if a subquery returns at least one tuple as a result
otherwise it returns false value.
Examplle:
The command to retrieve the details of publishers having at least one book
published as

SELECT PID, Pname, address from publisher WHERE exists (SELECT * from
Book WHERE Publisher. PID = Book.PID);
3. Explain various Joins with examples. (NOV. 2015, APR. 2014, APR. 2016)
The join operation is one of the most useful and commonly used operations to
extract information from two or more relations. There are four types of joins.
They are

1. Equi-join query (Inner join)


2. Natural join query
3. Outer join
4. Reflexive join (Self join)

1. Equi-Join query:

The join query in which tuples are concatenated on the basis of the equality
condition is known as Equi-join.

Example:

To retrieve details of both book and publishers, where PID attribute in both the
relations has identical values can be specified as

SELECT * from Book, publisher where Book. PID = publishr. PID;

The resultant relation of this query consists of two columns for the attribute PID
having identical values from ‘Book” and publisher.

Drawback of this query:

The attribute PID will be displayed two times (Repetition).


2. Natural Join query:
Specifying the attribute in only one column, we use natural join query. In
addition, some additional conditions can also be given apart from the join condition
to make the solution of tuples most specific.
Example:
SELECT ISBN, Btitle, price, B.PID from Book As B, publisher AS P where B.PID
= P.PID;

3. Outer Join query:


It is a type of equi-join that can be used to display all the tuples from one
relation,even if there are no corresponding tuples in the second relation,thus
preventing information loss.It is commonly used with relations having one-to-
many relationship. There are three types of outer join.
a. Left outer join
b. Right outer join
c. Full outer join
a. Left outer join:
The LEFT JOIN keyword returns all rows from the left table (table1),
with the matching rows in the right table (table2). The result is NULL in
the right side when there is no match.
Example:

SELECT * from Book Left join Publisher on Book.ISBN=Publisher.ISBN


WHERE (Publisher.ISBN IS NULL);

b. Right outer join:


The RIGHT JOIN keyword returns all rows from the right table
(table2), with the matching rows in the left table (table1). The result is
NULL in the left side when there is no match.
Example:

SELECT * from Publisher Right join Book on Publisher.ISBN


=Book.ISBN WHERE (Publisher.ISBN IS NULL);

c. Full outer join:


The FULL OUTER JOIN keyword returns all rows from the left table
(table1) and from the right table (table2).
Example:

SELECT * from Book Full outer join Publisher on


Book.ISBN=Publisher.ISBN WHERE (Publisher.ISBN IS NULL);

4. Reflexive join:(Self join)


It means that a table is joined to itself. The self join can be viewed as a join of
two copies of the same table.
Example:
Consider an Employee table with the attributes EID,Ename,Manager
SELECT Employee.EID,Employee.Ename,Employee.Mananger,E1.Ename
from Employee INNER JOIN Employee AS E2 on
Employee.Manager=E2.EID;

4. Describe in detail, Queries with Multiple tables with examples. (APR.


2013, APR. 2016)
Queries can incorporate fields from two different tables. The easiest
way is to join the tables by selecting a common column in the tables.(ie) When
two or more tables have a key field in common, we can combine them by using
an Inner Join between the tables.This is also called Equi-Join.

Joining tables:
The Inner Join operation combines two tables using a key field,they
have in common.
Example :
Consider two relational schemas and its attributes list,
Customer{CID,Cname} & Order{CID,EID}

SELECT Customer.Cname,Order.EID from Customer INNER


JOIN Order on Customer.CID=Order.CID;
Joining Multiple tables:
Identify column in different tables:
SQL find the same column in different tables to join.Make use of that
common column,we can easily join the tables.Each table will be added one
another through the data column.

Example:
Let us consider the 4 relational schemas to be join.
The 4 relational schemas are Animal,SaleAnimal,Sale and Customer and its
attributes are
Animal{AID,name,category}
SaleAnimal{SID,AID,saleprice}
Sale{SID,saledate,EID,CID}
Customer{CID,phone,Fname,Lname}

SELECT DISTINCT Customer.Lname,Customer.phone from Customer


INNER JOIN (Sale INNER JOIN (Animal INNER JOIN SaleAnimal on
Animale.AID=SaleAnimal.AID) ON Sale.SID=SaleAnimal.SID) on
Customer.CID=Sale.CID where (Animal.category=’cat’) AND
(Animal.Registered is not Null) AND (color like ‘%white%’) AND (saledate
between ’01-may-2016’ AND ’30-JUL-2016’));

UNIT III
Question & Answers for Two marks:
1.What are the basic properties for forms? (APR.2012,2014)
Data : the first category (data) relates to the source of data
Integrity : a second set of properties refers to data integrity Format: the third level of
properties controls the display of the form
Other properties: popup menus, menu bar, help

2.What are the primary form types? (APR. 2012)

● Tabular forms
● Single row forms
● Sub forms
● Switchboard form
3.List the basic human factors design elements (APR. 2013)
There are some basic human factors design elements that system designers should
incorporate in their applications. They are

● User control
● Consistency
● Clarity
● Aesthetics
● Feedback
● Forgiveness

4.What are tabular forms(APR. 2013)

● Tabular forms, which displays data in rows and columns


● It can be used as a subform and is rarely used as a stand alone form
● In subforms , they collect and display a limited list of data that is related to the main
form
The main feature of tabular form is that it displays multiple rows of data for editing

5.List the primary sections of reports(APR. 2013, NOV. 2012)

● Tabular report
● Label report
● Groups and subtotal
● Labels and graphs

6.List the various report layout elements (APR. 2014)


Report layout choices
● Tabular

● Columns/subgroups
● Charts/graphs

7.What is subform? (APR. 2015)

● Subform which displays data from two tables that have a onetomany relationship
● A subform is usually a tabular form embedded on the form
● The main form muat be a single row form, and the subform should be a tabular view
8.Write down the primary functions for error handling (APR. 2015)
When you create execute a PL/SQL, there are lots of chances to get an error. Sp, as a good
PL/SQL developer we have those error to avoid the termination of the PL/SQL program.
This technique is called exception handling.

9.What are graphical objects? (APR. 2016)

● Graphs on report are similar to graphs on forms


● The first step in creating a graph on reports is to decide with the user what type of
graph will best illustrate the data
The second step is to determine where the graph should be positioned within the
report elements

10.Define switchboard forms (APR. 2016)

● Switchboard forms or menus which direct the user to other forms and reports in the
application
● Switchboard or menu forms provide the overall structure to an application
● The switchboard form often contains images , and the design reflects the style of the
company

12.What is the purpose of sub forms? (NOV. 2012)

● Most database system enables to create forms that have multiple subforms
● The subforms can be either independent as separate boxes on the main form or nested
where each subform lies inside other
● Subform contents are linked to the main form through a common column.

13.What are the main report types? (NOV. 2012)


Main report types are

● Tabular report
● Label report
● Groups or subtotals
● Graphs

13.Define procedural languages(NOV. 2012)

● Procedural language is the generic term used for a traditional programming language.
● It specifies the sequence of a set of commands
● Every procedural language contains its own set of elements
14. What are the basic form types (Nov2012)
Four basic types of forms are
Tabular forms

● Single row forms


● Subform forms
● Switchboard forms

15.State the various controls on forms (NOV. 2014)

● Common controls include simple text labels, text boxes for data entry, option buttons,
pictures and list boxes.

16.why would you need to use procedural code when SQL is so powerful? (Nov2014)
PL/SQL is used when we required some procedural features like conditional statements
or iteration loop for processing. In PL/SQL we can retrieve data from tables using select
statement and apply it into some variables. When we are using PL/SQL for writing codes in
SQL forms we cannot use DDL statement luke create table, create view etc….

17. What are reports? (NOV.2015)


Report is a summarization of data. Examples of reports are : invoices, weekly sales
summaries, mailing bills,pie chart, etc….
The two main strengths of a report are that

● It can handle multiple pages of output


● It can combine both detailed and summary data

PART-B
Question & Answers for Five marks:
1. Write short notes on procedural languages?(APR. 2016,-2012)
PROCEDURAL LANGUAGE
Procedural language is the generic term used for a traditional programming
language.it specifies the sequence of a set of commands. Every procedural language
contains its own set of elements.
Programming contains two basic components,
 logic
programming logic explains the way in which the problem is solved on the structure of
the program.
 syntax
syntax refers to the commands and features in the programming language.
variables, computations, standard functions, debug, output, input, loops and arrays.
PL/SQL
PL/SQL is used when we required some procedural features like conditional statement or
iteration loop for processing. In PL/SQL we can retrieve data from tables using select
statement and apply it into some variables. When we are using PL/SQL for writing codes in
SQL forms, we cannot use DDL statement like , create view, create table etc…
Structure of PL/SQL
Syntax:
Declare
<declaration section>
Begin
<body of the program(execution part)>
End
Declare variables
Syntax to declare variables,
< var -name><var type>

Example
We required a variable to store the student mark, in this case we can declare a variable
named student_ mark as numeric variable.
Here is the syntax,
Student_ mark number;
Initializing variable
When you declare a variable you can do initialize it with default value like below,
Declare

In some cases we may require a variable’s data type same as what we have in the table. In
that case we can declare a variable using % type like below
Example
<variable name ><table name ><column name> % type;
Declare
Student_ name tbl student. Name% type;
Syntax to execute the PL/SQL
Sql> @filename
Conditional statement
Like any other programming language we have conditional statement
On PL/SQL also to make some decision based on the conditions,
If<condition>then
<true section>
Else
<false section>
End if

Without else part, the if statement is written as,


If<condition>then
<true section>
End if
Iterative statement
In PL/SQL, iteration loop can be implemented using while loop.
Syntax
While<condition>loop
<statement to execute>
End loop;
The statement in <statement to execute> part is executed until the condition is
evaluated to true
Example
Declare
I number;
Begin
I=1;
While (i>10)loop
Print I;
I=i+1
End loop;
End;
The print statement will execute 10 times and each time will print the value of i.

2. Discuss briefly on creating forms with examples. (APR. 2013)


CREATING FORMS
The first step in creating form is that the user should understand its purpose and how
it will be used. Its usage dictates the specific data that needs to be displayed then, identify the
data base tables that holds the data. A form should only attempt to update data to one table at
a time.
Suppose If the data needs to be stored in four related tables, one should use the multiple
linked forms or by creating sections within a form, where each sections can hold data for a
new linked table,
One of these sections could be a sub form that contains repeating rows of data linked to the
main form. Updatable queries are used to display data from multiple tables.
UPDATABLE QUERIES
The issue of multiple table on a form is related to the problem of updateable queries. If a
system can support queries that use multiple tables as updateable, then it is possible to select
columns from tables on a single form.
LINKED FORMS
Linked forms work by using a query to match the data displayed in the secondary form to a
key value from the original form. For instance, from the main sale order form, the customer
ID can be used to display the matching customer data in a linked form. Similarly, a sale item
subform can display the rows that match the sale ID from the main form. Each related portion
of the data can be displayed in a separate form or region.
Properties of forms
Data: the first category (data) relates to the source of the data
 base table/query
 filters
 sort
Integrity :
a second set of properties refers to data integrity.
 Edits
 Additions
 Deletions
 Locks
Format
The third level of properties controls the display of the form
 Caption
 Scrollbars
 Record selections
 Navigation buttons
 Size and centering
 Background/ pictures
 Colors
 Tab order
Other properties
 Pop-up menus
 Menu bar
 help
controls on forms
forms are built with controls. Controls consists of any object placed on a form. Common
controls include simple text boxes for data entry, text labels, option buttons, pictures and list
boxes

3. Explain error handling with examples.(APR. 2013)


Exception handling
When you execute a PL/SQL, there are lots of chances to get an error. So, as good PL/SQL
developer we have to handle those errors to avoid those errors to avoid the termination of the
PL/SQL program. Tis technique is called exception handling.
Declare
Stu_ mark1 number tblstudent. Mark % type;
Stu_ mark2 number tblstudent. Mark % type;
Stu_ total_ mark number=0;
Stu_ avg number=0;
Begin
Select mark1 into stu_ mark1 frim tblstudent where name=’yugha’;
Select mark1 into stu_ mark1 frim tblstudent where name=’yugha’;
Stu_ total_ mark=stu_ mark1+stu_ mark2;
Stu_ avg =stu_ total_ mark/100;
Print stu_ avg;
Exception
When ZERO_ DIVIDE then
Print(trying to divide by zero);
End;
This is an exception handler for divide by zero. These are predefined exception or built-in
exception. Same as we have many built in exceptions are available in oracle, SQL server and
tera data…..etc.
In some cases we may require our own exceptions to handle some special conditions for our
business requirements. That is also possible in PL/SQL. It is called custom exceptions or
user defined exceptions.
Example for user defined exception
Declare
Stu_ mark1 number tbl student.mark1% type;

Begin
Select mark1 into stu mark1 from tblname where name=’yogha’;
If(stu_ mark1>100 or stu_ mark<0)then
Raise upper_ limit then
Print(‘invalid mark_ mark should be between 0 to 100’);
end;
when a user defined exception is used in a program, t should be declared at a declared
section. Since upper limit is a user defined exception we have to indicate to the PL/SQL
compiler, when it has to be raised. This is done using the statement,
raise upper_ limit
4.Explain any three controls on form.(APR. 2013)
Labels controls and text boxes
 The label is plain text that cannot be changed directly by the user.
 Label box creates a field for displaying text. These labels are only for displaying
predefined text. Entries cannot be made in these fields
 The text box is used to display data from the data base and to enter the new values.
 Text boxes are fields in which the user can enter text. in a form, text boxes displays
data or allow for new data input.
 A control that retrieves and stores data in a table is called a bound control because
any data that is changed is automatically stored in the table
Command button
 Command buttons have only one function: when the user clicks, an event will be
triggered and some actions will be performed.
 Printing a report or running a custom program’
 Command button are the main components of switch board forms, where they are
used to open related forms
Check boxes and option buttons:
 These controls enable users to select from choice of options.
 The option button group was designed for mutually exclusive choices
 Option button is used to select only one choice out of several choices
 It is denoted by
 Check boxes are used during multiple selections.
 It is used to select two or more choices out of several choices

4. Discuss briefly on form layouts ?( NOV. 2012)


Form layouts
Forms are used to collect data, display results and organize the overall system. Examples for
forms are business forms, electronic spreadsheet, ATM transaction layout, etc,
Four basic types of forms are,
 Tabular forms
 Single row forms
 Sub forms
 Switchboard forms
Tabular forms
 Tabular forms which displays data in rows and columns
 It can be read as a sub form and is already read as a stand alone form
 In subform they collect display a limited list of data that is related to the main form
 The main feature of tabular form is that it displays multiple rows of data for editing

Single row or columnar forms


 A single row forms displays data for one row at a time
 The goal is to display every column
 The designer can also use graphics, color, and command button to make the form
easier to use
 The single row form is generally the most used form layout
Sub form
 Subform which displays data from tables that have a one to many relationship
 A sub form is usually a tabular form embedded on the main form
 The main form must be single row form and the sub form should be a tabular view
 Most database system enables to create forms that have multiple sub forms
Switchboard forms
 Switch board forms or menus which direct the user to other forms and reports in the
application
 Switchboard or menu forms provide the overall structure to an application
 The forms should match the user tasks

6.How to enter data on forms using controls?(Apr. 2015)


Data on forms
When we need to enter data into database or display data from database we required
forms to be created by using predefined or user defined controls. These controls represents
different types of data.
Example
 Rows and column structured data displayed in grid controls
 Gender type data display in drop down box / radio button, so user choose any one
value at a time
Also, some controls may display calculated data which are not there in the database tables
Example
It is not necessary to maintain the student total marks in database tables. Because we
can calculate it at any time from mark_1, mark_ 2 , …………. mark_ n
Total mark=mark_1 + mark_2 …..+mark_n;
To make a program easy to understand , we have to use a naming convention to and
variables and controls, naming conventions provide guidelines how to name each object
In the database.so that other programmer identifies the purpose and use of the object.
The text box that displays student name could be named as txtstudent_ name
Then the other programmer would automatically know that it is a control box and result
will be display automatically on the form.
Control properties
 The use of code on forms is ability to set the property of the control on the form
 The aim is to help the user deal with the form by alternating properties in
responds to events
 The controls and forms have many properties and all of them are set using codes
 The controls and forms also have defined methods the methods or functions
which can be called to perform pre defined operatins
 The common methods are set focus, undo and requery
 The set focus methods give the specified form or controls the focus(setting cursor
point)
 The requery method is another useful function which gives focus a form or
control to get update

7. Explain the human factors design elements for effective design of reports and forms?
(Nov. 2014)
There are some human factor design elements that system designers should transport in their
applications. They are,
User control
With current operating systems, the primary factor is that the users not the programmer and
not the application should always have control. For example do not expect users to enter data
in a particular sequence.
responds to the events or triggers by performing calculations, retrieving or storing data, and
offering new choices. Whenever possible, provide options for user customization,
Examples: changing the display features such as color, typeface, or size
Consistency
To ensure consistency, there are two factors
 At the beginning of the application establish a design standard and basic template for
all designers to use
 Toward the end of the application development always go back and check for
consistency
Clarity
Clarity means keeping the application simple and well organized. If the application has
multiple forms and reports organize them according to user tasks. It helps to have a clear
purpose for an application and to make sure the design enhances that purpose. Use precise
terminology, avoid jargon and stick with terms that are used within the organization.
Aesthetics
The goal is to use color and design to enhance the forms and reports’
Feedback
Uses of feedback include accepting input, acknowledging changes of data, highliting
completion of a task, or signifying the start or completion of some event
Forgiveness
Designers should provide the users with the possibility of,
 Anticipation and corrections of errors and confirmation of deletions and updates
 Backup and recovery of data

8. How to handle unexpected errors. Explain?(Nov. 2013)


Exception handling
When you execute a PL/SQL, there are lots of chances to get an error. So, as good PL/SQL
developer we have to handle those errors to avoid those errors to avoid the termination of the
PL/SQL program. Tis technique is called exception handling.
Declare
Stu_ mark1 number tblstudent. Mark % type;
Stu_ mark2 number tblstudent. Mark % type;
Stu_ total_ mark number=0;
Stu_ avg number=0;
Begin
Select mark1 into stu_ mark1 frim tblstudent where name=’yugha’;
Select mark1 into stu_ mark1 frim tblstudent where name=’yugha’;
Stu_ total_ mark=stu_ mark1+stu_ mark2;
Stu_ avg =stu_ total_ mark/100;
Print stu_ avg;
Exception
When ZERO_ DIVIDE then
Print(trying to divide by zero);
End;
This is an exception handler for divide by zero. These are predefined exception or built-in
exception. Same as we have many built in exceptions are available in oracle, SQL server and
tera data…..etc.
In some cases we may require our own exceptions to handle some special conditions for our
business requirements. That is also possible in PL/SQL. It is called custom exceptions or
user defined exceptions.
Example for user defined exception
Declare
Stu_ mark1 number tbl student.mark1% type;
Begin
Select mark1 into stu mark1 from tblname where name=’yogha’;
If(stu_ mark1>100 or stu_ mark<0)then
Raise upper_ limit then
Print(‘invalid mark_ mark should be between 0 to 100’);
end;
when a user defined exception is used in a program, t should be declared at a declared
section. Since upper limit is a user defined exception we have to indicate to the PL/SQL
compiler, when it has to be raised. This is done using the statement,
raise upper_ limit
PART-C
Question & Answers for Ten marks:

1. Explain about programs to save and retrieve data with example(APR.


2015,2016,-2012)
Three common situations where SQL is used within procedural languages are,
 Updation of data
 Insertion of data
 Deletion of data
Updation of data
The database is updated by collecting information and changing the values in the table. SQL
update command is used to update the values from forms to database tables.
Insertion of data
When we required a new record to be stored in database tables we have to use insert
statements
Examples
New row to be entered in table,when a new student joined a new college
Deletion of data
Delete command deletes the record from database table. Based on the where clause
condition it will delete one or more record from the table
Data access object (DAO)
Data access control is a special control. It bridges connectivity between application and
database. Without these controls application cannot talk with database. To bridge a
connection , we must pass some set of arguments as connections string to builtin method
called “connection”
Example
Database path and name, driver detail, user id, password etc
 The cursor is used to highlight a row at a time
 The active rows column values can be change on inserted
 The query can be started at the top and more until the end of the record is reached
 In DBMS the cursors are used differently
 Each object as its own property and methods that are used to define the query and
operations in the query
 Cursor operations does not consider the properties
 Common commands are defined within the record set objects
 The record set is opened using open record set method of the object
 We can use various modes like read, write and update
 The cursor moves in forward direction only
 There are various command used to move cursors
The common commands are used in movements cursors are,
 Move next
 Move first
 Move previous
 Move last options
Record searching
In real time situation we may require to fetch an employee detail from millions of records. In
that case move next / first options are not useful. So we need some special techniques to find
the records. For that DAO control giving two features. They are
 Find
 Seek
Find command
find command has four options. Such as,
 Find first
 Find next
 Find last
 Find previous
These commands are very easy to use , but it will be very slow because it uses sequential
techniques to search the records
Seek command
 Seek command is efficient and faster
 The seek command used with the record set as index
 To find a specific row we can use seek command and coparison operand with the
value
The data control can do the following tasks
1. Connect to a database
2. Open a specified database table
3. Create a virtual table used on a database query
4. Pass database fields to other visual basic tools, for display or editing. Such tools are
bound to the database or data bound controls
5. Add new records, delete records or update records
6. Trap any error that may occurs while accessing data
7. Close the database
As a rule, you need one data control for every database table. One row of the table is
accessible to each data control at any time. This is referred to the current record when a
DAO data control is placed on a form,it appears with assigned caption and foyr arrow
buttons.
The arrows are used to navigate the table records. As indicated, the buttons
can be used to move to the beginning of the table, the end of the table, or from record to
record. In most applications, the data control never appears on the form –its visible
property is always false

2. Discuss about report design?


Fundamentals of report design
Report design determines the contents and layouts with users. Estimates size and printing
times, identify security controls and check typefaces and sizing for user readability.
 Report layout choices
Tabular
Columns
Charts/graphs
Basic report types
Report types are based on the type of data and use of the report. There are four types of
reports designs: tabular ,groups or sub totals, labels and graphs
Tabular reports
 Tabular reports have few options but are good for detailed data listings
 These data reports are used for itemized listing of data
 They are used for printing columns of data, like the output of the query
 They are generally used for detailed item listing,such as inventory reports
 Tabular report can print page headings and page numbers on every page
Label reports
 In alabel report all output for one row of data is printed in one column on the page.
Then the next row is printed in the following column
 The name of the label report comes from the use of preprinted or precut pages used
for labels
 These reports sometimes based on the number of physical columns
 Label reports are also used to group data for one row into separate location on a page
Groups or subtotals
 The most common type of report based on groups and computes subtotals
 It also provides the most flexibility over layout of the items on the reports
 Subtotal report includes both detail item listings and group or total data
 Grouped reports are easily created by using the basic elements of a report
 Group reports are generally used for computations. Computations for one row of data
are performed with a query and aggregation such as sum are performed using the
report writer
Graphs

● Graphs on report are similar to graphs on forms


● The first step in creating a graph on reports is to decide with the user what type of
graph will best illustrate the data
● The second step is to determine where the graph should be positioned within
the report elements
● If we are graphing detailed items then the graph belongs to the detail section
● If it is summary graph it belongs in group footer or in the report footer if it
summarizes data across the entire report
● When the type and location of the graph is determined build a query to collect
the data
● The totals for the graphs are computed by a separate query

3. Explain creating forms with example? (NOV. 2012)


Creating forms
The first step in creating a form is that the user should understand its purpose and how it
will be used. Its usage dictates the specific data that needs to be displayed then, identify
the database tables that hold that data. A form should only attempt to update to update
one table at a time
Suppose if the data needs to be stored in four related tables , one should use the
multiple linked forms, where each section can hold data for a new linked table
One of these sections could be a subform that contains repeating rows of data linked to
the main form. Updatable queries are used to display data from multiple tables
Updatable queries
The issue of multiple tables on a form is related to the problem of updatable queries. If a
system can support queries that use multiple tables as updatable, then it is possible to select
columns for multiple tables on a single form
Linked forms
Linked forms work by using a query to match the data displayed in the secondary form to
a key value from the original form. For instance, from the main scale order from the customer
id can be used to display the matching customer data in a linked form. Similarly, a sale item
subform can display the rows that match the sale id from the main form. Each related portion
of the data can be displayed in a separate form or region
Properties of form
Data : the first category (data) relates to the source of data

● Base table/query
● Filters
● sort
Integrity : a second set of properties refers to data integrity

● edits
● additions,deletions
● locks
Format: the third level of properties controls the display of the form

● captions
● scrpll bars
● record selections
● navigation buttons
● size and centering
● background pictures
● colors
● tab order

Other properties: popup menus, menu bar, help


controls on forms
forms are built with controls. Controls consists of any object placed on a form. Common
controls include simple text boxes for data entry, text labels, option buttons, pictures and list
boxes
Labels controls and text boxes
 The label is plain text that cannot be changed directly by the user.
 Label box creates a field for displaying text. These labels are only for
displaying predefined text. Entries cannot be made in these fields
 The text box is used to display data from the data base and to enter the new
values.
 Text boxes are fields in which the user can enter text. in a form, text boxes
displays data or allow for new data input.
 A control that retrieves and stores data in a table is called a bound control
because any data that is changed is automatically stored in the table
Command button
 Command buttons have only one function: when the user clicks, an event will be
triggered and some actions will be performed.
 Printing a report or running a custom program’
 Command button are the main components of switch board forms, where they are
used to open related forms
Check boxes and option buttons:
 These controls enable users to select from choice of options.
 The option button group was designed for mutually exclusive choices
 Option button is used to select only one choice out of several choices
 It is denoted by
 Check boxes are used during multiple selections.
 It is used to select two or more choices out of several choices

Graphical features
lines and boxes are often used to create a three dimensional effect for other controls by
adding shadding or highlighting
graphics pachage is used to display image or texture as background in the database
column, then set the picture property of the form to the name of the image file
combo and list boxes
the combo box and list box are usefuk controls in most database applications.
The purpose of these controls is to display a list of items from which the user can choose one
value
Combo box is a combination of drop down or list box.
List box allows the user to select one or more items from a list combined with a
static,multiple line text box
The user clicks inside the box on an item to select it, sometimes in combination with the
shift key or control key in order to make multiple selections
Charts
Charts are also one of the type of control that can be placed on a forms or reports
The first step in creating the chart is to understand with the user exactly what type of data and
what type of chart will be needed. Then build a new sql query that collect the data to be
displayed on the chart
The chart control places the chart on the form and specifices the individual attributes
like type of chart, axis, scale, and colors
Two basic type of chart are used on database forms and reports

● Groups that show detail from the currently displayed row


● Groups that display summary data across all of the rows
The difference between the two approaches like in the level of the data displayed. Summary
graphs are usually generated from totals or average.

4.What are the common controls to build a form? Explain.(NOV-2013)


controls on forms
forms are built with controls. Controls consists of any object placed on a form. Common
controls include simple text boxes for data entry, text labels, option buttons, pictures and list
boxes
Labels controls and text boxes
 The label is plain text that cannot be changed directly by the user.
 Label box creates a field for displaying text. These labels are only for
displaying predefined text. Entries cannot be made in these fields
 The text box is used to display data from the data base and to enter the new
values.
 Text boxes are fields in which the user can enter text. in a form, text boxes
displays data or allow for new data input.
 A control that retrieves and stores data in a table is called a bound control
because any data that is changed is automatically stored in the table
Command button
 Command buttons have only one function: when the user clicks, an event will be
triggered and some actions will be performed.
 Printing a report or running a custom program’
 Command button are the main components of switch board forms, where they are
used to open related forms
Check boxes and option buttons:
 These controls enable users to select from choice of options.
 The option button group was designed for mutually exclusive choices
 Option button is used to select only one choice out of several choices
 It is denoted by
 Check boxes are used during multiple selections.
 It is used to select two or more choices out of several choices
Graphical features
lines and boxes are often used to create a three dimensional effect for other controls by
adding shadding or highlighting
graphics pachage is used to display image or texture as background in the database
column, then set the picture property of the form to the name of the image file
combo and list boxes
the combo box and list box are usefuk controls in most database applications.
The purpose of these controls is to display a list of items from which the user can choose one
value
Combo box is a combination of drop down or list box.
List box allows the user to select one or more items from a list combined with a
static,multiple line text box
The user clicks inside the box on an item to select it, sometimes in combination with the
shift key or control key in order to make multiple selections
Charts
Charts are also one of the type of control that can be placed on a forms or reports
The first step in creating the chart is to understand with the user exactly what type of data and
what type of chart will be needed. Then build a new sql query that collect the data to be
displayed on the chart
The chart control places the chart on the form and specifices the individual attributes
like type of chart, axis, scale, and colors
Two basic type of chart are used on database forms and reports

● Groups that show detail from the currently displayed row


● Groups that display summary data across all of the rows
The difference between the two approaches like in the level of the data displayed. Summary
graphs are usually generated from totals or average

5.Explain the 4 basic types of forms?(NOV. 2014)


Forms are used to collect data, display results and organize the overall system. Examples for
forms are business forms, electronic spreadsheet, ATM transaction layout, etc,
Four basic types of forms are,
 Tabular forms
 Single row forms
 Sub forms
 Switchboard forms
Tabular forms
 Tabular forms which displays data in rows and columns
 It can be read as a sub form and is already read as a stand alone form
 In subform they collect display a limited list of data that is related to the main form
 The main feature of tabular form is that it displays multiple rows of data for editing

Single row or columnar forms


 A single row forms displays data for one row at a time
 The goal is to display every column
 The designer can also use graphics, color, and command button to make the form
easier to use
 The single row form is generally the most used form layout
Sub form
 Subform which displays data from tables that have a one to many relationship
 A sub form is usually a tabular form embedded on the main form
 The main form must be single row form and the sub form should be a tabular view
 Most database system enables to create forms that have multiple sub forms
Switchboard forms
 Switch board forms or menus which direct the user to other forms and reports in the
application
 Switchboard or menu forms provide the overall structure to an application
 The forms should match the user tasks

6.Explain about effective design of forms and reports(NOV. 2015)


Effective designs of forms and reports
When designing forms and reports one must remember that they are primary contact
with the users. The key to effective design is to determine the needs of the user.
Research into human factors design has also led to several hints and guidelines that
designers that follow when building forms and reprts
There are some human factor design elements that system designers should transport in their
applications. They are,
User control
With current operating systems, the primary factor is that the users not the programmer and
not the application should always have control. For example do not expect users to enter data
in a particular sequence.
responds to the events or triggers by performing calculations, retrieving or storing data, and
offering new choices. Whenever possible, provide options for user customization,
Examples: changing the display features such as color, typeface, or size
Consistency
To ensure consistency, there are two factors
 At the beginning of the application establish a design standard and basic template for
all designers to use
 Toward the end of the application development always go back and check for
consistency
Clarity
Clarity means keeping the application simple and well organized. If the application has
multiple forms and reports organize them according to user tasks. It helps to have a clear
purpose for an application and to make sure the design enhances that purpose. Use precise
terminology, avoid jargon and stick with terms that are used within the organization.
Aesthetics
aesthetics also play an important role in the user interface
The goal is to use color and design to enhance the forms and reports’
Although design and art are highly subjective, bad designs are immediately obvious to others.
Graphics and art are important and they provide an attractive And familiar environment for
users
Feedback
Uses of feedback include accepting input, acknowledging changes of data, highliting
completion of a task, or signifying the start or completion of some event
More direct forms of feedback such as displaying messages on the screen can be used in more
complicated cases. Some systems use audio feedback, playing a musical theme or sound
when the user selects a task or when the computer finishes an operation
Forgiveness
Designers should provide the users with the possibility of,
 Anticipation and corrections of errors and confirmation of deletions and updates
 Backup and recovery of data.
UNIT - IV
Question & Answers for Two marks:
1. USER INTERFACE (NOV. 2012)

The basic concept of improving the user interface is that the application should
reflect the way the user works.
 Designing a system that truly reflects the needs of the user requires careful
thought observation and creativity.
 You should also study other applications for clues on how to improve your
own project

2. ENSURE DATA INTERGRITY (APR. 2013)

A key purpose of application is to ensure data integrity.


 Application developer is to provide features that encourage people to enter all
data and to keep the data internally consistent.
 Application should also be used to automatically perform all computations .for
example you could expect user to compute sales tax.

3. APPLICATION STRUCTURE (NOV. 2012)

The overall structure is an important feature of any application .The structure or


layout defines how the user will deal with the application
 The object of application structure is to organize all of the forms and reports to
produce a
complete application.

4. DESIGING APPLICATION (APR. 2012)

The first step in designing tell overall application is to identify the various user and
outline the tasks that will be performed with the application.

5. SWITCHBOARD FORM (NOV. 2013)

Designers have learned that some common elements can be used in a many
application.The main menu or switchboard form is an elements that many
developers like to use.
 The two primary reasons for identifying each user are (1) to maintain
appropriate security controls and (2) to customize the application for each user
group.

6. MENUS AND TOLLS BAR (NOV. 2014)

A menu is simply a list of choices that perform some action when selected by the
user. Most menus are hierarchical; that is, detailed choices are presented under a few
keywords.

7. PURPOSE THE MENU (APR. 2013)

A custom menu has several benefits.First is can limit user actions,For


examples ,if user do not need to delete commands .You still have to set the
appropriate security conditions to prevents them from using other methods to delete
data.

8. TOOLBARS (NOV. 2012)

Custom menu are usually implemented on toolbar. A toolbar generally contains a


collection of button and menu items. When the user click a toolbar button, a pre-
defined operation is executed.
9. DATA TRIGGERS (NOV. 2015)

Oracle and SQL, server support a special type of event. Data triggersare
procedures
that are executed when a command attempts to alter the database itself. For example
you could
create a procedure that is run whenever.

10. FORM EVENTS (APR. 2013)

A ‘form event’ is an events that can occur within a form. Events occur for forms
when opening or closing a form, move between forms, or works with data on a form.
Form events returns a numeric value identifying the type of from events that has
occurred. We will use form events form within a form a objects method.

11. CUSTOM REPORT(NOV2014)

Report is a summarization of data. Report writers are good at formatting data for
common
reports.
 Some reports are difficult to create with a report writer, for the we need
specialized
output controls, such as standard generalized makeup language (SGML).
 Creating reports with programming is time-consuming, since it is difficult to
modify the code letter.

12. DEFINE HTML(APR. 2012)


Hypertext markup language a standardized system for tagging text files to
achieve font, color graphic, and hyperlink effects on world wide web pages.

13. WRITE DOWN THE TWO PRIMARY DIFFERNECE BETWEEN THE


COMBO BOX AND LIST BOX (NOV. 2014)
COMBO BOX:-
 It occupies less space but value for values.
 We can’t use check boxes within the list box.
LIST BOX:-
 It occupies more space but shows more than one visibility.
 Shows only one we can use check boxes within the combo boxes.
14. LIST THE DATA TYPES IN ORCLE (APR. 2012)
TEXT: CHAR, VARCHAR2, NVARCHAR2, LONG.
Number: INTEGER, INTERGER, NUMBER (127,0), NUMBER (P,,S)
NUMBER, NUMBER (38,4) INTERGER, DATA, INTERVAL
YEAR….,LONG RAW,BLOB,SETQUERIES,ROWID.

PART-B
Question & Answers for Five marks:
1. WRITE A SHORT ON CUSTOM REPORT (NOV. 2011,APR. 2012)

Custom reports are reports that you design for a specific purpose and save that
you can generate are report in that custom format at any time you desire. You create
new custom report any time you define a new report or after you modify an existing
custom report. Once you create report, you can recall and use it any time you are in
the report window.

You create a custom report simply by defining a report as you normally would, then
selecting the save button in the report window. The save custom report dialog box
appears allowing you to save your reports. The new report is added to the custom
report name list in the report window. You can then select and run the custom report
at any time.

Form modules contains collection of objects such as windows, blocks, canvas, items,
and event based PL/SQL code. The form modules consists of the components such as
blocks, canvas-views, items, window, PL/SQL code, Triggers, Alerts, and LOV has
and attached libraries Transactions are a group of database commands which are to
be treated as asingle atomic event. Transactions are maintained using the two-phase
commit system. The commit statement in SQL marks the finals step in the processing
of a database transactions. The alternative is to utilize the ROLLBACK command to
cancel the proposed database changes. External events occur at the interface or screen
level.

2. DISCUSS THE SECURITY OF MS-ACCESS (APR. 2014)


CATERGORIES OF SECURITIES:
 Physical security
 Logical security
Physical security:-
 It is the protection of personal, hardware, program, networks, and date
from
Physical circumstances and events that could ause serious losses or
damage to an enterprise, agency, or institution.
 This includes protection from fire, natural, disasters, burglary, theft,
vandalism, and terrorism.
 It is often overloaded in favor of more technical and dramatic issues
such as hacking viruses, Trojans, and spyware.
 Moreover, accidents, and natural disasters are part of everyday, life,
and in the long term are inevitable.
FIRST: It can be placed in the way of potential attackers and sites can be hardened against
Accidents and environments disasters. Such measures can includes multiple locks
Fencing, walls, fireproof safes, and water, sprinklers.

Second:surveillance and notification system can be put in place, such as lighting, heat
sensors,
Smoke detectors, intrusion detectors, rom accidents, alarms, and cameras.

Third:Method can be implemented to apprehend attackers and to recover quickly from


accidents, first, or natural disasters.

LOGICAL SECURITY:-
 It consists of software safeguards for an organizations ‘s system,
including user identification and password access, authentication access
rights and authority
Levels.
 These measures are to ensure that only authorized users are able to
perform action or access information in network or a workstation.
 It is a subset of computer security.

ELEMENTS OF LOGICAL SECURITY:


 Tokens authentication
 Password authentication
 Two-way authentication
 Threats.
 Computer virus threats
 Spyware threats
 Hackers & predators
 Phishing threats

3. DISCUSS ON USER INTERFACE FEATURES (NOV. 2012)


Before investigating more detailed processes of design, it is worthwhile to consider
more general issues relatedto design. For instance, we often do not bother
designing small things (a snack before lunch, the seating arrangement at the dinner
table), but for large things, we insist on prior design (an apartment building
bridge….). Successful design approaches an art form, involving partially
understood balancing tricks with many competing constraints. The more design
that you do, the better you get at it, but it is hard to discover the points that result in
a successful design.

User interface design has one identifying characteristic that separates, it form
design areas the principal concern is with the user of the system, not the constraints
of the hardware. This leads us to a common mindset for a UI designer the UI
designer must primarily consider the human factor when designing system.
How not to design:-
 Avoid during things just because you have to do know them.
 Make your design be driver by requirements.

The design process:-


 Specification of the behavior of a product ,and
 Specification of the detailed techniques used to implement the product.
Role of designer:
 A software designer cannot operate in isolation.
 The software designer interacts with people (the user and implementers)
 As well has a responsibility to tie design back to specific requirements and
specific constraints.
 The design must be a readable, understandable, implementable, document.
 To achieve this, the designer uses abstraction extensively, at many
different level, and must be prepared to argue for the use of a particular
abstraction.
 The design of graphical interfaces is no different.
 Here there is a clear relationship between the icons and the txt file.
 For example: higher- level abstraction –the desktop and waste basket
metaphors.

4. WRITE ABOUT FORM EVENTS (APR. 2013)


Events are things that happen to objects, such as the clicking of a command button or
the opening and closing of a form, etc… these events trigger an action to be carried
out.

The event we are going to concentrate on for this tip are form events and, in
particular, the events that occur when a form is opened. A ‘form event’ is an event
that occur within a form. Each occur for forms when opening or closing a form, move
between forms, or work data on a form. Form events returns a numeric value
identifying the type of form events that has just occurred. We will use form within a
form or object method.

Event sequence for a form:

When we first open a form, the following events occur in this order:

Open->load->resize->activate->current

When we a close a form, the following events occur in this order:

Unload->deactivate->close

For objects that receive mouse events, the events occur in this order:

Mousedown->mouseup->click->dblclick

When we double-click a command button, the following events occur in this order:

Mousedown->mouseup->click->dblclick->mouseup->click

5. DISCUSS ABOUT DISTRIBUTING APPLICATION. (NOV. 2015)


Once you have developed, an application you must collect all the associated
files ex:-
Database, system, forms, reports and helps) and distribute them to user. You must
also
Implement security precautions and assign user access rights.

Microsoft access:-

 Make the application stand alone

 Runs completely from your forms


 Never need to use the access database menu(tables, queries, forms,
reports)
 Automatically starts when the database is opened
 Tools /database utilities/startup
 Auto exec macro

 Application format
 Standard mde file
 Encrypted mde file

 Run-time package (developer’s edition)


 Security
 Installation package (developer’s edition)

PART-C

Question & Answers for Ten marks:


1. Explain the user Interface features.(NOV. 2012, APR. 2013)

The user interface is the view of a database interface that is seeing by the user.
User interface are often graphical or at least partly graphical. The three features of
User interface are

 Menus
 Toolbars
 Help system

Menu:-

A menu is a list of commands or option available to users. Most menus are hierarchical.
Menus are often displayed from a menu bar. A list of labeled menu categories
located near
The top of a window. A context menu drops down when user rights click on an
objects or
Window region.

Creating menus:-

There are these basic steps to create a menu

 Choose the layout or structure


 Give each option a name and an access key
 Define the action to be taken when each option is selected

Benefit of menus:-

 A custom menu limit user actions


 It also simplifies the user interface
 It is possible to add special functions to a custom menu
 Menus objects can be activated by key stroke

Toolbar:-

The toolbar is a set of icons or buttons that are part of a software. A toolbar
Typically paced directly under the menu bar. When the user clicks a toolbar button.
A predefine operation is executed. Toolbar are drag able which means user
can drag
Them into any place on the application window.

Creating toolbars:-

The basic steps to creating toolbars.

 Identify which tool we want display for each form.


 Choose or create an icon to represent a command
 Define the action to be taken when the option is selected
Benefit of toolbars:-

 The purpose of a toolbar is to provide a single click access to complex


action
 Toolbar are designer to ease our work. There are different types of
toolbars like standard, formatting and drawing toolbar which use to
perform various
Task.
 Eg. Ms-word has a toolbar with icon that allows opening, saving,
printing, documents as well as changing the font name, size and style.

Icons in toolbars:-

Toolbar contain icons. An icon is a small pictures that indicates the


function
to be performed. It is created and stored as a bit map image. We can edit or create a
new images to be placed on a button. A standard icon is squared icon (16*16)pixels.
Each pixel can be displayed as one of 16 colors.

Help:-

Help system have a group to replace paper manuals goal is to provide


the back
Ground information and specific instruction to the user. Help file contains
text based
Description, figures, hypertext links to related topics. Help system must have
an
Extensive search entry. So that user can find information any topics.
Creating a help file:-

The first and most important step in creating a help file is to understand what
Information user will need.

Basic components to create a help system:-

 Text message and images written as pages.


 Hypertext links between topics.
 Sequential links that groups of pages together.
 Definition of technical word and phrases.
 Keyword that describe each pages.
 Title of the topic
 A topic name and a number of each page.

Windows software help file format:-

The help system may consist of number of html pages. There are many types of file
Formats for being file they are:

 Chm-> Microsoft compressed html, help. The chm file is a set of web
pages written in a subset of html. The chm file has a hypertext table of
contents.
 Hlp-> Microsoft win help hlp is a properly format for help that can be
displayed by the Microsoft help browser.
 Pdf-> printable or portable document format. The pdf file encapsulates
the text, fonts, image and graphics that compose the document.
 Rtf or doc-> rigid text format and dco->Microsoft word text processor
are able
To read and write rtf document. Microsoft word document contains text,
fonts and images.

 Txt-> clients text file, txt is a computer file which contains only ordinary
textual characters with essentially no formatting. The main disadvantage
of using txt files are no graphics, formatting or navigation.
 Context sensitive help-> context sensitive help van be implemented
using tool tips. It provide description of a complete a topic from the help
file.

2. WHAT IS CUSTOM REPORT (APR. 2013)


 You might encounter reports that are difficult to create with a report
writer. For ex:
You might need specialized output controls, such as standard generalized
markup language. Similarly, you might want conditional formatting,
where the output changes based on the data.

 As much as possible you should use report writer to display the final
report creating reports with programming is time-consuming,
additionally, it is difficult to modify the code later.
 If you need to know the characteristics and capabilities of the output
devices. Modern printer support multiple typefaces and various graphics
capabilities. These
Features provide detailed control over the output but significantly
increase the time it takes to program the report.

 It is generally best to use programming for computations and to use the


report writer to handle the layout and printing.

 The common report layout structure is shown. Grouping data and


producing subtotals is known as a control break and is a common
features of business reports.

 The first step is to create a query that provide the data on the report. It is
best to use SQL, to join all needed tables. Then you write a program that
starts at the top of the query and examines each row. Your code must
identify the breaks for each group. You should also keep track of the
number of lines so that you can identify the end of the page.

UNIT – V
Question & Answers for Two marks:
1. What is the role of a database administrator? (APR. 2012)

 Deciding the information content of the database


 Liaising with the users
 Defining a strategy for backup and recovery
 Monitoring performance and responsibilities to changes in requirements.
2. Define the term: Privacy (APR. 2012)

 What personal information can be shared with whom


 Whether messages can be exchanged without anyone else seeing them
 Whether and how one can send messages anonymously.

3. What task are performed by a DBA? (APR. 2013)

 Evaluate the database server hardware


 Install the oracle database software
 Plan the database
 Create and open the database
 Backup the database.

4. Define: a file-server (APR-. 2013)

 A file server is a computer responsible for the central storage and management
of data files so that other computers on the same network can access the files.
 A file server allows users to share information over a network without having to
physically transfer files by floppy diskette or some other external storage device.

5 . What is a distributed database? List its advantages.( APR. 2014)

A distributed database management system (DDBMS) is a centralized software system that


manages a distributed database in a manner as if it were all stored in a single location.
 Improved performance
 Efficiency
 Extensibility (addition of new nodes)
 Transparency of distribution

6. What is a recovery in a database? (APR. 2014)

 A database is a very huge system with lots of data and transaction.


 The transaction in the database is executed at each seconds of time and is very critical
to the database.
 If there is any failure or crash while executing the transaction, then it expected that no
data is lost.

7. Who is DBA? (APR. 2015)

 Centralized control of the database is exerted by a person or group of persons under


the supervision of a highlevel administrator.
 This person or group is referred to as the database administrator (DBA).
 They are the users who are most familiar with the database and are responsible for
creating, modifying, and maintaining its three levels.

8. What is the use of backup? (APR. 2015)

In a computer system we have primary and secondary memory storage. Primary memory
storage devices - RAM is a volatile memory which stores disk buffer, active logs, and other
related data of a database.
 We can create a copy of primary memory in the database with all the logs and buffers,
and are copied periodically into database. So in case of any failure, we will not lose
all the data. We can recover the data till the point it is last copied to the database.

9. List the database task by development stages. (APR. 2016)

 Analysis. Model the application from the perspective of the real world .
 Design. Decide how to build the application from the analysis model.
 Implementation. Write the actual database and programming code.
 Data conversion. Populate the application database with available data.
 Testing. Ensure that the application is suitable for actual use.
 Training. Help users master the new application.
 Maintenance. Preserve the soundness of the application over the long term.

10. What is meant by Client/Server Database? (APR. 2016)

 In the Oracle client/server architecture, the database application and the database are
separated into two parts: a front-end or client portion, and a back-end or server
portion.
 The client executes the database application that accesses database information and
interacts with a user through the keyboard, screen, and pointing device such as a
mouse.
 The server executes the Oracle software and handles the functions required for
concurrent, shared data access to an Oracle database.

11. Distinguish between Physical Security and Logical Security.(NOV. 2012)

Physical Security Logical Security


Physical security protects the site and  Logical security protects access to computer
everything located within the site. systems
Physical security prevents and discourages Logical security protects computer software by
attackers from entering a building by, cameras, discouraging user excess by implementing user
and administration access controls. identifications, passwords, authentication,
biometrics and smart cards.
Methods for securing a network physically Logical security can consist of hardware and
include educating personnel, administrative software firewalls, anti-virus, anti-spyware,
controls, physical controls, technical controls, anti-phishing apps, as well as other protective
and environmental/life-safety controls. applications.

12. What are the strengths of a distributed database?(NOV. 2013)

 Improved performance
 Efficiency
 Extensibility (addition of new nodes)
 Transparency of distribution

13. State the problems of logical security.( NOV. 2014)

 Viruses
 Untested
 User error
 Operator error
 Computer misuse

12. What is a disaster plan?(NOV. 2014)

 A Disaster plan is a complete list of the steps that the IS department will take if the
disaster hits the information system.
 The plan details who is in charge, what steps everyone will take, list contact numbers
etc.

13. Define: HTML. (NOV. 2015)

 HTML (Hypertext Markup Language) is the set of markup symbols or codes inserted


in a file intended for display on a World Wide Web browser page.
 "Hypertext" refers to the hyperlinks that an HTML page may contain.
 "Markup language" refers to the way tags are used to define the page layout and
elements within the page.

14. What is meant by Object Oriented Database? (NOV.2015)

 Object oriented databases are also called Object Database Management Systems
(ODBMS).
 Object databases store objects rather than data such as integers, strings or real
numbers.
 Objects are used in object oriented languages such as Smalltalk, C++, Java, and
others.
PART - B
Question & Answers for Five marks:

1. What are custom reports? Discuss briefly.(APR. 2012)

Objects could change their structure: properties may be added/removed/changed.


Objects could be absolutely dropped. So object's metadata (description, classes, call them like
you want )could be changed.
The database should store objects schemas and instances of these objects.
What's the best way to organise a relational database structure to store data mentioned above?
Currently I see only two ways:
1. Store objects schemas in a few tables: schema general data,schema properties,
possible properties types. Store instances in their tables: instance general data, a few
tables - per each type from possible properties types table to store instance properties
data. And so on.
2. store objects schemas like in p1 but store instances like XML files in one table: one
table for general instance info and one table with instance XML.

2. Write notes on : creating a Distributed Database System. (or) Discuss about


Distributing Application)(APR. 2016) ***
Distributed Database Management System
A distributed database management system (DDBMS) is a centralized software system that
manages a distributed database in a manner as if it were all stored in a single location.
Features
 It is used to create, retrieve, update and delete distributed databases.
 It synchronizes the database periodically and provides access mechanisms by the
virtue of which the distribution becomes transparent to the users.
 It ensures that the data modified at any site is universally updated.
 It is used in application areas where large volumes of data are processed and accessed
by numerous users simultaneously.
 It is designed for heterogeneous database platforms.
 It maintains confidentiality and data integrity of the databases.

3. Discuss on Transaction with example.(APR. 2013)

A transaction can be defined as a group of tasks. A single task is the minimum processing
unit which cannot be divided further.
ACID Properties
A transaction is a very small unit of a program and it may contain several lowlevel tasks. A
transaction in a database system must maintain Atomicity,Consistency, Isolation,
and Durability − commonly known as ACID properties − in order to ensure accuracy,
completeness, and data integrity.
 Atomicity − This property states that a transaction must be treated as an atomic unit,
that is, either all of its operations are executed or none. There must be no state in a
database where a transaction is left partially completed. States should be defined
either before the execution of the transaction or after the execution/abortion/failure of
the transaction.
 Consistency − The database must remain in a consistent state after any transaction. No
transaction should have any adverse effect on the data residing in the database. If the
database was in a consistent state before the execution of a transaction, it must remain
consistent after the execution of the transaction as well.
 Durability − The database should be durable enough to hold all its latest updates even
if the system fails or restarts. If a transaction updates a chunk of data in a database and
commits, then the database will hold the modified data. If a transaction commits but
the system fails before the data could be written on to the disk, then that data will be
updated once the system springs back into action.
States of Transactions
A transaction in a database can be in one of the following states −

 Active − In this state, the transaction is being executed. This is the initial state of
every transaction.
 Partially Committed − When a transaction executes its final operation, it is said to be
in a partially committed state.
 Failed − A transaction is said to be in a failed state if any of the checks made by the
database recovery system fails. A failed transaction can no longer proceed further.
 Aborted − If any of the checks fails and the transaction has reached a failed state, then
the recovery manager rolls back all its write operations on the database to bring the
database back to its original state where it was prior to the execution of the
transaction. Transactions in this state are called aborted. The database recovery
module can select one of the two operations after a transaction aborts −
o Re-start the transaction
o Kill the transaction
 Committed − If a transaction executes all its operations successfully, it is said to be
committed. All its effects are now permanently established on the database system.

 Isolation − In a database system where more than one transaction are being executed
simultaneously and in parallel, the property of isolation states that all the transactions
will be carried out and executed as if it is the only transaction in the system. No
transaction will affect the existence of any other transaction.

4. Explain about Application types.(APR. 2013)

1. Banking
2. Airlines
3. Universities
4. Manufacturing and selling
5. Human resources

5. Explain the primary role of the data administrator. (APR. 2014)

The roles of a DBA vary from organization to organization. But the following list shows the
primary activities that many DBAs are charged with:
 Back up and recover the database.
 Install and configure Oracle software.
 Create new databases.
 Design the database schema and create any necessary database objects.
 Formulate optimal application SQL.
 Ensure database security is implemented to safeguard the data.
 Work closely with application developers and system administrators to ensure all
database needs are being met.
 Apply patches or upgrades to the database as needed.

6. Discuss the Three tier Client/Server model. (APR. 2014)

THREE-TIER CLIENT / SERVER


Three-tier Client / Server database architecture is commonly used architecture for web
applications. Intermediate layer called Application server or Web Server stores the web
connectivity software and the business logic (constraints) part of application used to access
the right amount of data from the database server. This layer acts like medium for sending
partially processed data between the database server and the client.

7. Write a note on Table Operations.(APR. 2015)

Creating a basic table involves naming the table and defining its columns and each column's
data type.
The SQL CREATE TABLE statement is used to create a new table.
Syntax:
Basic syntax of CREATE TABLE statement is as follows:
CREATE TABLE table_name(
column1 datatype,
column2 datatype,
column3 datatype,
.....
columnN datatype,
PRIMARY KEY( one or more columns )
);
CREATE TABLE is the keyword telling the database system what you want to do. The
unique name or identifier for the table follows the CREATE TABLE statement.
Then in brackets comes the list defining each column in the table and what sort of data type it
is. The syntax becomes clearer with an example below.
A copy of an existing table can be created using a combination of the CREATE TABLE
statement and the SELECT statement.
Example:
Following is an example, which creates a CUSTOMERS table with ID as primary key and
NOT NULL are the constraints showing that these fields can not be NULL while creating
records in this table:
SQL> CREATE TABLE CUSTOMERS(
ID INT NOT NULL,
NAME VARCHAR (20) NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR (25) ,
SALARY DECIMAL (18, 2),
PRIMARY KEY (ID)
);
You can verify if your table has been created successfully by looking at the message
displayed by the SQL server, otherwise you can use DESC command as follows:
SQL>DESC CUSTOMERS;
Field Type Null Key Default extra
ID Int(11) No Pri
NAME Varchar(20) No
AGE Int(11) No
ADRESS Char(25) Yes NULL
SALARY Decimal(18,2) yes NULL
Now, you have CUSTOMERS table available in your database which you can use to store
required information related to customers.

8.What is security and privacy? Describe briefly.


Database security: protecting the database from unauthorized access, modification, or
destruction

Privacy: the right of individuals to have some control over information about themselves
protected by laws in many countriesthese laws can vary significantly Right to privacy can be
protected by the database management system
 
Accidental Security Threats
User errors
 User unintentionally requests object or operation for which he/she should not be
authorized
Communications system errors
 User sent a message that should be sent to another user
 system connects a user to a session that belongs to another user with different access
privileges
OS errors
 Accidentally overwrites files and destroys part of database
 Fetches the wrong files and sends them to the user
 Fails to erase files that should be erased
 
Deliberate Security Threats
Sources
 User intentionally gains unauthorized access and/or performs unauthorized operations
on the database for personal gain
 Disgruntled employee who is familiar with the organization's computer system seeks
revenge (terminated employees are especially dangerous)
 Industrial spies seek information for competitors
Methods
 Wiretapping of communication lines
 Electronic eavesdropping-picking up electronic signals
 Reading display screens or printouts left unsupervised
 Impersonating authorized users or users with greater access
 Writing programs to bypass the DBMS and access database data directly
 Writing applications programs that perform unauthorized operations
 Deriving information about hidden data by clever querying
 Removing physical storage devices from the computer facility
 Making copies of stored files without going through the DBMS
 Bribing, blackmailing or influencing authorized users to obtain information or
damage the database
 
Security Plan
Should begin with physical security measures for the building-physical barriers, control
access, require badges, sign-in etc.
Should have more physical security for the computer facilities-e.g. locked door
Additional security control for database
Authentication
 User authentication - verifying the identity of users
 Operating system uses user profiles, user ids, passwords, authentication procedures,
badges, keys, or physical characteristics of the user
 Additional authentication can be required to access the database-additional user ID,
PW
User Profiles
 System has a user profile for each id, giving information about the user
 Stored profiles should be kept secure, possibly in encrypted form
 Profile normally includes a password, allegedly known only to the user
 Passwords should be kept secret and changed frequently
 System should never display passwords at sign-in time

9. Discuss in detail, Data Partitioning. (NOV. 2012)

 Partitioning a database improves performance and simplifies maintenance.


 By splitting a large table into smaller, individual tables, queries that access only a
fraction of the data can run faster because there is less data to scan. Maintenance
tasks, such as rebuilding indexes or backing up a table, can run more quickly.

Horizontal partitioning
 Horizontal partitioning divides a table into multiple tables. Each table then contains
the same number of columns, but fewer rows.
 For example, a table that contains 1 billion rows could be partitioned horizontally into
12 tables, with each smaller table representing one month of data for a specific year.
Any queries requiring data for a specific month only reference the appropriate table.
 Determining how to partition the tables horizontally depends on how data is analyzed.
You should partition the tables so that queries reference as few tables as possible.
Otherwise, excessive UNION queries, used to merge the tables logically at query
time, can affect performance. 
Vertical partioning
Vertical partitioning divides a table into multiple tables that contain fewer columns. The two
types of vertical partitioning are normalization and row splitting:
 Normalization is the standard database process of removing redundant columns from
a table and putting them in secondary tables that are linked to the primary table by
primary key and foreign key relationships.
 Row splitting divides the original table vertically into tables with fewer columns.
Each logical row in a split table matches the same logical row in the other tables as
identified by a UNIQUE KEY column that is identical in all of the partitioned tables.
For example, joining the row with ID 712 from each split table re-creates the original
row.

10. Write about Database Tasks by Development Stages. (NOV. 2012)

Stages of Development
Software development consists of a sequence of stages. The following subsections elaborate
on each stage:

 Analysis. Model the application from the perspective of the real world
 Design. Decide how to build the application from the analysis model
 Implementation. Write the actual database and programming code
 Data conversion. Populate the application database with available data.
 Testing. Ensure that the application is suitable for actual use.
 Training. Help users master the new application.
 Maintenance. Preserve the soundness of the application over the long term.
Analysis
Modeling is the focus of analysis. Analysis prepares a model of the application from the
perspective of the real world. During analysis, you specify what must be done, not how it
should be done. Analysis is a difficult task in its own right, and developers must fully
understand it before addressing the additional complexities of design.
The preparation of a model and architecture must be interleaved for complex applications.
The architecture helps to establish a model's scope. In turn, modeling reveals important issues
of strategy to resolve. Thus, there is much interplay between the construction of a model and
the model's architecture, and they must happen together.

During analysis, developers consider the available inputs and resolve ambiguities. Often,
business experts are not sure of the precise requirements, and must refine them in tandem
with software development. Modeling quickens the convergence between developers and
business experts because it is much faster to work with multiple iterations of models than
with code. Models highlight omissions and inconsistencies so that they can be resolved.

Design
During design, the focus shifts from an emphasis on the real world to techniques for realizing
the application. Developers address how a problem is to be solved, but they don't descend
into the fine details of the target database and programming language. Thus, during design,
developers should convert a model to relational database tables, for example; but they should
defer the idiosyncrasies of a specific database manager, such as Oracle.

The first step of design is to devise an architecture. For complex problems, you must
coordinate the development of an architecture with an analysis model. Next, you choose a
specific data management approach—whether to use simple files (which suffice for some
applications), a database manager, or possibly something else. Developers then determine the
data structures and algorithms that will realize the model from analysis.

Implementation
Implementation is the stage of writing the actual code. it is at this point that developers must
deal with the nuances of the specific database manager and programming languages that are
being used to construct the system. Developers should take the design model and drive it into
the database structure. Once they establish a sound database, they can write programming
logic and build a user interface. Tools can generate the code for creating an empty database.

Data Conversion
Data conversion adds existing data to a database. Data conversion is often an intricate task;
source databases can be difficult to understand. In addition, the source data structure rarely
matches the target data structure. Many source databases have data flaws that must be
repaired.

Testing
After implementation, the system is complete, but it must be carefully tested before it can be
commissioned for actual use. Hopefully, the ideas that inspired the original project were
nurtured through the previous stages by the use of models. Testers once again look at the
original business requirements and verify that the system delivers the proper functionality.
Testing can also uncover accidental errors (bugs) that were introduced. If an application runs
on multiple hardware and operating system platforms, it should be tested on all of them.

Training
An organization must train users so that it can benefit fully from an application. Training
accelerates users on the software learning curve.

Maintenance
Once development is complete and a system has been deployed, it must be maintained for
continued success. There are several kinds of maintenance. Bugs that remain in the original
system will gradually appear during use and must be fixed. A successful application will also
trigger requests for enhancements, and a long-lived application will occasionally have to be
restructured.

11. Write a short note on data clustering.( NOV. 2013)

Clustering, in the context of databases, refers to the ability of several servers or instances to
connect to a single database. An instance is the collection of memory and processes that
interacts with a database, which is the set of physical files that actually store data.
Clustering offers two major advantages, especially in high-volume database environments:

 Fault tolerance: Because there is more than one server or instance for users to connect
to, clustering offers an alternative, in the event of individual server failure.
 Load balancing: The clustering feature is usually set up to allow users to be
automatically allocated to the server with the least load.

Clustering takes different forms, depending on how the data is stored and allocated resources.
The first type is known as the shared-nothing architecture. In this clustering mode, each
node/server is fully independent, so there is no single point of contention. An example of this
would be when a company has multiple data centers for a single website. With many servers
across the globe, no single server is a “master.” Shared-nothing is also known as “database
sharding.”

12. Explain the Web as a Client/Server System.(NOV. 2013)

HTML LIMITED CLIENTS


<HTML>
<HEAD>
<TITLE>My main page</TITLE></HEAD>
<BODY BACKGROUND=“graphics/back0.jpg”>
<P>My text goes in paragraphs.</P>
<P>Additional tags set <B>boldface</B> and <I>Italic</I>.
<P>Tables are more complicated and use a set of tags for rows and columns.</P>
<TABLE BORDER=1>
<TR><TD>First cell</TD><TD>Second cell</TD></TR>
<TR><TD>Next row</TD><TD>Second column</TD></TR>
</TABLE>
<P>There are form tags to create input forms for collecting data.
But you need CGI program code to convert and use the input data.</P>
</BODY>
</HTML>

OUTPUT:
My text goes in paragraphs.

Additional tags set boldface and Itali .


c
Tables are more complicated and use a set of tags

for rows and columns.

First cell Second cell

Next row Second column

There are form tags to create input forms for

collecting data. But you need CGI program code

to convert and use the input data.

WEB SERVER DATABASE FUNDAMENTLS


3Pa
ge
Client/Browser =T
em Database
1 2 Data 3 2C pla
GI te
St +R DBMS
r in e
HTML 1 g sResult
ult
Fo Query
Form rm
Web Server

Result Page 1 2
HTML Query
form Templ
Form.html ate
Program
+ Code code

DBMS

Web Server
<body>
<form id="form1" runat="server">
Data <asp:Label ID="PageTitleLabel" runat="server" …
<asp:SqlDataSource ID="CustomerSqlDataSource“
DeleteCommand="DELETE FROM [Customer] …
Data Object
SelectCommand="SELECT [CustomerID], …
Web Browser
UpdateCommand="UPDATE [Customer] SET… Customers
<DeleteParameters>
<asp:Parameter Name="CustomerID" Type="Int32" /> CustomerID 1653
Jones
</DeleteParameters> LastNameMary
FirstName
<asp:FormView ID="CustomersFormView" runat="server“…
DataSourceID="CustomerSqlDataSource">

… Save
</asp:FormView> CSS Style Sheet
.PageTitle
</form> {
</body> font-weight: bold;
font-size: larger;
text-align: center;
} 30
PART – C

Questions for Ten marks:

1. Explain the User Interface Features. (NOV. 2012)

 The user interface (UI), in the industrial design field of human–machine interaction, is


the space where interactions between humans and machines occur.
 The goal of this interaction is to allow effective operation and control of the machine
from the human end, whilst the machine simultaneously feeds back information that
aids the operators' decision-making process.
 Examples of this broad concept of user interfaces include the interactive aspects of
computer operating systems, hand tools, heavy machinery operator controls,
and process controls. The design considerations applicable when creating user
interfaces are related to or involve such disciplines as ergonomics and psychology.

1. Menu-Based Interfaces for Web Clients or Browsing :These interfaces present the user with
lists of options, called menus, that lead the user through the formulation of a request. Menus
do away with the need to memorize the specific commands and syntax of a query language;
rather, the query is composed step by step by picking options from a menu that is displayed
by the system. Pull-down menus are a very popular technique in Web-based user interfaces.
They are also often used in browsing interfaces, which allow a user to look through the
contents of a database in an exploratory and unstructured manner.

2. Forms-Based Interfaces : A forms-based interface displays a form to each user. Users can fill
out all of the form entries to insert new data, or they fill out only certain entries, in which
case the DBMS will retrieve matching data for the remaining entries. Forms are usually
designed and programmed for naive users as interfaces to canned transactions. Many DBMSs
have forms specification languages, which are special languages that help programmers
specify such forms. Some systems have utilities that define a form by letting the end user
interactively construct a sample form on the screen.

3. Graphical User Interfaces : A graphical interface (CUI) typically displays a schema to the
user in diagrammatic form. The user can then specify a query by manipulating the diagram.
In many cases, CUIs utilize both menus and forms. Most CUIs use a pointing device, such as
a mouse, to pick certain parts of the displayed schema diagram.

4. Natural Language Interfaces : These interfaces accept requests written in English or some
other language and attempt to "understand" them. A natural language interface usually has its
own "schema," which is similar to the database conceptual schema, as well as a dictionary of
important words. The natural language interface refers to the words in its schema, as well as
to the set of standard words in its dictionary, to interpret the request. If the interpretation is
successful, the interface generates a high-level query corresponding to the natural language
request and submits it to the DBMS for processing; otherwise, a dialogue is started with the
user to clarify the request.
5. Interfaces for Parametri c Users : Parametric users, such as bank tellers, often have a small set
of operations that they must perform repeatedly. Systems analysts and programmers design
and implement a special interface for each known class of naive users. Usually, a small set of
abbreviated commands is included, with the goal of minimizing the number of keystrokes
required for each request.

6. Interfaces for the DBA : Most database systems contain privileged commands that can be
used only by the DBA's staff. These include commands for creating accounts, setting system
parameters, granting account authorization, changing a schema, and reorganizing the storage
structures of a database.

2. Describe in detail, Distributed Databases.(NOV. 2013)


A distributed database is a collection of multiple interconnected databases, which are
spread physically across various locations that communicate via a computer network.
Features
 Databases in the collection are logically interrelated with each other. Often they represent a
single logical database.
 Data is physically stored across multiple sites. Data in each site can be managed by a DBMS
independent of the other sites.
 The processors in the sites are connected via a network. They do not have any multiprocessor
configuration.
 A distributed database is not a loosely connected file system.
 A distributed database incorporates transaction processing, but it is not synonymous with a
transaction processing system.
Distributed Database Management System
A distributed database management system (DDBMS) is a centralized software system that
manages a distributed database in a manner as if it were all stored in a single location.
Features
 It is used to create, retrieve, update and delete distributed databases.
 It synchronizes the database periodically and provides access mechanisms by the virtue of
which the distribution becomes transparent to the users.
 It ensures that the data modified at any site is universally updated.
 It is used in application areas where large volumes of data are processed and accessed by
numerous users simultaneously.
 It is designed for heterogeneous database platforms.
 It maintains confidentiality and data integrity of the databases.
Factors Encouraging DDBMS
The following factors encourage moving over to DDBMS −
 Distributed Nature of Organizational Units  − Most organizations in the current times are
subdivided into multiple units that are physically distributed over the globe. Each unit
requires its own set of local data. Thus, the overall database of the organization becomes
distributed.
 Need for Sharing of Data − The multiple organizational units often need to communicate with
each other and share their data and resources. This demands common databases or replicated
databases that should be used in a synchronized manner.
 Support for Both OLTP and OLAP − Online Transaction Processing (OLTP) and Online
Analytical Processing (OLAP) work upon diversified systems which may have common data.
Distributed database systems aid both these processing by providing synchronized data.
 Database Recovery − One of the common techniques used in DDBMS is replication of data
across different sites. Replication of data automatically helps in data recovery if database in
any site is damaged. Users can access data from other sites while the damaged site is being
reconstructed. Thus, database failure may become almost inconspicuous to users.
 Support for Multiple Application Software − Most organizations use a variety of application
software each with its specific database support. DDBMS provides a uniform functionality
for using the same data among different platforms.
Advantages of Distributed Databases
Following are the advantages of distributed databases over centralized databases.
Modular Development − If the system needs to be expanded to new locations or new units, in
centralized database systems, the action requires substantial efforts and disruption in the
existing functioning. However, in distributed databases, the work simply requires adding new
computers and local data to the new site and finally connecting them to the distributed
system, with no interruption in current functions.
More Reliable − In case of database failures, the total system of centralized databases comes
to a halt. However, in distributed systems, when a component fails, the functioning of the
system continues may be at a reduced performance. Hence DDBMS is more reliable.
Better Response − If data is distributed in an efficient manner, then user requests can be met
from local data itself, thus providing faster response. On the other hand, in centralized
systems, all queries have to pass through the central computer for processing, which increases
the response time.
Lower Communication Cost − In distributed database systems, if data is located locally
where it is mostly used, then the communication costs for data manipulation can be
minimized. This is not feasible in centralized systems.
Adversities of Distributed Databases
Following are some of the adversities associated with distributed databases.
 Need for complex and expensive software − DDBMS demands complex and often expensive
software to provide data transparency and co-ordination across the several sites.
 Processing overhead − Even simple operations may require a large number of
communications and additional calculations to provide uniformity in data across the sites.
 Data integrity − The need for updating data in multiple sites pose problems of data integrity.
 Overheads for improper data distribution − Responsiveness of queries is largely dependent
upon proper data distribution. Improper data distribution often leads to very slow response to
user requests.

3. Describe the three primary data storage methods. (NOV.2014, APR. 2014,APR-
2016,APR. 2012 )
Databases are stored in file formats, which contain records. At physical level, the
actual data is stored in electromagnetic format on some device. These storage devices can be
broadly categorized into three types −

 Primary Storage − The memory storage that is directly accessible to the CPU comes under
this category. CPU's internal memory (registers), fast memory (cache), and main memory
(RAM) are directly accessible to the CPU, as they are all placed on the motherboard or CPU
chipset. This storage is typically very small, ultra-fast, and volatile. Primary storage requires
continuous power supply in order to maintain its state. In case of a power failure, all its data
is lost.
 Secondary Storage − Secondary storage devices are used to store data for future use or as
backup. Secondary storage includes memory devices that are not a part of the CPU chipset or
motherboard, for example, magnetic disks, optical disks (DVD, CD, etc.), hard disks, flash
drives, and magnetic tapes.
 Tertiary Storage − Tertiary storage is used to store huge volumes of data. Since such storage
devices are external to the computer system, they are the slowest in speed. These storage
devices are mostly used to take the back up of an entire system. Optical disks and magnetic
tapes are widely used as tertiary storage.
Memory Hierarchy
A computer system has a well-defined hierarchy of memory. A CPU has direct access to it
main memory as well as its inbuilt registers. The access time of the main memory is
obviously less than the CPU speed. To minimize this speed mismatch, cache memory is
introduced. Cache memory provides the fastest access time and it contains data that is most
frequently accessed by the CPU.
The memory with the fastest access is the costliest one. Larger storage devices offer slow
speed and they are less expensive, however they can store huge volumes of data as compared
to CPU registers or cache memory.
Magnetic Disks
Hard disk drives are the most common secondary storage devices in present computer
systems. These are called magnetic disks because they use the concept of magnetization to
store information. Hard disks consist of metal disks coated with magnetizable material. These
disks are placed vertically on a spindle. A read/write head moves in between the disks and is
used to magnetize or de-magnetize the spot under it. A magnetized spot can be recognized as
0 (zero) or 1 (one).
Hard disks are formatted in a well-defined order to store data efficiently. A hard disk plate
has many concentric circles on it, called tracks. Every track is further divided into sectors. A
sector on a hard disk typically stores 512 bytes of data.
Redundant Array of Independent Disks
RAID or Redundant Array of Independent Disks, is a technology to connect multiple
secondary storage devices and use them as a single storage media.
RAID consists of an array of disks in which multiple disks are connected together to achieve
different goals. RAID levels define the use of disk arrays.
RAID 0
In this level, a striped array of disks is implemented. The data is broken down into blocks and
the blocks are distributed among disks. Each disk receives a block of data to write/read in
parallel. It enhances the speed and performance of the storage device. There is no parity and
backup in Level 0.

RAID 1
RAID 1 uses mirroring techniques. When data is sent to a RAID controller, it sends a copy of
data to all the disks in the array. RAID level 1 is also calledmirroring and provides 100%
redundancy in case of a failure.

RAID 2
RAID 2 records Error Correction Code using Hamming distance for its data, striped on
different disks. Like level 0, each data bit in a word is recorded on a separate disk and ECC
codes of the data words are stored on a different set disks. Due to its complex structure and
high cost, RAID 2 is not commercially available.

RAID 3
RAID 3 stripes the data onto multiple disks. The parity bit generated for data word is stored
on a different disk. This technique makes it to overcome single disk failures.

RAID 4
In this level, an entire block of data is written onto data disks and then the parity is generated
and stored on a different disk. Note that level 3 uses byte-level striping, whereas level 4 uses
block-level striping. Both level 3 and level 4 require at least three disks to implement RAID.

RAID 5
RAID 5 writes whole data blocks onto different disks, but the parity bits generated for data
block stripe are distributed among all the data disks rather than storing them on a different
dedicated disk.

RAID 6
RAID 6 is an extension of level 5. In this level, two independent parities are generated and
stored in distributed fashion among multiple disks. Two parities provide additional fault
tolerance. This level requires at least four disk drives to implement RAID.

10 MARKS

23. Describe in detail, Data storage methods.(APR-14)(APR-16)APR-12 ***


Databases are stored in file formats, which contain records. At physical level, the actual
data is stored in electromagnetic format on some device. These storage devices can be
broadly categorized into three types −

 Primary Storage − The memory storage that is directly accessible to the CPU comes
under this category. CPU's internal memory (registers), fast memory (cache), and main
memory (RAM) are directly accessible to the CPU, as they are all placed on the
motherboard or CPU chipset. This storage is typically very small, ultra-fast, and
volatile. Primary storage requires continuous power supply in order to maintain its
state. In case of a power failure, all its data is lost.
 Secondary Storage − Secondary storage devices are used to store data for future use or
as backup. Secondary storage includes memory devices that are not a part of the CPU
chipset or motherboard, for example, magnetic disks, optical disks (DVD, CD, etc.),
hard disks, flash drives, and magnetic tapes.
 Tertiary Storage − Tertiary storage is used to store huge volumes of data. Since such
storage devices are external to the computer system, they are the slowest in speed. These
storage devices are mostly used to take the back up of an entire system. Optical disks
and magnetic tapes are widely used as tertiary storage.
Memory Hierarchy
A computer system has a well-defined hierarchy of memory. A CPU has direct access to
it main memory as well as its inbuilt registers. The access time of the main memory is
obviously less than the CPU speed. To minimize this speed mismatch, cache memory is
introduced. Cache memory provides the fastest access time and it contains data that is
most frequently accessed by the CPU.
The memory with the fastest access is the costliest one. Larger storage devices offer slow
speed and they are less expensive, however they can store huge volumes of data as
compared to CPU registers or cache memory.
Magnetic Disks
Hard disk drives are the most common secondary storage devices in present computer
systems. These are called magnetic disks because they use the concept of magnetization
to store information. Hard disks consist of metal disks coated with magnetizable
material. These disks are placed vertically on a spindle. A read/write head moves in
between the disks and is used to magnetize or de-magnetize the spot under it. A
magnetized spot can be recognized as 0 (zero) or 1 (one).
Hard disks are formatted in a well-defined order to store data efficiently. A hard disk
plate has many concentric circles on it, called tracks. Every track is further divided
into sectors. A sector on a hard disk typically stores 512 bytes of data.
Redundant Array of Independent Disks
RAID or Redundant Array of Independent Disks, is a technology to connect multiple
secondary storage devices and use them as a single storage media.
RAID consists of an array of disks in which multiple disks are connected together to
achieve different goals. RAID levels define the use of disk arrays.
RAID 0
In this level, a striped array of disks is implemented. The data is broken down into
blocks and the blocks are distributed among disks. Each disk receives a block of data to
write/read in parallel. It enhances the speed and performance of the storage device.
There is no parity and backup in Level 0.

RAID 1
RAID 1 uses mirroring techniques. When data is sent to a RAID controller, it sends a
copy of data to all the disks in the array. RAID level 1 is also calledmirroring and
provides 100% redundancy in case of a failure.

RAID 2
RAID 2 records Error Correction Code using Hamming distance for its data, striped on
different disks. Like level 0, each data bit in a word is recorded on a separate disk and
ECC codes of the data words are stored on a different set disks. Due to its complex
structure and high cost, RAID 2 is not commercially available.

RAID 3
RAID 3 stripes the data onto multiple disks. The parity bit generated for data word is
stored on a different disk. This technique makes it to overcome single disk failures.
RAID 4
In this level, an entire block of data is written onto data disks and then the parity is
generated and stored on a different disk. Note that level 3 uses byte-level striping,
whereas level 4 uses block-level striping. Both level 3 and level 4 require at least three
disks to implement RAID.

RAID 5
RAID 5 writes whole data blocks onto different disks, but the parity bits generated for
data block stripe are distributed among all the data disks rather than storing them on a
different dedicated disk.

RAID 6
RAID 6 is an extension of level 5. In this level, two independent parities are generated
and stored in distributed fashion among multiple disks. Two parities provide additional
fault tolerance. This level requires at least four disk drives to implement RAID.

24. Explain web server database fundamentals. APR-12

WEB SERVER DATABASE FUNDAMENTLS


24. What are Client/Server Databases? Explain. (APR-13)(APR-15) ***
 In the Oracle client/server architecture, the database application and the
database are separated into two parts: a front-end or client portion, and a back-
end or server portion.
 The client executes the database application that accesses database information
and interacts with a user through the keyboard, screen, and pointing device such
as a mouse.
 The server executes the Oracle software and handles the functions required for
concurrent, shared data access to an Oracle database.
TWO-TIER CLIENT / SERVER

Two-tier Client / Server architecture is used for User Interface program and
Application Programs that runs on client side. An interface called ODBC(Open
Database Connectivity) provides an API that allow client side program to call the dbms.
Most DBMS vendors provide ODBC drivers. A client program may connect to several
DBMS's. In this architecture some variation of client is also possible for example in
some DBMS's more functionality is transferred to the client including data dictionary,
optimization etc. Such clients are called Data server.

THREE-TIER CLIENT / SERVER

Three-tier Client / Server database architecture is commonly used architecture for web
applications. Intermediate layer called Application server or Web Server stores the web
connectivity software and the business logic (constraints) part of application used to
access the right amount of data from the database server. This layer acts like medium
for sending partially processed data between the database server and the client.

24. Explain about Database Administration APR-16

Database administration:-
Database administration is a complex, often thankless chore. The collection of links on
this page will help you keep your DBMS humming along at peak performance. 
It consists of technical aspect creating and running the database. The basic task is
performance monitoring, backup and recovery and assigning and controlling security.
Database administrations are trained in detail to installing, configuring and operating
the DBMS.
Database administrator (DBA)
A DBA is a complex software package. Installing, running and upgrading a DBMS are
not trivial task. Even with personal computer based system, this task can be required
the service of fulltime person. Every data requires the service of a DBA which position
is generally staff who is trained in the administration of the particular DBMS.
Or
A database administrator (DBA) directs or performs all activities related to maintaining
a successful database environment. Responsibilities include designing, implementing,
and maintaining the database system; establishing policies and procedures pertaining to
the management, security, maintenance, and use of the database management system;
and training employees in database management and use. A DBA is usually expected to
have experience with one or more of the major database management products, such as
Structured Query Language, SAP, and Oracle-based database management software.

DBA task
o Install & upgrade DBMS
o Create user account and monitor security
o Manage backup and recovery of the database
o Monitor and the tune the database performance 
o Co-ordinate with DBMS vender and plan for changes
o Maintains DBMS- specific information’s for developer

General tasks 
Installation, configuration, upgrade, and migration
Although system administrators are generally responsible for the hardware and
operating system on a given server, installation of the database software is typically up
to the DBA. This job role requires knowledge of the hardware prerequisites for an
efficient database server, and communicating those requirements to the system
administrator. 

Backup and recovery


DBAs are responsible for developing, implementing, and periodically testing a backup
and recovery plan for the databases they manage. Even in large shops where a separate
system administrator performs server backups, the DBA has final responsibility for
making sure that the backups are being done as scheduled and that they include all the
files needed to make database recovery possible after a failure. When failures do occur,
the DBA needs to know how to use the backups to return the database to operational
status as quickly as possible, without losing any transactions that were committed.
There are several ways the database can fail, and the DBA must have a strategy to
recover from each. From a business standpoint, there is a cost to doing backups, and the
DBA makes management aware of the cost/risk trade-offs of various backup methods.

Database security
Because databases centralize the storage of data, they are attractive targets for hackers
and even curious employees. The DBA must understand the particular security model
that the database product uses and how to use it effectively to control access to the data.
The three basic security tasks are authentication (setting up user accounts to control
log-ins to the database), authorization (setting permissions on various parts of the
database), and auditing (tracking who did what with the database). The auditing task is
particularly important currently, as regulatory laws like Sarbanes-Oxley and HIPAA
have reporting requirements that must be met.
Storage and capacity planning
The primary purpose of a database is to store and retrieve data, so planning how much
disk storage will be required and monitoring available disk space are key DBA
responsibilities. Watching growth trends are important so that the DBA can advise
management on long-term capacity plans.

Performance monitoring and tuning


The DBA is responsible for monitoring the database server on a regular basis to identify
bottlenecks (parts of the system that are slowing down processing) and remedy them.
Tuning a database server is done on multiple levels. The capacity of the server
hardware and the way the operating system is configured can become limiting factors,
as can the database software configuration. The way the database is physically laid out
on the disk drives and the types of indexing chosen also have an effect. The way queries
against the database are coded can dramatically change how fast results are returned. A
DBA needs to understand which monitoring tools are available at each of these levels
and how to use them to tune the system. Proactive tuning is an attitude of designing
performance into an application from the start, rather than waiting for problems to
occur and fixing them. It requires working closely with developers of applications that
run against the database to make sure that best practices are followed so good
performance will result.

Troubleshooting
When things do go wrong with the database server, the DBA needs to know how to
quickly ascertain the problem and to correct it without losing data or making the
situation worse.

Data task by development 


Whichever development methodology you follow, certain database task are requires at
each step. Most of the tasks are performed by the applications developer, with co-
ordinate on with DBA.
a. Data planning-:
It this stage you will have to make a estimate of the data storage requirements. This
may helps to decide hardwire requirement of parallel processing number of forms and
reports needed etc.

b. Database design
The basic goals of the design stage are to identify the user needs and design the
appropriate data tables. Data normalization is the primary database related activity in
this state. The final table definition will also provide better estimates of the storage
requirement.

c. Data implementations 
Define standard for application programming. Development of the application and user
interface is the major step. Determine the overall looks and feels of application
programming standard and testing procedure are defined. 
d. Database operation and maintains
Once the database is place in operation the DBA performs most of the management
task. The primary tasks are 
a. monitor usage & security 
b. performs backup and recovery
c. support the users

DBMS QUESTIONS-NOVEMBER
2 MARKS

11. Who is DBA? NOV-12

 Centralized control of the database is exerted by a person or group of persons


under the supervision of a highlevel administrator.
 This person or group is referred to as the database administrator (DBA).
 They are the users who are most familiar with the database and are responsible
for creating, modifying, and maintaining its three levels.

12. Distinguish between Physical Security and Logical Security.NOV-12

Physical Security Logical Security


Physical security protects the site and  Logical security protects access to computer
everything located within the site. systems
Physical security prevents and discourages Logical security protects computer software
attackers from entering a building by, by discouraging user excess by
cameras, and administration access implementing user identifications,
controls. passwords, authentication, biometrics and
smart cards.
Methods for securing a network physically Logical security can consist of hardware
include educating personnel, administrative and software firewalls, anti-virus, anti-
controls, physical controls, technical spyware, anti-phishing apps, as well as other
controls, and environmental/life-safety protective applications.
controls.

11. What is the role of a database administrator? NOV-13

 Deciding the information content of the database


 Liaising with the users
 Defining a strategy for backup and recovery
 Monitoring performance and responsibilities to changes in requirements

12. What are the strengths of a distributed database?NOV-13


 Improved performance
 Efficiency
 Extensibility (addition of new nodes)
 Transparency of distribution
11. State the problems of logical security. NOV-14

 Viruses
 Untested
 User error
 Operator error
 Computer misuse

12. What is a disaster plan?NOV-14

 A Disaster plan is a complete list of the steps that the IS department will take if
the disaster hits the information system.
 The plan details who is in charge, what steps everyone will take, list contact
numbers etc.

11. Define: HTML. NOV-15

 HTML (Hypertext Markup Language) is the set of markup symbols or codes


inserted in a file intended for display on a World Wide Web browser page.
 "Hypertext" refers to the hyperlinks that an HTML page may contain.
 "Markup language" refers to the way tags are used to define the page layout
and elements within the page.

12. What is meant by Object Oriented Database? NOV-15


Object oriented databases are also called Object Database Management Systems
(ODBMS).
 Object databases store objects rather than data such as integers, strings or real
numbers.
 Objects are used in object oriented languages such as Smalltalk, C++, Java, and
others.

5 MARKS

18. Discuss in detail, Data Partitioning. NOV-12

 Partitioning a database improves performance and simplifies maintenance.


 By splitting a large table into smaller, individual tables, queries that access only
a fraction of the data can run faster because there is less data to scan.
Maintenance tasks, such as rebuilding indexes or backing up a table, can run
more quickly.

Horizontal partitioning
 Horizontal partitioning divides a table into multiple tables. Each table then
contains the same number of columns, but fewer rows.
 For example, a table that contains 1 billion rows could be partitioned
horizontally into 12 tables, with each smaller table representing one month of
data for a specific year. Any queries requiring data for a specific month only
reference the appropriate table.
 Determining how to partition the tables horizontally depends on how data is
analyzed. You should partition the tables so that queries reference as few tables
as possible. Otherwise, excessive UNION queries, used to merge the tables
logically at query time, can affect performance. 
Vertical partioning
Vertical partitioning divides a table into multiple tables that contain fewer columns.
The two types of vertical partitioning are normalization and row splitting:
 Normalization is the standard database process of removing redundant columns
from a table and putting them in secondary tables that are linked to the primary
table by primary key and foreign key relationships.
 Row splitting divides the original table vertically into tables with fewer columns.
Each logical row in a split table matches the same logical row in the other tables
as identified by a UNIQUE KEY column that is identical in all of the partitioned
tables. For example, joining the row with ID 712 from each split table re-creates
the original row.

19. Write about Database Tasks by Development Stages. NOV-12

Stages of Development
Software development consists of a sequence of stages. The following subsections
elaborate on each stage:

 Analysis. Model the application from the perspective of the real world
 Design. Decide how to build the application from the analysis model
 Implementation. Write the actual database and programming code
 Data conversion. Populate the application database with available data.
 Testing. Ensure that the application is suitable for actual use.
 Training. Help users master the new application.
 Maintenance. Preserve the soundness of the application over the long term.
Analysis
Modeling is the focus of analysis. Analysis prepares a model of the application from the
perspective of the real world. During analysis, you specify what must be done, not how it
should be done. Analysis is a difficult task in its own right, and developers must fully
understand it before addressing the additional complexities of design.
The preparation of a model and architecture must be interleaved for complex
applications. The architecture helps to establish a model's scope. In turn, modeling
reveals important issues of strategy to resolve. Thus, there is much interplay between
the construction of a model and the model's architecture, and they must happen
together.

During analysis, developers consider the available inputs and resolve ambiguities.
Often, business experts are not sure of the precise requirements, and must refine them
in tandem with software development. Modeling quickens the convergence between
developers and business experts because it is much faster to work with multiple
iterations of models than with code. Models highlight omissions and inconsistencies so
that they can be resolved.

Design
During design, the focus shifts from an emphasis on the real world to techniques for
realizing the application. Developers address how a problem is to be solved, but they
don't descend into the fine details of the target database and programming language.
Thus, during design, developers should convert a model to relational database tables,
for example; but they should defer the idiosyncrasies of a specific database manager,
such as Oracle.

The first step of design is to devise an architecture. For complex problems, you must
coordinate the development of an architecture with an analysis model. Next, you choose
a specific data management approach—whether to use simple files (which suffice for
some applications), a database manager, or possibly something else. Developers then
determine the data structures and algorithms that will realize the model from analysis.

Implementation
Implementation is the stage of writing the actual code. it is at this point that developers
must deal with the nuances of the specific database manager and programming
languages that are being used to construct the system. Developers should take the
design model and drive it into the database structure. Once they establish a sound
database, they can write programming logic and build a user interface. Tools can
generate the code for creating an empty database.

Data Conversion
Data conversion adds existing data to a database. Data conversion is often an intricate
task; source databases can be difficult to understand. In addition, the source data
structure rarely matches the target data structure. Many source databases have data
flaws that must be repaired.
Testing
After implementation, the system is complete, but it must be carefully tested before it
can be commissioned for actual use. Hopefully, the ideas that inspired the original
project were nurtured through the previous stages by the use of models. Testers once
again look at the original business requirements and verify that the system delivers the
proper functionality. Testing can also uncover accidental errors (bugs) that were
introduced. If an application runs on multiple hardware and operating system
platforms, it should be tested on all of them.

Training
An organization must train users so that it can benefit fully from an application.
Training accelerates users on the software learning curve.

Maintenance
Once development is complete and a system has been deployed, it must be maintained
for continued success. There are several kinds of maintenance. Bugs that remain in the
original system will gradually appear during use and must be fixed. A successful
application will also trigger requests for enhancements, and a long-lived application will
occasionally have to be restructured.

18. Write a short note on data clustering. NOV-13

Clustering, in the context of databases, refers to the ability of several servers or


instances to connect to a single database. An instance is the collection of memory and
processes that interacts with a database, which is the set of physical files that actually
store data.
Clustering offers two major advantages, especially in high-volume database
environments:

 Fault tolerance: Because there is more than one server or instance for users to
connect to, clustering offers an alternative, in the event of individual server
failure.
 Load balancing: The clustering feature is usually set up to allow users to be
automatically allocated to the server with the least load.

Clustering takes different forms, depending on how the data is stored and allocated
resources. The first type is known as the shared-nothing architecture. In this clustering
mode, each node/server is fully independent, so there is no single point of contention. An
example of this would be when a company has multiple data centers for a single website.
With many servers across the globe, no single server is a “master.” Shared-nothing is
also known as “database sharding.”
19. Describe the client/server database. NOV-13

 In the Oracle client/server architecture, the database application and the


database are separated into two parts: a front-end or client portion, and a back-
end or server portion.
 The client executes the database application that accesses database information
and interacts with a user through the keyboard, screen, and pointing device such
as a mouse.
 The server executes the Oracle software and handles the functions required for
concurrent, shared data access to an Oracle database.

TWO-TIER CLIENT / SERVER

Two-tier Client / Server architecture is used for User Interface program and
Application Programs that runs on client side. An interface called ODBC(Open
Database Connectivity) provides an API that allow client side program to call the dbms.
Most DBMS vendors provide ODBC drivers. A client program may connect to several
DBMS's. In this architecture some variation of client is also possible for example in
some DBMS's more functionality is transferred to the client including data dictionary,
optimization etc. Such clients are called Data server.

THREE-TIER CLIENT / SERVER


Three-tier Client / Server database architecture is commonly used architecture for web
applications. Intermediate layer called Application server or Web Server stores the web
connectivity software and the business logic (constraints) part of application used to
access the right amount of data from the database server. This layer acts like medium
for sending partially processed data between the database server and the client.

18. Discuss about backup and recovery. NOV-14

DATA BACKUP
In a computer system we have primary and secondary memory storage. Primary
memory storage devices - RAM is a volatile memory which stores disk buffer, active
logs, and other related data of a database. It stores all the recent transactions and the
results too. When a query is fired, the database first fetches in the primary memory for
the data, if it does not exist there, then it moves to the secondary memory to fetch the
record. Fetching the record from primary memory is always faster than secondary
memory.  What happens if the primary memory crashes? All the data in the primary
memory is lost and we cannot recover the database.
In such cases, we can follow any one the following steps so that data in the primary
memory are not lost.
 We can create a copy of primary memory in the database with all the logs and buffers,
and are copied periodically into database. So in case of any failure, we will not lose all
the data. We can recover the data till the point it is last copied to the database.
 We can have checkpoints created at several places so that data is copied to the database.
Suppose the secondary memory itself crashes. What happens to the data stored in it?
All the data are lost and we cannot recover. We have to think of some alternative
solution for this because we cannot afford for loss of data in huge database.
There are three methods used to back up the data in the secondary memory, so that it
can be recovered if there is any failure.
 Remote Backup: - Database copy is created and stored in the remote network. This
database is periodically updated with the current database so that it will be in sync with
data and other details. This remote database can be updated manually called offline
backup. It can be backed up online where the data is updated at current and remote
database simultaneously. In this case, as soon as there is a failure of current database,
system automatically switches to the remote database and starts functioning. The user
will not know that there was a failure.
 In the second method, database is copied to memory devices like magnetic tapes and
kept at secured place. If there is any failure, the data would be copied from these tapes
to bring the database up.
 As the database grows, it is an overhead to backup whole database. Hence only the log
files are backed up at regular intervals. These log files will have all the information
about the transaction being made. So seeing these log files, database can be recovered.
In this method log files are backed up at regular intervals, and database is backed up
once in a week.
There are two types of data backup – physical data backup and Logical data backup.
The physical data backup includes physical files like data files, log files, control files,
redo- undo logs etc. They are the foundation of the recovery mechanism in the database
as they provide the minute details about the transactions and modification to the
database
Logical backup includes backup of logical data like tables, views, procedures, functions
etc. Logical data backup alone is not sufficient to recover the database as they provide
only the structural information. The physical data back actually provides the minute
details about the database and is very much important for recovery.

RECOVERY
A database is a very huge system with lots of data and transaction. The transaction in
the database is executed at each seconds of time and is very critical to the database. If
there is any failure or crash while executing the transaction, then it expected that no
data is lost. It is necessary to revert the changes of transaction to previously committed
point. There are various techniques to recover the data depending on the type of failure
or crash.
 Transaction Failure: - This is the condition in the transaction where a
transaction cannot execute it further. This type of failure affects only few
tables or processes. The failure can be because of logical errors in the code or
because of system errors like deadlock or unavailability of system resources to
execute the transactions.

 System Crash: - this can be because of hardware or software failure or because


of external factors like power failure. In most of the cases data in the
secondary memory are not affected because of this crash. This is because; the
database has lots of integrity checkpoints to prevent the data loss from
secondary memory.

 Disk Failure: - these are the issues with hard disks like formation of bad sectors,
disk head crash, unavailability of disk etc.

19. Explain the Web as a Client/Server System. NOV-14

HTML LIMITED CLIENTS


<HTML>
<HEAD>
<TITLE>My main page</TITLE></HEAD>
<BODY BACKGROUND=“graphics/back0.jpg”>
<P>My text goes in paragraphs.</P>
<P>Additional tags set <B>boldface</B> and <I>Italic</I>.
<P>Tables are more complicated and use a set of tags for rows and columns.</P>
<TABLE BORDER=1>
<TR><TD>First cell</TD><TD>Second cell</TD></TR>
<TR><TD>Next row</TD><TD>Second column</TD></TR>
</TABLE>
<P>There are form tags to create input forms for collecting data.
But you need CGI program code to convert and use the input data.</P>
</BODY>
</HTML>
OUTPUT:
My text goes in paragraphs.

Additional tags set boldface and Italic .

Tables are more complicated and use a set of tags

for rows and columns.

First cell Second cell

Next row Second column

There are form tags to create input forms for

collecting data. But you need CGI program code

to convert and use the input data.

WEB SERVER DATABASE FUNDAMENTLS


18. Discuss the Table Operations. NOV-15

Creating a basic table involves naming the table and defining its columns and each
column's data type.
The SQL CREATE TABLE statement is used to create a new table.
Syntax:
Basic syntax of CREATE TABLE statement is as follows:
CREATE TABLE table_name(
column1 datatype,
column2 datatype,
column3 datatype,
.....
columnN datatype,
PRIMARY KEY( one or more columns )
);
CREATE TABLE is the keyword telling the database system what you want to do. The
unique name or identifier for the table follows the CREATE TABLE statement.
Then in brackets comes the list defining each column in the table and what sort of data
type it is. The syntax becomes clearer with an example below.
A copy of an existing table can be created using a combination of the CREATE TABLE
statement and the SELECT statement.
Example:
Following is an example, which creates a CUSTOMERS table with ID as primary key
and NOT NULL are the constraints showing that these fields can not be NULL while
creating records in this table:
SQL> CREATE TABLE CUSTOMERS(
ID INT NOT NULL,
NAME VARCHAR (20) NOT NULL,
AGE INT NOT NULL,
ADDRESS CHAR (25) ,
SALARY DECIMAL (18, 2),
PRIMARY KEY (ID)
);
You can verify if your table has been created successfully by looking at the message
displayed by the SQL server, otherwise you can use DESC command as follows:
SQL>DESC CUSTOMERS;
Field Type Null Key Default extra
ID Int(11) No Pri
NAME Varchar(20) No
AGE Int(11) No
ADRESS Char(25) Yes NULL
SALARY Decimal(18,2) yes NULL
Now, you have CUSTOMERS table available in your database which you can use to
store required information related to customers.

19. Write Short Notes on: Client/Server Databases. NOV-15

In the Oracle client/server architecture, the database application and the
database are separated into two parts: a front-end or client portion, and a back-
end or server portion.
 The client executes the database application that accesses database information
and interacts with a user through the keyboard, screen, and pointing device such
as a mouse.
 The server executes the Oracle software and handles the functions required for
concurrent, shared data access to an Oracle database.
TWO-TIER CLIENT / SERVER
Two-tier Client / Server architecture is used for User Interface program and
Application Programs that runs on client side. An interface called ODBC(Open
Database Connectivity) provides an API that allow client side program to call the dbms.
Most DBMS vendors provide ODBC drivers. A client program may connect to several
DBMS's. In this architecture some variation of client is also possible for example in
some DBMS's more functionality is transferred to the client including data dictionary,
optimization etc. Such clients are called Data server.

THREE-TIER CLIENT / SERVER

Three-tier Client / Server database architecture is commonly used architecture for web
applications. Intermediate layer called Application server or Web Server stores the web
connectivity software and the business logic (constraints) part of application used to
access the right amount of data from the database server. This layer acts like medium
for sending partially processed data between the database server and the client.
10 MARKS

23. Explain the User Interface Features. NOV-12

 The user interface (UI), in the industrial design field of human–machine


interaction, is the space where interactions between humans and machines occur.
 The goal of this interaction is to allow effective operation and control of the
machine from the human end, whilst the machine simultaneously feeds back
information that aids the operators' decision-making process.
 Examples of this broad concept of user interfaces include the interactive aspects
of computer operating systems, hand tools, heavy machinery operator controls,
and process controls. The design considerations applicable when creating user
interfaces are related to or involve such disciplines as ergonomics and psychology.

7. Menu-Based Interfaces for Web Clients or Browsing :These interfaces present the user
with lists of options, called menus, that lead the user through the formulation of a
request. Menus do away with the need to memorize the specific commands and syntax
of a query language; rather, the query is composed step by step by picking options from
a menu that is displayed by the system. Pull-down menus are a very popular technique
in Web-based user interfaces. They are also often used in browsing interfaces, which
allow a user to look through the contents of a database in an exploratory and
unstructured manner.

8. Forms-Based Interfaces : A forms-based interface displays a form to each user. Users
can fill out all of the form entries to insert new data, or they fill out only certain entries,
in which case the DBMS will retrieve matching data for the remaining entries. Forms
are usually designed and programmed for naive users as interfaces to canned
transactions. Many DBMSs have forms specification languages, which are special
languages that help programmers specify such forms. Some systems have utilities that
define a form by letting the end user interactively construct a sample form on the
screen.

9. Graphical User Interfaces : A graphical interface (CUI) typically displays a schema to
the user in diagrammatic form. The user can then specify a query by manipulating the
diagram. In many cases, CUIs utilize both menus and forms. Most CUIs use a pointing
device, such as a mouse, to pick certain parts of the displayed schema diagram.

10. Natural Language Interfaces : These interfaces accept requests written in English or
some other language and attempt to "understand" them. A natural language interface
usually has its own "schema," which is similar to the database conceptual schema, as
well as a dictionary of important words. The natural language interface refers to the
words in its schema, as well as to the set of standard words in its dictionary, to interpret
the request. If the interpretation is successful, the interface generates a high-level query
corresponding to the natural language request and submits it to the DBMS for
processing; otherwise, a dialogue is started with the user to clarify the request.

11. Interfaces for Parametri c Users : Parametric users, such as bank tellers, often have a
small set of operations that they must perform repeatedly. Systems analysts and
programmers design and implement a special interface for each known class of naive
users. Usually, a small set of abbreviated commands is included, with the goal of
minimizing the number of keystrokes required for each request.

12. Interfaces for the DBA : Most database systems contain privileged commands that can
be used only by the DBA's staff. These include commands for creating accounts, setting
system parameters, granting account authorization, changing a schema, and
reorganizing the storage structures of a database.

24. Describe in detail, Distributed Databases.


A distributed database is a collection of multiple interconnected databases, which are
spread physically across various locations that communicate via a computer network.
Features
 Databases in the collection are logically interrelated with each other. Often they
represent a single logical database.
 Data is physically stored across multiple sites. Data in each site can be managed by a
DBMS independent of the other sites.
 The processors in the sites are connected via a network. They do not have any
multiprocessor configuration.
 A distributed database is not a loosely connected file system.
 A distributed database incorporates transaction processing, but it is not synonymous
with a transaction processing system.
Distributed Database Management System
A distributed database management system (DDBMS) is a centralized software system
that manages a distributed database in a manner as if it were all stored in a single
location.
Features
 It is used to create, retrieve, update and delete distributed databases.
 It synchronizes the database periodically and provides access mechanisms by the virtue
of which the distribution becomes transparent to the users.
 It ensures that the data modified at any site is universally updated.
 It is used in application areas where large volumes of data are processed and accessed
by numerous users simultaneously.
 It is designed for heterogeneous database platforms.
 It maintains confidentiality and data integrity of the databases.
Factors Encouraging DDBMS
The following factors encourage moving over to DDBMS −
 Distributed Nature of Organizational Units − Most organizations in the current times
are subdivided into multiple units that are physically distributed over the globe. Each
unit requires its own set of local data. Thus, the overall database of the organization
becomes distributed.
 Need for Sharing of Data − The multiple organizational units often need to
communicate with each other and share their data and resources. This demands
common databases or replicated databases that should be used in a synchronized
manner.
 Support for Both OLTP and OLAP  − Online Transaction Processing (OLTP) and
Online Analytical Processing (OLAP) work upon diversified systems which may have
common data. Distributed database systems aid both these processing by providing
synchronized data.
 Database Recovery − One of the common techniques used in DDBMS is replication of
data across different sites. Replication of data automatically helps in data recovery if
database in any site is damaged. Users can access data from other sites while the
damaged site is being reconstructed. Thus, database failure may become almost
inconspicuous to users.
 Support for Multiple Application Software − Most organizations use a variety of
application software each with its specific database support. DDBMS provides a
uniform functionality for using the same data among different platforms.
Advantages of Distributed Databases
Following are the advantages of distributed databases over centralized databases.
Modular Development − If the system needs to be expanded to new locations or new
units, in centralized database systems, the action requires substantial efforts and
disruption in the existing functioning. However, in distributed databases, the work
simply requires adding new computers and local data to the new site and finally
connecting them to the distributed system, with no interruption in current functions.
More Reliable − In case of database failures, the total system of centralized databases
comes to a halt. However, in distributed systems, when a component fails, the
functioning of the system continues may be at a reduced performance. Hence DDBMS is
more reliable.
Better Response − If data is distributed in an efficient manner, then user requests can
be met from local data itself, thus providing faster response. On the other hand, in
centralized systems, all queries have to pass through the central computer for
processing, which increases the response time.
Lower Communication Cost − In distributed database systems, if data is located locally
where it is mostly used, then the communication costs for data manipulation can be
minimized. This is not feasible in centralized systems.
Adversities of Distributed Databases
Following are some of the adversities associated with distributed databases.
 Need for complex and expensive software − DDBMS demands complex and often
expensive software to provide data transparency and co-ordination across the several
sites.
 Processing overhead − Even simple operations may require a large number of
communications and additional calculations to provide uniformity in data across the
sites.
 Data integrity − The need for updating data in multiple sites pose problems of data
integrity.
 Overheads for improper data distribution − Responsiveness of queries is largely
dependent upon proper data distribution. Improper data distribution often leads to
very slow response to user requests.
23. Explain in detail about the user interface features. NOV-13

 The user interface (UI), in the industrial design field of human–machine


interaction, is the space where interactions between humans and machines occur.
 The goal of this interaction is to allow effective operation and control of the
machine from the human end, whilst the machine simultaneously feeds back
information that aids the operators' decision-making process.
 Examples of this broad concept of user interfaces include the interactive aspects
of computer operating systems, hand tools, heavy machinery operator controls,
and process controls. The design considerations applicable when creating user
interfaces are related to or involve such disciplines as ergonomics and psychology.

13. Menu-Based Interfaces for Web Clients or Browsing :These interfaces present the user
with lists of options, called menus, that lead the user through the formulation of a
request. Menus do away with the need to memorize the specific commands and syntax
of a query language; rather, the query is composed step by step by picking options from
a menu that is displayed by the system. Pull-down menus are a very popular technique
in Web-based user interfaces. They are also often used in browsing interfaces, which
allow a user to look through the contents of a database in an exploratory and
unstructured manner.

14. Forms-Based Interfaces : A forms-based interface displays a form to each user. Users
can fill out all of the form entries to insert new data, or they fill out only certain entries,
in which case the DBMS will retrieve matching data for the remaining entries. Forms
are usually designed and programmed for naive users as interfaces to canned
transactions. Many DBMSs have forms specification languages, which are special
languages that help programmers specify such forms. Some systems have utilities that
define a form by letting the end user interactively construct a sample form on the
screen.

15. Graphical User Interfaces : A graphical interface (CUI) typically displays a schema to
the user in diagrammatic form. The user can then specify a query by manipulating the
diagram. In many cases, CUIs utilize both menus and forms. Most CUIs use a pointing
device, such as a mouse, to pick certain parts of the displayed schema diagram.

16. Natural Language Interfaces : These interfaces accept requests written in English or
some other language and attempt to "understand" them. A natural language interface
usually has its own "schema," which is similar to the database conceptual schema, as
well as a dictionary of important words. The natural language interface refers to the
words in its schema, as well as to the set of standard words in its dictionary, to interpret
the request. If the interpretation is successful, the interface generates a high-level query
corresponding to the natural language request and submits it to the DBMS for
processing; otherwise, a dialogue is started with the user to clarify the request.

17. Interfaces for Parametri c Users : Parametric users, such as bank tellers, often have a
small set of operations that they must perform repeatedly. Systems analysts and
programmers design and implement a special interface for each known class of naive
users. Usually, a small set of abbreviated commands is included, with the goal of
minimizing the number of keystrokes required for each request.

18. Interfaces for the DBA : Most database systems contain privileged commands that can
be used only by the DBA's staff. These include commands for creating accounts, setting
system parameters, granting account authorization, changing a schema, and
reorganizing the storage structures of a database.

24. What are the development stages of a database tasks? NOV-13

Stages of Development
Software development consists of a sequence of stages. The following subsections
elaborate on each stage:

 Analysis. Model the application from the perspective of the real world
 Design. Decide how to build the application from the analysis model
 Implementation. Write the actual database and programming code
 Data conversion. Populate the application database with available data.
 Testing. Ensure that the application is suitable for actual use.
 Training. Help users master the new application.
 Maintenance. Preserve the soundness of the application over the long term.
Analysis
Modeling is the focus of analysis. Analysis prepares a model of the application from the
perspective of the real world. During analysis, you specify what must be done, not how it
should be done. Analysis is a difficult task in its own right, and developers must fully
understand it before addressing the additional complexities of design.

The preparation of a model and architecture must be interleaved for complex


applications. The architecture helps to establish a model's scope. In turn, modeling
reveals important issues of strategy to resolve. Thus, there is much interplay between
the construction of a model and the model's architecture, and they must happen
together.

During analysis, developers consider the available inputs and resolve ambiguities.
Often, business experts are not sure of the precise requirements, and must refine them
in tandem with software development. Modeling quickens the convergence between
developers and business experts because it is much faster to work with multiple
iterations of models than with code. Models highlight omissions and inconsistencies so
that they can be resolved.

Design
During design, the focus shifts from an emphasis on the real world to techniques for
realizing the application. Developers address how a problem is to be solved, but they
don't descend into the fine details of the target database and programming language.
Thus, during design, developers should convert a model to relational database tables,
for example; but they should defer the idiosyncrasies of a specific database manager,
such as Oracle.

The first step of design is to devise an architecture. For complex problems, you must
coordinate the development of an architecture with an analysis model. Next, you choose
a specific data management approach—whether to use simple files (which suffice for
some applications), a database manager, or possibly something else. Developers then
determine the data structures and algorithms that will realize the model from analysis.

Implementation
Implementation is the stage of writing the actual code. it is at this point that developers
must deal with the nuances of the specific database manager and programming
languages that are being used to construct the system. Developers should take the
design model and drive it into the database structure. Once they establish a sound
database, they can write programming logic and build a user interface. Tools can
generate the code for creating an empty database.

Data Conversion
Data conversion adds existing data to a database. Data conversion is often an intricate
task; source databases can be difficult to understand. In addition, the source data
structure rarely matches the target data structure. Many source databases have data
flaws that must be repaired.

Testing
After implementation, the system is complete, but it must be carefully tested before it
can be commissioned for actual use. Hopefully, the ideas that inspired the original
project were nurtured through the previous stages by the use of models. Testers once
again look at the original business requirements and verify that the system delivers the
proper functionality. Testing can also uncover accidental errors (bugs) that were
introduced. If an application runs on multiple hardware and operating system
platforms, it should be tested on all of them.

Training
An organization must train users so that it can benefit fully from an application.
Training accelerates users on the software learning curve.

Maintenance
Once development is complete and a system has been deployed, it must be maintained
for continued success. There are several kinds of maintenance. Bugs that remain in the
original system will gradually appear during use and must be fixed. A successful
application will also trigger requests for enhancements, and a long-lived application will
occasionally have to be restructured.

23. Describe the three primary data storage methods. NOV-14

Databases are stored in file formats, which contain records. At physical level, the actual
data is stored in electromagnetic format on some device. These storage devices can be
broadly categorized into three types −

 Primary Storage − The memory storage that is directly accessible to the CPU comes
under this category. CPU's internal memory (registers), fast memory (cache), and main
memory (RAM) are directly accessible to the CPU, as they are all placed on the
motherboard or CPU chipset. This storage is typically very small, ultra-fast, and
volatile. Primary storage requires continuous power supply in order to maintain its
state. In case of a power failure, all its data is lost.
 Secondary Storage − Secondary storage devices are used to store data for future use or
as backup. Secondary storage includes memory devices that are not a part of the CPU
chipset or motherboard, for example, magnetic disks, optical disks (DVD, CD, etc.),
hard disks, flash drives, and magnetic tapes.
 Tertiary Storage − Tertiary storage is used to store huge volumes of data. Since such
storage devices are external to the computer system, they are the slowest in speed. These
storage devices are mostly used to take the back up of an entire system. Optical disks
and magnetic tapes are widely used as tertiary storage.
Memory Hierarchy
A computer system has a well-defined hierarchy of memory. A CPU has direct access to
it main memory as well as its inbuilt registers. The access time of the main memory is
obviously less than the CPU speed. To minimize this speed mismatch, cache memory is
introduced. Cache memory provides the fastest access time and it contains data that is
most frequently accessed by the CPU.
The memory with the fastest access is the costliest one. Larger storage devices offer slow
speed and they are less expensive, however they can store huge volumes of data as
compared to CPU registers or cache memory.
Magnetic Disks
Hard disk drives are the most common secondary storage devices in present computer
systems. These are called magnetic disks because they use the concept of magnetization
to store information. Hard disks consist of metal disks coated with magnetizable
material. These disks are placed vertically on a spindle. A read/write head moves in
between the disks and is used to magnetize or de-magnetize the spot under it. A
magnetized spot can be recognized as 0 (zero) or 1 (one).
Hard disks are formatted in a well-defined order to store data efficiently. A hard disk
plate has many concentric circles on it, called tracks. Every track is further divided
into sectors. A sector on a hard disk typically stores 512 bytes of data.
Redundant Array of Independent Disks
RAID or Redundant Array of Independent Disks, is a technology to connect multiple
secondary storage devices and use them as a single storage media.
RAID consists of an array of disks in which multiple disks are connected together to
achieve different goals. RAID levels define the use of disk arrays.
RAID 0
In this level, a striped array of disks is implemented. The data is broken down into
blocks and the blocks are distributed among disks. Each disk receives a block of data to
write/read in parallel. It enhances the speed and performance of the storage device.
There is no parity and backup in Level 0.
RAID 1
RAID 1 uses mirroring techniques. When data is sent to a RAID controller, it sends a
copy of data to all the disks in the array. RAID level 1 is also calledmirroring and
provides 100% redundancy in case of a failure.

RAID 2
RAID 2 records Error Correction Code using Hamming distance for its data, striped on
different disks. Like level 0, each data bit in a word is recorded on a separate disk and
ECC codes of the data words are stored on a different set disks. Due to its complex
structure and high cost, RAID 2 is not commercially available.

RAID 3
RAID 3 stripes the data onto multiple disks. The parity bit generated for data word is
stored on a different disk. This technique makes it to overcome single disk failures.

RAID 4
In this level, an entire block of data is written onto data disks and then the parity is
generated and stored on a different disk. Note that level 3 uses byte-level striping,
whereas level 4 uses block-level striping. Both level 3 and level 4 require at least three
disks to implement RAID.

RAID 5
RAID 5 writes whole data blocks onto different disks, but the parity bits generated for
data block stripe are distributed among all the data disks rather than storing them on a
different dedicated disk.

RAID 6
RAID 6 is an extension of level 5. In this level, two independent parities are generated
and stored in distributed fashion among multiple disks. Two parities provide additional
fault tolerance. This level requires at least four disk drives to implement RAID.

24. Discuss about database security and privacy. NOV-14

Privacy and Security

Database security: protecting the database from unauthorized access, modification, or


destruction
Privacy: the right of individuals to have some control over information about
themselves
 protected by laws in many countries
 these laws can vary significantly
Right to privacy can be protected by the database management system
 
 
Accidental Security Threats
User errors
 User unintentionally requests object or operation for which he/she should not be
authorized
Communications system errors
 User sent a message that should be sent to another user
 system connects a user to a session that belongs to another user with different access
privileges
OS errors
 Accidentally overwrites files and destroys part of database
 Fetches the wrong files and sends them to the user
 Fails to erase files that should be erased
 
Deliberate Security Threats
Sources
 User intentionally gains unauthorized access and/or performs unauthorized operations
on the database for personal gain
 Disgruntled employee who is familiar with the organization's computer system seeks
revenge (terminated employees are especially dangerous)
 Industrial spies seek information for competitors
Methods
 Wiretapping of communication lines
 Electronic eavesdropping-picking up electronic signals
 Reading display screens or printouts left unsupervised
 Impersonating authorized users or users with greater access
 Writing programs to bypass the DBMS and access database data directly
 Writing applications programs that perform unauthorized operations
 Deriving information about hidden data by clever querying
 Removing physical storage devices from the computer facility
 Making copies of stored files without going through the DBMS
 Bribing, blackmailing or influencing authorized users to obtain information or damage
the database
 
Security Plan
Should begin with physical security measures for the building-physical barriers, control
access, require badges, sign-in etc.
Should have more physical security for the computer facilities-e.g. locked door
Additional security control for database
Authentication
 User authentication - verifying the identity of users
 Operating system uses user profiles, user ids, passwords, authentication procedures,
badges, keys, or physical characteristics of the user
 Additional authentication can be required to access the database-additional user ID,
PW
User Profiles
 System has a user profile for each id, giving information about the user
 Stored profiles should be kept secure, possibly in encrypted form
 Profile normally includes a password, allegedly known only to the user
 Passwords should be kept secret and changed frequently
 System should never display passwords at sign-in time
 
Other Authentication Procedures
Password limitations-users write them down, choose words that are easy to guess, or
share them
Could require users to insert badges or keys to log on to a workstation
Voice, fingerprints, retina scans, or other physical characteristics can be used
Authentication procedure can be series of questions-takes longer and is more difficult to
reproduce than PW
Authentication can be required again at the database
User should be required to produce an additional PW to access the database
 
Authorization
DBMSs designed for multiple users have a security subsystem
Provide for authorization-users are assigned rights to use database objects
Authorization language--allows the DBA to write authorization rules specifying which
users have what type of access to database objects
 
Access Control
Access control covers the mechanisms for implementing authorizations
Access control matrix (users X operations X database objects)
 Planning tool to identify operations different users are permitted to perform on various
database objects
 List users in left column; objects on top row; write operations permitted at intersection
DBA can delegate authorization powers to others-requires careful planning to avoid
abuse
Access Matrix
This is the abstract data structure to record WHAT is accessible, by WHOM, and HOW
Access Matrix
TABLE U (Attr
USER TABLE T (Attr a) TABLE T (Attr b) ... TABLE U (Attr c)
a)
SELECT, AGGR, SELECT,
User1   SELECT SELECT
UPDATE AGGREG
SELECT, SELECT,
User2 AGGR AGGR  
UPDATE UPDATE
User3 ALL ALL   ALL ALL
           
There can be levels of privilege:
ALL > UPDATE > SELECT > AGGREGATE > NONE
 
 Security Mechanisms
Views-simple method for access control

Security log-journal for storing records of attempted security violations

Audit trail-records all access to the database -requestor, operation performed,


workstation used, time, data items and values involved
Triggers can be used to set up an audit trail
Encryption of database data also protects it

23. Describe about Data Clustering and Partitioning. NOV-15

DATA CLUSTERING
Clustering, in the context of databases, refers to the ability of several servers or
instances to connect to a single database. An instance is the collection of memory and
processes that interacts with a database, which is the set of physical files that actually
store data.
Clustering offers two major advantages, especially in high-volume database
environments:

 Fault tolerance: Because there is more than one server or instance for users to
connect to, clustering offers an alternative, in the event of individual server
failure.
 Load balancing: The clustering feature is usually set up to allow users to be
automatically allocated to the server with the least load.

Clustering takes different forms, depending on how the data is stored and allocated
resources. The first type is known as the shared-nothing architecture. In this clustering
mode, each node/server is fully independent, so there is no single point of contention. An
example of this would be when a company has multiple data centers for a single website.
With many servers across the globe, no single server is a “master.” Shared-nothing is
also known as “database sharding.”

DATA PARTIONING
 Partitioning a database improves performance and simplifies maintenance.
 By splitting a large table into smaller, individual tables, queries that access only
a fraction of the data can run faster because there is less data to scan.
Maintenance tasks, such as rebuilding indexes or backing up a table, can run
more quickly.

Horizontal partitioning
 Horizontal partitioning divides a table into multiple tables. Each table then
contains the same number of columns, but fewer rows.
 For example, a table that contains 1 billion rows could be partitioned
horizontally into 12 tables, with each smaller table representing one month of
data for a specific year. Any queries requiring data for a specific month only
reference the appropriate table.
 Determining how to partition the tables horizontally depends on how data is
analyzed. You should partition the tables so that queries reference as few tables
as possible. Otherwise, excessive UNION queries, used to merge the tables
logically at query time, can affect performance. 
Vertical partioning
Vertical partitioning divides a table into multiple tables that contain fewer columns.
The two types of vertical partitioning are normalization and row splitting:
 Normalization is the standard database process of removing redundant columns
from a table and putting them in secondary tables that are linked to the primary
table by primary key and foreign key relationships.
 Row splitting divides the original table vertically into tables with fewer columns.
Each logical row in a split table matches the same logical row in the other tables
as identified by a UNIQUE KEY column that is identical in all of the partitioned
tables. For example, joining the row with ID 712 from each split table re-creates
the original row.

24. Explain the Database Tasks by Development Stages. NOV-15

Stages of Development
Software development consists of a sequence of stages. The following subsections
elaborate on each stage:

 Analysis. Model the application from the perspective of the real world
 Design. Decide how to build the application from the analysis model
 Implementation. Write the actual database and programming code
 Data conversion. Populate the application database with available data.
 Testing. Ensure that the application is suitable for actual use.
 Training. Help users master the new application.
 Maintenance. Preserve the soundness of the application over the long term.
Analysis
Modeling is the focus of analysis. Analysis prepares a model of the application from the
perspective of the real world. During analysis, you specify what must be done, not how it
should be done. Analysis is a difficult task in its own right, and developers must fully
understand it before addressing the additional complexities of design.

The preparation of a model and architecture must be interleaved for complex


applications. The architecture helps to establish a model's scope. In turn, modeling
reveals important issues of strategy to resolve. Thus, there is much interplay between
the construction of a model and the model's architecture, and they must happen
together.

During analysis, developers consider the available inputs and resolve ambiguities.
Often, business experts are not sure of the precise requirements, and must refine them
in tandem with software development. Modeling quickens the convergence between
developers and business experts because it is much faster to work with multiple
iterations of models than with code. Models highlight omissions and inconsistencies so
that they can be resolved.
Design
During design, the focus shifts from an emphasis on the real world to techniques for
realizing the application. Developers address how a problem is to be solved, but they
don't descend into the fine details of the target database and programming language.
Thus, during design, developers should convert a model to relational database tables,
for example; but they should defer the idiosyncrasies of a specific database manager,
such as Oracle.

The first step of design is to devise an architecture. For complex problems, you must
coordinate the development of an architecture with an analysis model. Next, you choose
a specific data management approach—whether to use simple files (which suffice for
some applications), a database manager, or possibly something else. Developers then
determine the data structures and algorithms that will realize the model from analysis.

Implementation
Implementation is the stage of writing the actual code. it is at this point that developers
must deal with the nuances of the specific database manager and programming
languages that are being used to construct the system. Developers should take the
design model and drive it into the database structure. Once they establish a sound
database, they can write programming logic and build a user interface. Tools can
generate the code for creating an empty database.

Data Conversion
Data conversion adds existing data to a database. Data conversion is often an intricate
task; source databases can be difficult to understand. In addition, the source data
structure rarely matches the target data structure. Many source databases have data
flaws that must be repaired.

Testing
After implementation, the system is complete, but it must be carefully tested before it
can be commissioned for actual use. Hopefully, the ideas that inspired the original
project were nurtured through the previous stages by the use of models. Testers once
again look at the original business requirements and verify that the system delivers the
proper functionality. Testing can also uncover accidental errors (bugs) that were
introduced. If an application runs on multiple hardware and operating system
platforms, it should be tested on all of them.

Training
An organization must train users so that it can benefit fully from an application.
Training accelerates users on the software learning curve.
Maintenance
Once development is complete and a system has been deployed, it must be maintained
for continued success. There are several kinds of maintenance. Bugs that remain in the
original system will gradually appear during use and must be fixed. A successful
application will also trigger requests for enhancements, and a long-lived application will
occasionally have to be restructured.

You might also like