cs3492 dbms two mark question
cs3492 dbms two mark question
STUCOR
List the components of DBMS.
The major components of database management system are:
Software
Hardware C212.1 BTL 1
15. Data
Procedures
Database Access Language
APP
Users
What is relational model.
The relational model represents the database as a collection of relations. A
C212.1 BTL 2
16. relation is nothing but a table of values. Every row in the table represents a
collection of related data values. These rows in the table denote a real-world
entity or relationship.
List some of the relational model concepts.
1. Attribute: Each column in a Table. Attributes are the properties which
define a relation. e.g., Student_Rollno, NAME,etc.
2. Tables – In the Relational model the, relations are saved in the table format.
It is stored along with its entities. A table has two properties rows and
columns. Rows represent records and columns represent attributes.
3. Tuple – It is nothing but a single row of a table, which contains a
single record.
4. Relation Schema: A relation schema represents the name of the relation
with its attributes. C212.1 BTL 1
17. 5. Degree: The total number of attributes which in the relation is called
the degree of the relation.
6. Cardinality: Total number of rows present in the Table.
7. Column: The column represents the set of values for a specific attribute.
8. Relation instance – Relation instance is a finite set of tuples in the
RDBMS system. Relation instances never have duplicate tuples.
9. Relation key - Every row has one, two or multiple attributes, which is
called relation key.
10. Attribute domain – Every attribute has some pre-defined value and scope
which is known as attribute domain
List some relational integrity constraints.
1. Domain Constraints C212.1 BTL1
18.
2. Key constraints
3. Referential integrity constraints
Define domain constraints.
C212.1 BTL2
19. Domain constraints can be violated if an attribute value is not appearing in the
corresponding domain or it is not of the appropriate data type.
10
Domain constraints specify that within each tuple, and the value of each attribute
must be unique. This is specified as data types which include standard data types
integers, real numbers, characters, Booleans, variable length strings, etc.
Example:
Create DOMAIN CustomerName
CHECK (value not NULL)
The example shown demonstrates creating a domain constraint such that
CustomerName is not NULL
1 Google
2 Amazon
3 Apple
Define referential integrity constraints.
Referential integrity constraints is base on the concept of Foreign Keys. A foreign
key is an important attribute of a relation which should be referred to in other
relationships. Referential integrity constraint state happens where relation refers to
a key attribute of a different or same relation. However, that key element must
exist in the table.
Example:
C212.1 BTL3
21.
11
Insert is used to insert data into the relation
Delete is used to delete tuples from the table.
Modify allows you to change the values of some attributes in existing
tuples.
Select allows you to choose a specific range of data.
What are the advantages of relational model.
Simplicity: A relational data model is simpler than the hierarchical and
network model.
Easy to use: The relational model is easy as tables consisting of rows and
columns is quite natural and simple to understand C212.1 BTL1
23.
Query capability: It makes possible for a high-level query language like
SQL to avoid complex database navigation.
12
Define project operator in relational algebra.
Produces table containing subset of columns of argument table
• Example:
C212.1 BTL1
28.
• R S is expensive to compute:
13
What is a table in relational database.
A table is set of data elements that has a horizontal dimension
(rows) and a vertical dimension (columns) in a relational
C212.1 BTL1
30. database system. A table has a specified number of columns but
can have any number of rows. Rows stored in a table are
structurally equivalent to records from flat files. Columns are
often referred as attributes or fields.
Define an identifier.
An identifier is an attribute that is used either as a primary key
C212.1 BTL1
31. or as a foreign key. The integer datatype is used for identifiers. In
cases where the number of records exceed the allowed values by
the integer datatype then a big integer datatype is used.
Define a primary key.
A column in a table whose values uniquely identify the rows in C212.1 BTL1
32.
the table. A primary key value cannot be NULLto matching
columns in other tables\
What is a Foreign key?
C212.1 BTL1
33. A column in a table that does not uniquely identify rows in that
table, but is used as a link to matching columns in other tables.
What is Relationship?
A relationship is an association between two tables. For example
C212.1 BTL1
34. the relationship between the table "hotel" and "customer" maps
the customers to the hotels they have used.
14
Define SQL
Structured Query Language (SQL), pronounced "sequel", is a
language that provides an interface to relational database
C212.1 BTL1
38. systems. It was developed by IBM in the 1970s for use in System
R. SQL is a de facto standard, as well as an ISO and ANSI
standard.
List any 5 responsibilities of the DB Manager May June 2007
a) Interaction with he file manager
b) Translation of DML commands in to low level file system commands C212.1 BTL1
39.
c) Storing, retrieving and updating data in the database
d) Data dictionary
e) Indices
What is Data Dictionary May2003, 2004, Nov 2006& Nov 2007.
Data dictionary : which stores meta data about the structure of the C212.1 BTL1
40.
database, in particular schema of the database.
What is Data independence & what are the levels. APRIL MAY 2008, MAY
/JUNE 2012, Nov 2017
The ability to modify a schema definition in one level without affecting a
schema definition in the next higher level called data independence.
C212.1 BTL1
41.
Different levels .
Physical level
Logical level
View level
Define instance and schemas. April/May 2012
- Database change over times as information is inserted and deleted.
C212.1 BTL1
42. - The collection of information stored in the database at a particular moment
called an instance of the database.
- The overall design of the database is called the database schema.
What are the types of attributes. April/May 2007
o Simple
o Composite C212.1 BTL1
43.
o Single-valued
o Multi-valued
o Derived
What is mapping cardinalities April/May 2009
Mapping cardinalities express the number of entities to which another C212.1 BTL1
44.
entity can be associated via a relationship set.
What are the various data base languages in SQL? April/May 2018
C212.1 BTL1
45. Data Definition Language (DDL)
Commands that define a database, including creating, altering, and dropping
15
tables and establishing constraints
Data Manipulation Language (DML)
Commands that maintain and query a database
Data Control Language (DCL)
Commands that control a database, including administering privileges and
committing data
C212.1 BTL1
46.
16
among the attributes of an entity as well as the relationship among different
entities.
- A relation may be visualized as a named table. Each column of the table
corresponds to an attribute of the relation and is named.
Define Data Model. April/May 2009
It is a collection of conceptual tools for describing data, data relationships, data C212.1 BTL1
49.
semantics and consistency constraints
17
ALTER objecttype objectname parameters.
Example:
The command to add (then remove) a column named bubbles for an existing table
named sink would be:
ALTER TABLE sink ADD bubbles INTEGER;
ALTER TABLE sink DROP COLUMN bubbles;
How to rename an existing table in SQL?
Syntax:
C212.1 BTL2
55. Rename - to rename the table.
Example
RENAME TABLE old_name TO new_name;
Define Data Manipulation Language.
A data manipulation language (DML) is a set of commands permitting users to
C212.1 BTL1
56. manipulate data in a database. This manipulation involves inserting data into
database tables, retrieving existing data, deleting data from existing tables and
modifying existing data.
List the DML commands in SQL.
SELECT: This command is used to retrieve rows from a table.
The select syntax:
SELECT [column name(s)] from [table name] where [conditions].
UPDATE: This command modifies data of one or more records.
The update command syntax:
UPDATE table name SET column name = value where [condition]. C212.1 BTL1
57.
INSERT: This command adds one or more records to a database table.
The insert command syntax:
INSERT INTO table name [column(s)] VALUES [value(s)].
DELETE: This command removes one or more records from a table according to
specified conditions.
Delete command syntax:
DELETE FROM table name where [condition].
List the aggregation functions in SQL.
COUNT returns the number of rows in a specified column.
SUM returns the sum of the values in a specified column.
AVG returns the average of the values in a specified column.
MIN returns the smallest value in a specified column.
MAX returns the largest value in a specified column. C212.1 BTL1
58.
Examples:
Property (PropertyNo, Street, City, postcode, Type, OwnerNo, Rooms, Rent)
Query:
How many properties cost more than 350 per month to rent?
18
clauses of the outer SELECT statement (nested query).
A subquery can be used immediately following a relational
operator.
Subquery always enclosed in parentheses.
Type of subquery:
A scalar subquery returns a single column and a single row
(singlevalue).
A row subquery returns multiple columns, but a single row.
A table subquery returns one or more columns and multiple
rows.
Example:
List the staff who work in the branch at ‗163 Main St‘.
view.
The SET clause specifies the names of one or more
corresponding columns.
What is DCL? BTL1
The Data Control Language (DCL) component of the SQL language is used
to create privileges to allow users access to, and manipulation of, the database.
C212.1
61. There are two main commands:
GRANT to grant a privilege to a user
REVOKE to revoke (remove) a privilege from a user
19
Define GRANT command in SQL. BTL1
The Syntax for the GRANT command is:
GRANT privilege_name ON object_name TO {user_name |PUBLIC
|role_name} [WITH GRANT OPTION];
Description:
privilege_name is the access right or privilege granted to the user. Some of the
access rights are ALL, EXECUTE, and SELECT.
object_name is the name of an database object like TABLE, VIEW, STORED
PROC and SEQUENCE.
user_name is the name of the user to whom an access right is being granted.
PUBLIC is used to grant access rights to all users. C212.1
62.
ROLES are a set of privileges grouped together.
WITH GRANT OPTION - allows a user to grant access rights to other users.
20
The above rules also apply for ALTER and DROP system privileges.
What is object privileges?
Object privileges - This allows the user to EXECUTE, SELECT, INSERT,
UPDATE, or DELETE data from database objects to which the privileges apply.
C212.1 BTL1
66.
C212.1 BTL1
68.
21
It's easier to GRANT or REVOKE privileges to the users through a role rather
than assigning a privilege directly to every user. If a role is identified by a
password, then, when you GRANT or REVOKE privileges to the role, you
definitely have to identify it with the password.
What is the syntax for dropping a role in SQL?
The Syntax to drop a role from the database:
C212.1 BTL1
70. DROP ROLE role_name;
Example: To drop a role called developer, you can write:
DROP ROLE testing;
Define TCL.
TCL - Transactional Control Language. It is used to manage different transactions
occurring within a database.
Examples of TCL commands include: C212.1 BTL1
71. COMMIT to apply the transaction by saving the database changes.
ROLLBACK to undo all changes of a transaction.
SAVEPOINT to divide the transaction into smaller sections. It defines
breakpoints for a transaction to allow partial rollbacks.
Define COMMIT in SQL.
SYNTAX:
COMMIT [WORK] [ COMMENT 'text' | FORCE 'text' [, integer] ]
Description:
WORK : is supported only for compliance with standard SQL. The statements
COMMIT and COMMIT WORK are equivalent.
TO : rolls back the current transaction to the specified savepoint. If you omit
this clause, the ROLLBACK statement rolls back the entire transaction.
22
transaction is identified by the 'text' containing its local or global transaction ID.
To find the IDs of such transactions, query the data dictionary view
DBA_2PC_PENDING. ROLLBACK statements with the FORCE clause are not
supported in PL/SQ
Static SQL statements in a source program must be processed before the program
is compiled. This processing can be accomplished through the DB2 precompiler or
C212.1 BTL1
75. the SQL statement coprocessor.
The DB2 precompiler or the coprocessor checks the syntax of the SQL statements,
turns them into host language comments, and generates host language statements to
invoke DB2.
PART-B
23
List and describe the features and purpose of database? C212.1 BTL5
1.
List and explain the limitations of file processing system? C212.1 BTL5
2.
Compare database vs file processing system? C212.1 BTL2
3.
What is data model? Explain various data models with example? C212.1 BTL2
4.
Explain the database system architecture with neat diagram? April/May 2017, C212.1
STUCOR
BTL2
5. Nov/Dec 2017
List and describe the components of database management system with neat C212.1 BTL2
6. diagram.
Define relational algebra. Explain various relational algebraic operations with C212.1 BTL2
7. example. Nov/Dec 2016, April/May 2017
List and explain the properties of a relations with example. C212.1 BTL2
APP
8
What are the various data types in SQL? Explain them with example? C212.1 BTL2
9.
List and explain various database languages with example? C212.1 BTL2
10
Explain DML with example? C212.1 BTL3
11
Explain DDL with example? C212.1 BTL3
12
Explain DCL with example? C212.1 BTL3
13
Explain TCL with example? C212.1 BTL3
14.
Justify the need of embedded SQL. Consider the relation student (Reg C212.1
No, name, mark and grade). Write embedded dynamic SQL program in BTL5
15
C language to retrieve all the students records whose mark is more than
90. Nov/Dec 2016, April/May 2017.
UNIT II
Bloo
Q. m’s
Questions CO
No. Leve
l
24
What is an entity relationship model? May/ June 2016 C212.2
The entity relationship model is a collection of basic objects called entities
1. BTL1
and relationship among those objects. An entity is a thing or object in the
real world that is distinguishable from other objects.
Define weak and strong entity sets? April/May 2009, April/May 2018 C212.2
Weak entity set: entity set that do not have key attribute of their own are
2. called weak entity sets. BTL1
Strong entity set: Entity set that has a primary key is termed a strong entity
set.
STUCOR
Give the limitations of ER model? How do you overcome this? May/
June 2007
3. The entity relationship model is a collection of basic objects called entities C212.2 BTL1
and relationship among those objects. An entity is a thing or object in the
real world that is distinguishable from other objects.
APP
Define Specialization and Aggregation. C212.2
It is the process of designating sub groupings within an entity set.It is a top
down process.
4. Specialization which is represented by triangle. The lable ISA stands for “is BTL1
a and represent, for eg that customer is a person.
Aggregation is a special kind of association that specifies a whole/part
relationship between the aggregate (whole) and a component part.
What are three characteristics of a relational database system?Nov/Dec C212.2
2008
5. Controlling redundancy BTL1
Restricting unauthorized access
Providing multiple user interfaces
Give the distinction between primary key, candidate key and super key. C212.2
Nov/Dec
2006,2009
Primary key – is used in a data base to avoid duplication of attributes and
6. also makes a relation to the other database. BTL1
Candidate key - a key which is in the data base is called as candidate key, it
might be any key attribute.
Super key – collection of keys of a database is called as super key
R={ A1,A2,…,An}. The constraint states that ,for any two tuples t1 and t2
in r such that t1[X]=t2[X] , we must also have t1[Y] = t2[Y].
We can also say that Y is functionally dependent on X.
25
Define an entity? C212.2
Entities:
Entity -a thing (animate or inanimate) of independent physical or
8. conceptual existence and distinguishable. BTL1
Example:
In the University database context, an individual student, faculty
member, a class room, a course are entities.
What is an entity set? C212.2
Entity Set or Entity Type-Collection of entities all having the same
STUCOR
properties.
9. BTL2
Example:
Student entity set –collection of all student entities.
Course entity set –collection of all course entities.
What is an attribute? C212.2
APP
Attributes:
Attributes - Each entity is described by a set of
attributes/properties.studententity
10. Example: BTL2
StudName–name of the student.
RollNumber–the roll number of the student.
Sex–the gender of the student etc.
All entities in an Entity set/type have the same set of attributes.
What is derived attributes? C212.2
Derived attributes are those created by a formula or by a summary operation
11. BTL2
on other attributes
12. BTL2
STUCOR
A key is a set of attributes that uniquely identifies an entire tuple, a
functional dependency allows us to express constraints that uniquely
identify the values of certain attributes.
15. First, keys will typically be used as links, ie. key values will appear in other BTL2
relations to represent their associated tuples
APP
Second, keys form the basis for constructing indexes to speed up retrieval
of tuples from a relation. Small keys will decrease the size of indexes and
the time to look up an index.
Define a relational schema? C212.2
A Relational Database Schema comprises
1. the definition of all domains
16. BTL1
the definition of all relations, specifying for each
its intension (all attribute names), and
a primary key
List the uses of functional dependencies? C212.2
We use functional dependencies to:
test relations to see if they are legal under a given set of functional
dependencies.
17. If a relation r is legal under a set F of functional dependencies, we say BTL1
that r satisfies F.
specify constraints on the set of legal relations
We say that F holds on R if all legal relations on R satisfy the set of
functional dependencies F.
Define normalization. Nov/Dec2009.April/May2010 C212.2
Normalization of data is a process during which unsatisfactory relation
18. BTL2
schemas are decomposed by breaking up their attributes into smaller
relation shemas that possess desirable properties.
List the functional dependencies rules? C212.2
19. BTL1
27
STUCOR
What is normalization?
Database normalization is the process of removing redundant data from
the tables in to improve storage efficiency, data integrity, and scalability.
C212.2
APP
In the relational model, methods exist for quantifying how efficient a
20. database is. These classifications are called normal forms (or NF), and BTL1
there are algorithms for converting a given database between them.
Normalization generally involves splitting existing tables into multiple
ones, which must be re-joined or linked each time a query is issued.
STUCOR
If there is only one candidate key then 3NF and BCNF are the same
List the decomposition properties. April/May 2017 C212.2
Decomposition Properties
• Lossless: Data should not be lost or created when splitting relations up
26.De pendency preservation: It is desirable that FDs are preserved when BTL1
APP
splitting relations up
Normalisation to 3NF is always lossless and dependency preserving
Normalisation to BCNF is lossless, but may not preserve all dependencies
Define MVD. C212.2
A multivalued dependency is a full constraint between two sets of attributes
in a relation.
27. In contrast to the functional independency, the multivalued dependency BTL1
requires that certain tuples be present in a relation. Therefore, a multivalued
dependency is also referred as a tuple-generating dependency. The
multivalued dependency also plays a role in 4NF normalization.
Define 4NF. C212.2
4th Normal Form
A Boyce Codd normal form relation is in fourth normal form if
there is no multi value dependency in the relation or
there are multi value dependency but the attributes, which are multi value
dependent on a specific attribute, are dependent between themselves.
28. BTL1
sume the following relation
a:pk1, b:pk2, c:pk3)
Recall that a relation is in BCNF if all its determinant are candidate keys, in
other words each determinant can be used as a primary key.
Because relation R has only one determinant (a, b, c), which is the
composite primary key and since the primary is a candidate key therefore R
is in BCNF.
Define 5NF
FIFTH NORMAL FORM
29. R is in 5NF if and only if every join dependency in R is implied by the C212.2 BTL1
candidate keys of R
5NF is always achievable.
29
a join dependency, * (A, B, …, Z), is implied by the candidate keys, K1, …,
Km of R
the fact that K1, …, Km are candidate keys for R determine the fact that
R has the JD * (A, B, …, Z)
Show the binary relationship in diagram?
STUCOR
APP
30. C212.2 BTL2
30
What is a domain in a database.
The term domain is used to refer to a set of values of the same kind or type.
For example, the column, "Cname‟ and "Ccity‟ in the following figure,
both have values of type string (ie. valid values are any string). But they
denote different domains, ie."Cname‟ denotes the domain of customer
names while "Ccity‟ denotes the domain of city names. They are different
domains even if they share common values.
34. C212.2 BTL1
STUCOR
APP
What is candidate Keys?
Candidate keys are those keys which is candidate for primary key of a table.
Such keys will full fill all the requirements of primary key which is not null
35. C212.2 BTL1
and have unique records is a candidate for primary key. So thus type of key
is known as candidate key. Every table must have at least one candidate key
but at the same time can have several.
Define the Primary Key.
36. Unique attribute of a table will be considered as a primary key. Primary C212.2 BTL1
keys are used to identify tables. There is only one primary key per table.
What is Foreign Key? April/May 2018
Foreign key are those keys which is used to define relationship between two
tables. When we want to implement relationship between two tables then we
use concept of foreign key. It is also known as referential integrity. We can
37. create more than one foreign key per table. foreign key is generally a C212.2 BTL1
primary key from one table that appears as a field in another where the first
table has a relationship to the second. In other words, if we had a table A
with a primary key X that linked to a table B where X was a field in B, then
X would be a foreign key in B.
Define alternate Key.
If any table have more than one candidate key, then after choosing primary
key from those candidate key, rest of candidate keys are known as an
38. alternate key of that table. Suppose we have a table named Employee which C212.2 BTL1
has two columns EmpID and EmpMail, both have not null attributes and
unique value. If EmpID is considered as a primary key to that table then
EmpMail is known as alternate key.
Define Composite Key
When a key is created on more than one column then that key is known as
39. composite key. Consider a table "Student" which has two columns Sid C212.2 BTL1
and SrefNo and these two columns are used as a primary key for record
extraction, then this key is known as composite key.
31
Distinguish between key and super key? April/May 2017
40. C212.2
STUCOR
Both Primary and Candidate keys can uniquely identify records in a table on
the database.
41. Both Primary and Candidate keys have constraints UNIQUE and NOT C212.2 BTL1
NULL.
Primary key or Candidate keys can be either single column or combination
of multiple columns in a table.
APP
What are the characteristics of primary key?
Primary key is a special kind of index in that,
42. there can be only one; C212.2 BTL1
it cannot be nullable
it must be unique.
Define super key.
43. A super key is a set or one of more columns (attributes) to uniquely identify C212.2 BTL1
rows in a table.
What is need for normalization. Nov/Dec 2010
To ensure that the update anomalies do not occur.
Normal forms provide a formal frame work for analyzing relation shemas
based on their keys and on the functional dependencies among their
44. attributes. C212.2 BTL1
A series of tests that can be carried out on individual relation schemas so
that the relation database can be normalized to any degree. When a test fails
, the relation violating that test must be decomposed into relations that
individually meet the normalization tests
Define lossless joins (or) What is non additive property. Nov/Dec 2011
Lossless join property or non additive property ensures that no
45. spurious tuples(tuples C212.2 BTL1
containing wrong information) are generated when a natural join
operation is applied to the relations in the decomposition.
Explain BCNF with example(or) How to convert a relation into BCNF.
Nov/dec 2007, 2008, 2009 2010, 2011,2014
Boyce-Codd Normal form: It is stricter than 3NF, meaning that every
46. relation in BCNF is also in 3NF; however a relation in 3NF is not C212.2 BTL1
necessarily in BCNF. A relation is in BCNF if and only if every determinant
is a candidate key (i.e) a relatioln schema R is in BCNF if whenever a
functional dependency X->A holds in R, then X is a superkey of R
What are pitfalls in relational database design?Nov/Dec2009 2010
47. C212.2 BTL1
o Repetition of informaition
32
o Inability to represent certain information
o Loss of information
State the anomalies of 1NF. Nov/ Dec 2015.
48. No repeating groups C212.2 BTL1
Redundancy of data
Explain the desirable properties of decomposition.
Lossless-join decomposition
49. C212.2 BTL1
Dependency preservation
Repetition of information
STUCOR
Outline the steps involved in query processing. April/May 2018.
Parsing and translation
50. C212.2 BTL1
Optimization
Evaluation
Explain trivial dependency? Nov/Dec 2009, 2010
APP
51. Functional dependency of the form α ->β. is trivial if α C β. Trivial C212.2 BTL1
functional dependencies are satisfied by all the relations.
Why must multivalued dependencies exist in pairs? Nov/DEC 2010,
2011
Multivalued dependencies: Multivalued dependencies are a result of 1NF
which disallowed an attribute in a tuple to have a set of values. If we have
two or more multivalued independent attributes in the same relation schema,
52. C212.2 BTL1
we get into the problem of having to repeat every value of one of the
attributes with every value of the other attributes with every value of the
other attribute to keep the relation instances consistent. A multivalued
dependency X>Y specified on relation schema R where X and Y are
subsets of R specifies the following constraint on any relation r of R.
Comparison of BCNF and 3NF: Nov/Dec 2010, April/may2011
3NF design is always dependency preserving and lossless.
53. dependency preserving is difficult to achieve in BCNF sometimes. C212.2 BTL1
BCNF strictly removes transitive dependency.
BCNF relation is in 3NF , but reverse is not possible
Why 4NF in Normal Form is more desirable than BCNF? (Nov/Dec
2014, Dec 2017)
BCNF (Boyece code normal form) has all functional dependencies A to B
are trivial of discriminator should be superkey. To get relation in BCNF,
Splitting the relation schema not necessarily preserve all functional
dependency, Loss less decomposition and dependency are main points for
54. the normalization sometime, it is not possible to get a BCNF decomposition C212.2 BTL1
that is dependency, preserving. While 4NF has very similar definition as
BCNF. A relational Schema is in 4NF, if all multivalued dependencies A to
B are trivial and determinate A is superkey of schema. If a relational schema
is in 4nf, it is already in BCNF. and 4NF decomposition preserve the all
functional dependency. so 4NF is preferable than to have BCNF.
33
PART-B
BLO
Q. OM’S
QUESTIONS CO
NO. LEVE
L
Explain The Different Types Of Normalization Nov/Dec 2009, 2010,
BTL5
1 2011, Nov/ Dec 2014, Apr/May 2015, Nov/Dec 2016 C212.2
Refer the Elmasri Navathe page no. 517
STUCOR
Explain In Detail About Boyce Codd Normal Form And Non Lossless
BTL5
2 Join Dependency. Nov/Dec 2009, 2010, 2011 C212.2
Refer the Elmasri Navathe page no. 529
Give Detail explanation about Data Model & its types. May/ June 2009,
Nov/ Dec 2014 BTL5
3 C212.2
APP
Refer the Elmasri Navathe page no. 30
34
A car rental company maintains a database for all vehicles in its current eet. For all
fl vehicles, it includes the vehicle identification number, license number, anufacture r, model,
m date of purchase, and color. Special data are included for certain typesvehicles.
of
• Trucks: cargo capacity.
• Sports cars: horsepower, renter age requirement.
• Vans: number of passengers. e).
• Off-road vehicles: ground clearance, drivetrain (four- or two-wheel driv )
STUCOR
Construct an ER model for the car rental company database. (Nov/Dec
15
APP
associated with it. Each payment is for a particular period of time set of c
date when the payment was received. (Nov/Dec 16)
C213.2 BTL1
14
TRANSACTIONS
Q. No.
1
STUCOR
Questions
What is transaction?Nov/Dec 2010 Nov/Dec 2014
Collections of operations that form a single logical unit of work are
CO
C212.3
Bloom’
s Level
BTL1
APP
called transactions.
What are the properties of transaction? Nov /Dec 2009, April/May2010
NOV/DEC 2014 , May/June 2016 (or) What are the ACID properties?
APRIL/MAY-2011 , Nov/Dec 2017,
The properties of transactions are:
2 C212.3 BTL1
Atomicity
Consistency
Isolation
Durability
Define lock? Nov2009, Nov2010, Nov2011
Lock is the most common used to implement the requirement is to allow a
3 C212.3 BTL1
transaction to access a data item only if it is currently holding a lock on that
item.
What are the different modes of lock? Nov2009, Nov2011
The modes of lock are:
4 Shared /Read C212.3 BTL1
Exclusive /Write
36
An alternative to log-based crash recovery technique is shadow paging. This
technique needs fewer disk accesses than do the log-based methods.
When is a transaction rolled back?
Any changes that the aborted transaction made to the database must be
9 undone. C212.3 BTL1
Once the changes caused by an aborted transaction have been undone, then
the transaction has been rolled back.
What is a recovery scheme? April/May 2009
10 An integral part of a database system is a recovery scheme that can restore C212.3 BTL1
STUCOR
the database to the consistent state that existed before the failure.
What are two pitfalls (problem) of lock-based protocols? APRIL/MAY-
2011
C212.3 BTL2
11 Deadlock
Starvation
APP
What are the two statements regarding transaction?
12 The two statements regarding transaction of the form: Begin transaction C212.3 BTL1
End transaction
What is recovery management component?
13 Ensuring durability is the responsibility of a software component of the base C212.3 BTL1
system called the recovery management component.
When is a transaction rolled back?
Any changes that the aborted transaction made to the database must be
14 C212.3 BTL3
undone. Once the changes caused by an aborted transaction have been
undone, then the transaction has been rolled back.
What is a shadow copy scheme?
It is simple, but efficient, scheme called the shadow copy schemes. It is
15 based on making copies of the database called shadow copies that one C212.3 BTL1
transaction is active at a time. The scheme also assumes that the database is
simply a file on disk.
Give the reasons for allowing concurrency? Nov/Dec 2017
The reasons for allowing concurrency is if the transactions run serially, a
short transaction may have to wait for a preceding long transaction to
16 C212.3 BTL1
complete, which can lead to unpredictable delays in running a transaction.
So concurrent execution reduces the unpredictable delays in running
transactions.
What is average response time?
17 The average response time is that the average time for a transaction to be C212.3 BTL1
completed after it has been submitted.
What is serializability? Explain its types? NOV/DEC 2014, Nov/Dec
2016, April/May 2018
A (possibly concurrent) schedule is serializable if it is equivalent to a serial
18 schedule. Different forms of schedule equivalence give rise to the notions C212.3 BTL2
of:
conflict serializability
view serializability
37
Define upgrade and downgrade?
It provides a mechanism for conversion from shared lock to exclusive lock
19 C212.3 BTL1
is known as upgrade. It provides a mechanism for conversion from
exclusive lock to shared lock is known as downgrade.
What is a database graph?
20 The partial ordering implies that the set D may now be viewed as a directed C212.3 BTL1
acyclic graph, called a database graph.
What are the two methods for dealing deadlock problem?
The two methods for dealing deadlock problem is
STUCOR
21 C212.3 BTL1
deadlock detection
deadlock recovery.
What is a recovery scheme?
22 An integral part of a database system is a recovery scheme that can restore C212.3 BTL1
the database to the consistent state that existed before the failure.
APP
Define garbage collection. May/June 2016
Garbage may be created also as a side effect of crashes. Periodically, it is
23 C212.3 BTL1
necessary to find all the garbage pages and to add them to the list of free
pages. This process is called garbage collection.
Differentiate strict two phase locking protocol and rigorous two phase
locking protocol. May/June 2016
In strict two phase locking protocol all exclusive mode locks taken by a
24 C212.3 BTL1
transaction is held until that transaction commits. Rigorous two phase
locking protocol requires that all locks be held until the transaction
commits.
How the time stamps are implemented
Use the value of the system clock as the time stamp. That is a transaction‟s
time stamp is equal to the value of the clock when the transaction enters the
25 C212.3 BTL1
system. • Use a logical counter that is incremented after a new timestamp
has been assigned; that is the time stamp is equal to the value of the counter.
What are the time stamps associated with each data item?
W-timestamp (Q) denotes the largest time stamp if any transaction that
26 C212.3 BTL1
executed WRITE (Q) successfully. • R-timestamp (Q) denotes the largest
time stamp if any transaction that executed READ (Q) successfully.
Define blocks? What are its types?
The database system resides permanently on nonvolatile storage, and is
partitioned into fixedlength storage units called blocks.
Physical blocks
27 The input and output operations are done in block units. The blocks residing C212.3 BTL1
on the disk are referred to as physical blocks.
Buffer blocks
The blocks residing temporarily in main memory are referred to as buffer
blocks
What is meant by concurrency control? Nov/Dec 2015
28 C212.3 BTL1
Process of managing simultaneous operations on the database without
38
having them interfere with one another.
Prevents interference when two or more users are accessing database
simultaneously and at least one is updating data.
Give an example of Two phase commit protocol. Nov/Dec 2015
In distributed databases, "single phase" commit is what is used. All the
necessary information for the transaction to be undone or completed are
written to persistent storage (typically called a "transaction log") in an
29 atomic step. The transaction is committed as soon as this information is C212.3 BTL2
permanently recorded. This is not possible in a distributed system, as there's
STUCOR
no guarantee that the commit record is written on all participating systems.
With distributed databases, Two Phase Commit solves this problem.
APP
non- sharable mode.
2. hold and wait: there must be a process holding one resource
30 and waiting for another. C212.3 BTL1
3. No preemption: resources cannot be preempted.
4. circular wait: there must exist a set of processes
[p1, p2, ..., pn] such that p1 is waiting for p2, p2 for p3, and
so on upto pn.
What is serializible schedule? April/May 2017
To process transactions concurrently, the database server must execute some
component statements of one transaction, then some from other
31 C212.3 BTL1
transactions, before continuing to process further operations from the first.
The order in which the component operations of the various transactions are
interleaved is called the schedule
What type of locking needed for insert and delete operations? April/May
2017
Share/Exclusive (for Read/Write) Locks
We should allow several transactions to access the same item A if they all
32 C212.3 BTL1
access A' for reading purposes only. However, if a transaction is to write an
item A, it must have exclusive access to A. For this purpose, a different type
of lock called a multiple-mode lock is used. In this scheme there are
shared/exclusive or read/write locks are used.
State the difference between a shared lock and an exclusive lock.
April/May 2018.
Shared lock:
Shared locks are placed on resources whenever a read operation (select) is
performed.
33 C212.3 BTL1
Multiple shared locks can be simultaneously set on a resource.
Exclusive lock:
Exclusive locks are placed on resources whenever a write operation
(INSERT, UPDATE And DELETE) are performed.
Only one exclusive lock can be placed on a resource at a time.
39
i.e. the first user who acquires an exclusive lock will continue to have the
sole ownership of the resource, and no other user can acquire an exclusive
lock on that resource
What is query execution plan? April/May 2017
34 The Query Execution Plans describe the steps and the order used to access C212.3 BTL1
or modify data in the database.
What are the costs involved in query execution? April/May 2017
i. Access cost to secondary storage.
ii. Disk storage cost.
STUCOR
35 C212.3 BTL1
iii. Computation cost
iv. Memory usage cost and
v. Communication cost
Define atomicity?
36 Either all operations of the transaction are refl ected properly in the database C212.3 BTL1
APP
or none are.
Define Durability?
37 A transaction completes successfully then changes It has made to the C212.3 BTL1
database persist even if there are system failure.
What is transaction-management component?
Ensuring atomicity is the responsibility of the database system itself
38 C212.3 BTL1
specifically, it is handled by a component called the transaction-
management component.
What are the two operation for accessing data in transaction?
39 Read(x)- transfer data item x from database. C212.3 BTL1
Write(x)- transfer data item x from the local
buffer.
What do you mean by read only transaction?
40 The data base operation in a transaction do not update the database but only C212.3 BTL1
retrieve data, the transaction is called a read-only transaction.
What are the steps followed in Executing read(x)command in
transaction?
41 1. Find the address of the disk block that contains item x. C212.3 BTL1
2. Copy that disk block in to a buffer in main memory.
3. Copy item x from the buffer to the program variable named x.
What are the steps followed in executing write(x) command in
transaction?
1. find the address of disk block that contain item x.
42 2. Copy that disk block into buffer in main memory. C212.3 BTL1
3. Copy item x from the program variable named x into its correct location
in the buffer
4. Store the update block from the buffer back to disk.
List out the transaction states?
43 C212.3 BTL1
i) active ii) Partially Committed iii) Failed iv) Abort v) committed.
What are the need for concurrency?
44 i) Improved throughput and resource utilization C212.3 BTL1
ii) Reduced waiting time.
40
Define Schedule.
45 C212.3 BTL1
The chromosomal order in which instructions are executed in the system.
When the schedule is called serial?
Each serial schedule consists of a sequence of instruction from various
46 C212.3 BTL1
transaction where the instruction belonging to one single transaction appear
together in that schedule.
When two operation in schedule are said to be conflict?
i) Two operation belong to different transaction
47 C212.3 BTL1
STUCOR
ii) Two operation access the same item x
iii) At least one of the operation is write-item (x)
Define cascading rollback?
48 An uncommitted transaction has to be roll back because it read an item C212.3 BTL1
from a transaction that failure.
When the schedule is said to cascade less?
APP
A schedule is said to be cascadeless or avoid cascading roll back if every
49 C212.3 BTL1
transaction in the schedule reads only items that were written by committed
transactions.
Define lock table?
50 System maintain record for the items that are currently locked in lock table C212.3 BTL1
that which could be organized as a hash file.
What you mean by lock conversion?
51 A transaction that already holds a lock on item xis allowed under certain C212.3
condition to voncery the Locke from one locked state to another.
PART-B
BLOO
M’S
Q. NO. QUESTIONS CO
LEVE
L
STUCOR
Refer the Elmasri Navathe page no 591
Briefly describe two phase locking in concurrency control techniques.
BTL1
9 (Nov/Dec 2014) C212.3
Refer the Elmasri Navathe page no 584
Explain the concepts of concurrent execution in Transaction
BTL2
10 processing system. (Nov/Dec 2014) C212.3
APP
Refer Elmasri Navathe page no.583
Give detail explanation about ACID Properties Nov/Dec 2009,April
BTL4
11 2011 C212.3
Refer Elmasri Navathe page no.562
State and explain the lock based concurrency control with suitable BTL4
12 C212.3
examples? Nov/Dec 2017
Discuss the violations caused by each of the following: dirty read, non- BTL5
13 C212.3
repeatable read and phantoms with suitable example. April/May 2017.
Explain why timestamp-based concurrency control allows schedules
BTL1
14 that are not recoverable. Describe how it can be modified through C212.3
buffering to disallow such schedules. April/May 2017.
How can you implement atomicity in transactions? Explain. BTL6
15 C212.3
UNIT IV
IMPLEMENTATION TECHNIQUES
RAID – File Organization – Organization of Records in Files – Indexing and Hashing –Ordered
Indices – B+ tree Index Files – B tree Index Files – Static Hashing – Dynamic Hashing – Query
Processing Overview – Algorithms for SELECT and JOIN operations – Query optimization
using Heuristics and Cost Estimation
PART – A
Question Bloom’s
Q. No. CO Level
STUCOR
A hash index organizes the search keys, with their associated
pointers, into a hash file structure
APP
Define rotational latency time. C213.4 BTL1
5
The time spent waiting for the sector to be accessed to appear under
the head is called the rotational latency time.
STUCOR
hardware support are called hardware RAID systems.
Define hot swapping?
Hot swapping permits the removal of faulty disks and replaces it by C213.4 BTL1
13
new ones without turning power off. Hot swapping reduces the mean
time to repair.
APP
What are the ways in which the variable-length records arise in
database systems? C213.4 BTL1
14
Storage of multiple record types in a file, Record types that allow
variable lengths for one or more fields, Record types that allow
repeating fields.
C213.4 BTL1
15
Anchor block: Contains the first record of a chain.
Overflow block: Contains the records other than those that are the
first record of a chain.
STUCOR
In static hashing, when a Hash function, in dynamic
hashing, search-key value is provided, is made to produce a
large number the hash function always of values and only a
few are used computes the same address. initially. C213.4 BTL1
20
The number of buckets Dynamic hashing provides a
provided remains unchanged mechanism in which data
APP
buckets
at all times i.e. fixed are added and removed dynamically
and on-demand .i.e. no. of buckets
not fixed.
Space and overhead is more Minimum space and less overhead
As file grows performance Performance do not degrade as file
decreases grows
State the need for Query Optimization. (Apr/May 15) C213.4 BTL1
26
The query optimizer attempts to determine the most efficient way to
STUCOR
execute a given query by considering the possible query plans.
What is meant by software and hardware RAID systems? May/June 2016
RAID can be implemented with no change at the hardware level, using only
C213.4 BTL1
27 software modification. Such RAID implementations are called software RAID
systems and the systems with special hardware support are called hardware RAID
systems.
APP
What is the use of RAID? April/May2009, Nov/Dec2010
A variety of disk-organization techniques, collectively called redundant
C213.4 BTL1
28 arrays of independent disks are used to improve the performance and reliability
46
faster than scanning the entire data file for the indexed data.
STUCOR
Explain how reliability can be improved through redundancy?
The simplest approach to introducing redundancy is to duplicate every disk. This
technique is called mirroring or shadowing. A logical disk then consists of two
physical disks, and write is carried out on both the disk. If one of the disks fails the C213.4 BTL1
APP
34
data can be read from the other. Data will be lost if the second disk fails before the
first fail ed disk is repaired.
STUCOR
When writing data block, corresponding block of parity bits must also be
computed and written to parity disk C213.4 BTL1
39 To find value of a damaged block, compute XOR of bits from corresponding
blocks (including parity block) from other disks
APP
Dense index C213.4 BTL1
40 Sparse index
STUCOR
– Hash performance does not degrade with growth of file
C213.4
45 – Minimal space overhead
Disadvantages of extendable hashing
– Extra level of indirection to find desired record
APP
What are the Cost functions for SELECT Operation
Linear Search:
– [nBlocks(R)/2], if the record is found. BTL1
– [nBlocks(R)], if no record satisfied the condition. C213.4
46
Binary Search :
o [log2(nBlocks(R))], if equality condition is on key attribute, because SCA(R) = 1
in this case.
o[log2(nBlocks(R))] + [SCA(R)/bFactor(R)] – 1, otherwise.
Write the Cost functions for JOIN Operation
Join operation is the most time consuming operation to process.
An estimate for the size (number of tuples) of the file that results after the JOIN BTL1
operation is required to develop reasonably accurate cost functions for JOIN C213.4
47 operations.
The JOIN operations define the relation containing tuples that satisfy a specific
predicate F from the Cartesian product of two relations R and S.
PART – B
49
BLOOM’S
Q. NO. QUESTIONS CO
LEVEL
C213.4 BTL5
1 Describe File Organization.
April/May2009, 2011
STUCOR
C213.4 BTL2
3
Explain Secondary storage devices.
APP
example
C213.4 BTL5
6
Explain about ordered indices with an example
50
Write Short Notes On Index Structure Of Files? Nov/Dec 2014
C213.4 BTL1
14
Give detail Explanation about Hashing & Types of Hashing. Nov/Dec 2015
C213.4 BTL1
15
STUCOR
UNIT V
ADVANCED TOPICS
Distributed Databases: Architecture, Data Storage, Transaction Processing – Object-based Databases:
Object Database Concepts, Object-Relational features, ODMG Object Model, ODL, OQL – XML
Databases: XML Hierarchical Model, DTD, XML Schema, XQuery – Information Retrieval: IR
Concepts, Retrieval Models, Queries in IR systems.
APP
Bloo
Q. m’s
Questions CO Leve
No.
l
C213.5 BTL2
5
51
Define Database replication.
Database replication can be used on many database management
systems, usually with a master/slave relationship between the original
and the copies. The master logs the updates, which then ripple through
to the slaves. The slave outputs a message stating that it has received
the update successfully, thus allowing the sending of subsequent
updates.
STUCOR
6
An integrated repository of information that is shared by multiple
users, multiple products, multiple applications on multiple platforms.
APP
oriented programming. Object-relational databases are a hybrid of
both approaches.
Define ODL.
ODL langauge is used to create object specifications:
C213.5 BTL1
classes and interfaces
11
- Using the specific langauge bindings to specify how ODL
constructs can be mapped to constructs in specific programming
language, such as C++, SMALLTALK, and JAVA
52
Define Information Retrieval. C213.5 BTL1
12
It is an activity of obtaining information resources relevant to an
information need from a collection of information resources
STUCOR
13
A system in which the search engine tries to determine the theme of a
site that a link is coming from.
Can we have more than one constructor in a class? If yes, explain C213.5 BTL1
14
the need for such a situation. (Nov/Dec 15)
Yes, default constructor and constructor with parameter
15
APP
Define XML Database.
An XML database is a data persistence software system that allows
data to be stored in XML format. These data can then be queried,
exported and serialized into the desired format. XML databases are
usually associated with document-oriented databases.
C213.5 BTL4
STUCOR
implemented by the methods.
Is XML Hierarchical?
XML documents have a hierarchical structure and can conceptually be
C213.5 BTL1
19 interpreted as a tree structure, called an XML tree. XML documents
must contain a root element (one that is the parent of all other
APP
elements). All elements in an XML document can contain sub
elements, text and attributes.
What is DTD?
A document type definition (DTD) contains a set of rules that can be
C213.5 BTL1
20 used to validate an XML file. After you have created a DTD, you can
edit it manually, adding declarations that define elements, attributes,
entities, and notations, and how they can be used for any XML files
that reference the DTD file.
STUCOR
3. Select the project or folder that will contain the DTD.
4. In the File name field, type the name of the DTD, for example C213.5 BTL1
25
MyDTD.dtd. The name of your DTD file must end with the
extension
.dtd
5. Click Next.
APP
6. Optional: You can use a DTD template as the basis for your
new DTD file. To do so, click the Use DTD Template check box,
and select the template you want to use.
7. Click Finish.
What is the difference between Information Retrieval and DBMS. ?
55
Multi - DBMS Architecture
STUCOR
Single Server Multiple Client
Multiple Server Multiple Client
(
Write short notes on Peer- to-Peer Architecture for DDBMS
In these systems, each peer acts both as a client and a server for imparting database
services. The peers share their resource with other peers and co-ordinate their
APP
activities.
C213.5 BTL2
31 This architecture generally has four levels of schemas −
Global Conceptual Schema − Depicts the global logical view of data.
Local Conceptual Schema − Depicts logical data organization at each site.
Local Internal Schema − Depicts physical data organization at each site.
External Schema − Depicts user view of data
Write short notes on Multi - DBMS Architectures
This is an integrated database system formed by a collection of two or more
autonomous database systems.
Multi-DBMS can be expressed through six levels of schemas −
Multi-database View Level − Depicts multiple user views comprising of subsets
of the integrated distributed database.
Multi-database Conceptual Level − Depicts integrated multi-database that
comprises of global logical multi-database structure definitions.
Multi-database Internal Level − Depicts the data distribution across different C213.5 BTL1
32
sites and multi-database to local data mapping.
Local database View Level − Depicts public view of local data.
Local database Conceptual Level − Depicts local data organization at each site.
Local database Internal Level − Depicts physical data organization at each site.
There are two design alternatives for multi-DBMS −
Model with multi-database conceptual level.
Model without multi-database conceptual level.
STUCOR
account agrees in all sites.
Define Transparency
The user of a distributed database system should not be required to know where the C213.5 BTL1
35 data are physically located nor how the data can be accessed at the specific local
site. This characteristic, called data transparency, can take several forms:
What are the DISTRIBUTED TRANSACTIONS
There are two types of transaction that we need to consider.
APP
Local transactions are those that access and update data in only one local
C213.5 BTL1
36 database;
Global transactions are those that access and update data in several local
databases
STUCOR
What re the aspects of an object?
C213.5 BTL1
43 An object has five aspects: identifier, name, lifetime, structure, and creation.
APP
What are the notation of ODMG??
C213.5 BTL1
45 The notation of ODMG uses three concepts: interface, literal, and clas
58
PART – B
BLOOM’S
Q. NO. QUESTIONS CO
LEVEL
STUCOR
C213.5 BTL5
2 Explain in detail (i) Information Retrieval (iii) Transaction processing
(Nov/Dec 14)
C213.5 BTL6
3
Write short notes on Distributed Transactions. (Nov/Dec 14)
C213.5 BTL5
APP
4
Explain in detail the Client - Server Architecture for DDBMS
STUCOR
Give the DTD or XML Schema for an XML representation of the nested relational
schema . Nov/ Dec 2016 C213.5 BTL5
15
APP
60