Download RAJALAKSHMI ENGINEERING COLLEGE

Survey
yes no Was this document useful for you?
   Thank you for your participation!

* Your assessment is very important for improving the workof artificial intelligence, which forms the content of this project

Document related concepts

Microsoft SQL Server wikipedia , lookup

Serializability wikipedia , lookup

Open Database Connectivity wikipedia , lookup

SQL wikipedia , lookup

Microsoft Jet Database Engine wikipedia , lookup

Entity–attribute–value model wikipedia , lookup

Extensible Storage Engine wikipedia , lookup

Concurrency control wikipedia , lookup

Database wikipedia , lookup

Versant Object Database wikipedia , lookup

Clusterpoint wikipedia , lookup

Relational algebra wikipedia , lookup

Database model wikipedia , lookup

Relational model wikipedia , lookup

Transcript
QUESTION BANK
Dr. NAVALAR NEDUNCHEZHIYAN COLLEGE OF ENGINEERING
II - CSE
THOLUDUR – 606 303, CUDDALORE DIST
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
ANNA UNIVERSITY CHENNAI
YEAR: II / SEM IV
CS2255 – DATABASE MANAGEMENT SYSTEMS
(Common to CSE and IT)
UNIT I INTRODUCTION
9
Purpose of database system – Views of data – Data models – Database languages– Database system
architecture – Database users and administrator – Entity Relationship model (E-R Model ) – E-R diagrams –
Introduction to relational databases.
UNIT II RELATIONAL MODEL
9
The relational model – The catalog – Types – Keys – Relational algebra – Domain relational calculus – Tuple
relational calculus – Fundamental operations – Additional operations – SQL fundamentals – Integrity –
Triggers – Security – Advanced SQL features – Embedded SQL – Dynamic SQL – Missing information –
Views – Introduction to distributed databases and client/server databases.
UNIT III DATABASE DESIGN
9
Functional dependencies – Non-loss decomposition – Functional dependencies – First – Second – Third
normal forms – Dependency preservation – Boyce/codd normal form – Multi-valued dependencies and fourth
normal form – Join dependencies and fifth normal form.
UNIT IV TRANSACTIONS
9
Transaction concepts – Transaction recovery – ACID properties – System recovery – Media recovery – Two
phase commit – Save points – SQL facilities for recovery – Concurrency – Need for concurrency – Locking
protocols – Two phase locking – Intent locking – Deadlock – Serializability – Recovery Isolation Levels –
SQL Facilities for Concurrency.
UNIT V IMPLEMENTATION TECHNIQUES
9
Overview of Physical Storage Media – Magnetic Disks – RAID – Tertiary Storage – 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 – Catalog information for cost
estimation – Selection operation – Sorting – Join operation – Database Tuning.
Total: 45
TEXT BOOKS
1. Silberschatz, A., Korth, H.F. and Sudharshan, S., “Database SystemConcepts”, 5th Edition, Tata Mc-Graw
Hill, 2006
2. Date, C. J., Kannan, A. and Swamynathan, S., “An Introduction to DatabaseSystems”, 8th Edition, Pearson
Education, 2006.
REFERENCES
1. Elmasri, R. and Navathe, S.B., “Fundamentals of Database Systems”, 4thEdition, Pearson / Addison
Wesley, 2007.
2. Ramakrishnan, R., “Database Management Systems”, 3rd Edition, Mc-GrawHill, 2003.
3. Singh, S. K., “Database Systems Concepts, Design and Applications”, 1stEdition, Pearson Educ
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
SUBJECT CODE: CS2255
UNIT -I FUNDAMENTALS
II - CSE
SUBJECT NAME: DATA BASE MANAGEMENT SYSTEM
PART-A
(1 MARK)
1 .In the relational modes, cardinality are termed as:
(A) Number of tuples. (B) Number of attributes. (C) Number of tables. (D) Number of constraints.
2. Relational calculus is a
(A) Procedural language. (B) Non-Procedural language. (C) Data definition language. (D) High level
language.
3 .The view of total database content is
(A) Conceptual view. (B) Internal view. (C) External view. (D) Physical View.
4. Cartesian product in relational algebra is
(A) A Unary operator. (B) A Binary operator. (C) A Ternary operator. (D) Not defined.
5 .DML is provided for
(A) Description of logical structure of database. (B) Addition of new structures in the database system.
(C) Manipulation & processing of database. (D) Definition of physical structure of database system.
6. ‘AS’ clause is used in SQL for
(A) Selection operation. (B) Rename operation. (C) Join operation. (D) Projection operation.
7. ODBC stands for
(A) Object Database Connectivity. (B) Oral Database Connectivity. (C) Oracle Database
Connectivity. (D) Open Database Connectivity.
8. Architecture of the database can be viewed as
(A) Two levels. (B) Four levels. (C) Three levels. (D) One level.
9. In a relational model, relations are termed as
(A) Tuples. (B) Attributes (C) Tables. (D) Rows.
10. The database schema is written in
(A) HLL (B) DML (C) DDL (D) DCL
11. In the architecture of a database system external level is the
(A) Physical level. (B) Logical level. (C) Conceptual level (D) views level.
12. An entity set that does not have sufficient attributes to form a primary key is a
(A) Strong entity set. (B) Weak entity set. (C) Simple entity set. (D) Primary entity set.
13 .In a Hierarchical model records are organized as
(A) Graph. (B) List. (C) Links. (D) Tree.
14 .In an E-R diagram attributes are represented by
(A) rectangle. (B) Square. (C) Ellipse. (D) Triangle.
15 .In case of entity integrity, the primary key may be
(A) Not null (B) Null (C) both Null & not Null. (D) Any value.
16 .In tuple relational calculus P. P is equivalent to 12
(A) ¬P. P (B) P. P12 12 (C) P . P (D) P Ù¬P12 12
17 .The language used in application programs to request data from the DBMS is referred to as the
(A) DML (B) DDL (C) VDL (D) SDL
18 .A logical schema
(A) Is the entire database. (B) is a standard way of organizing information into accessible parts.
(C) Describes how data is actually stored on disk. (D) Both (A) and (C)
19 .Related fields in a database are grouped to form a
(A) Data file. (B) Data record. (C) Menu. (D) Bank.
20 .The database environments have all of the following components except:
(A) Users. (B) Separate files. (C) Database. (D) Database administrator.
1
A
2
B
3
A
4
B
5
C
6
B
7
D
8
C
9
B
10
C
11
D
12
B
13
D
14
C
15
A
16
A
17
A
18
A
19
B
20
A
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
PART-B
(2 MARKS)
21. What is DBMS and what’s the goal of it?
DBMS is a collection of interrelated data and a set of programs to access that data. The goal is to
provide the environment that is both convenient and efficient to use in retrieving and storing data base
information.
22. What are the advantages of DBMS? (A.U May/June 2007) (A.U Nov/Dec 2011)
• Centralized Control• Data Independence allows dynamic change and growth potential.
• Data Duplication is eliminated with control Redundancy. • Data Quality is enhanced.
23. What are the Disadvantages of DBMS? (A.U.APRIL/MAY2013)
• Cost of software, hardware and migration is high. • Complexity of Backup• Problem associated with
centralization.
24. What are the disadvantages of File Systems?
• Data Redundancy and Inconsistency.• Difficulty in accessing data.• Data Isolation
• Integrity problems• Security Problems• Concurrent access anomalies
25. Define Entity, Entity Set, and extensions of entity set. Give one example for each.
• Entity – object or thing in the real world. E.g., each person, book, etc.
• Entity set – set of entities of the same entity that share the same properties or attributes.
E.g., Customer, loan, account, etc
• Extensions of entity set – individual entities that constitute a set. Eg.individual bank customers
26. Define and give examples to illustrate the four types of attributes in database.
• Simple and Composite attribute_ Simple (address)_ Composite (street, city, district)
• Single-valued and multi-valued attribute
_ Single-valued (roll no)
_ Multi-valued (colors = {R, B, G})
• Null attribute
_ No values for attribute
• Derived attribute
_ Age derived from Birth date
27. Define relationship and participation. (A.U May/June 2008) (A.U Nov/Dec 2011)
• Relationship is an association among several entities.
• Association between entity sets is referred as participation.
28. Define mapping cardinality or cardinality ratio.
Mapping cardinality or cardinality ratio is the way to express the number of entities to which
another entity can be associated through a relationship set. These are most useful in describing binary
relationship sets.
29. Explain the four types of mapping cardinality with example. (A.U Nov/Dec 2006)
For a binary relationship set R between entity sets A and B, the mapping cardinality must be one of
the following: (Draw the diagrams also)
• One-to-one
An entity in A is associated with at most one entity in B and an entity in B is associated with at most one
entity in A. E.g., Roll no entity in Student info entity set and marks details entity set.
• One-to-many
An entity in A is associated with any number of entities in B. But an entity in B is associated with at most
one entity in A. E.g., one customer with many loans.
• Many-to-one
An entity in A is associated with at most one entity in B. But an entity in B can be associated with any
number of entities in A. E.g., street and city associated to a single person.
• Many-to-many
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
An entity in A is associated with any number of entities in B. But an entity in B can be associated with any
number of entities in A. E.g., same loan by several business partners.
30. Differentiate total participation and partial participation. (i.e., write Definition and Example
with illustration)
• Total – participation of an entity set, E in relationship, R is total if every entity in E participates in at
least one relationship in R. E.g., loan entity set.
• Partial – if only some entities in E participate in R. E.g., payment weak entity set.
31. Define E-R diagram. (A.U Nov/Dec 2007) (A.U.APRIL/MAY2013)
Overall structure of a database can be expressed graphically by E-R diagram for simplicity and clarity.
32. Define weak Entity set. Give an example and explain why it is weak entity set.
• Entity set with no sufficient attributes to form a primary key’s Payment entity set is weak since
duplication exists
33. Define discriminator or partial key of a weak entity set. Give example.
Set of attributes that allow distinction to be made among all those entities in the entity set that depends on
one particular strong entity. E.g., payment no in payment entity set. It is also called as partial key.
14. Explain Referential Integrity. (A.U NOV/DEC 2008) (A.U Apr/May 2012)
Referential Integrity means relationship between tables. Foreign keys are used. Foreign key is the
column whose values are derived from the Primary key of the same or some other table.
Format for creating a foreign key is given below. Syntax: create table <table name> (column name data
type (size) constraint constraint name references parent table name);
35. Define Instances and schemas.
Instances: The collection of information stored in the database at a particular moment is called the
instance of the database.
Schemas: The overall design of the database is called the schema of the database.
36. Define and explain the two types of Data Independence. (A.U Nov/Dec 2011)
Two types of data independence are
i. Physical data independence ii. Logical data independence
Physical data independence: The ability to modify the physical schema without causing application
programs to be rewritten in the higher levels. Modifications in physical level occur occasionally whenever
there is a need to improve performance.
Logical data independence: The ability to modify the logical schema without causing application
programs to be rewritten in the higher level (external level). Modifications in physical level occur
frequently more than that in physical level, whenever there is an alteration in the logical structure of the
database.
37. Define transaction. (A.U May/June 2007)
A transaction is a collection of operations that performs a single logical function in a database
application. Each transaction is a unit of both atomicity and consistency. Properties of transaction are
atomicity, consistency, isolation, and durability.
38. Define the type types of DML. (A.U Nov/Dec 2010)
Two types:• Procedural DML• Non-procedural DML
Procedural DML:
It requires a user to specify what data are needed and how to get those data.
Non-Procedural DML:
It requires a user to specify what data are needed without specifying how to get those data.
39. List out the functions of DBA.
• Schema definition• Storage structure and access-method definition• Schema and physical
modification• Granting of authorization for data access• Integrity constraint specification
40. What is the need for DBA?
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
The need of DBA is to have central control of both the data and the programs that access those
data. The person who has such central control over the system is called the Data Base Administrator.
41. Explain DML pre-compiler.
DML precompiled converts DML statements embedded in an application program to normal
procedure calls in the host language. The precompiled must interact with the DML compiler to generate
the appropriate code.
42. Define file manager and buffer manager. (A.U Nov/Dec 2009)
File manager:
File manager manages the allocation of space on disk storage and the data structures used to
represent information stored on disk.
Buffer manager:
Buffer manager is responsible for fetching data from the disk storage into his main memory, and
deciding what data to cache in memory.
43. Define Data Dictionary. (A.U May/June 2007) (A.U Nov/Dec 2011)
DDL statements are compiled into a set of tables that is stored in a special file called data
dictionary. Data dictionary contains the meta-data, which in turn is data about the data.
44. Give the syntax for creating the table with composite primary key.
Multicolumn primary key is called composite primary key.
Syntax: create table <table name>(columnname1 data type (size), columnname2data type (size),
constraint name primary key (columnname1, columnname2));
45. Write a query to display loan number, branch name where loan amount is between 500 and
1000 using comparison operators.
Query: select loan no, branch name from loan where amount>=500 and amount<=1000;
46. Find the names of all branches with customers who have an account in the bank
And who live in the Harrison city using Equip-join.
Query: select branch name from customer, account, depositor wherecust_city='Harrison' and
customer.cust_name=depositor.cust_name anddepositor.acc_no=account.acc_no;
47. Find the names of all branches with customers who have an account in the bank
And who live in the Harrison city using Sub-Queries.
Query: select branch name from account where acc_no in (select acc_no from depositor where cust_name
in (select cust_name from customer wherecust_city='Harrison'));
PART-C
(16 MARKS)
48. Explain Distributed Relational Database design in detail. (A.U May/June 2008) A.U Nov/Dec
2011) (A.U.APRIL/MAY2013)
49. Explain about Transparencies in a DDBMS. (A.U Nov/Dec 2011)
50. Explain the Functions and Architecture of a DBMS. (A.U Nov/Dec 2010)
(A.U.APRIL/MAY2013)
51. Explain in detail the recovery techniques in distributed databases.(A.U Nov/Dec 2009)
52. Discuss about the X/Open Distributed Transaction Processing model.
53. Explain about distributed query optimization. (A.U NOV/DEC 2008)
UNIT II
RELATIONAL MODEL
PART-A
(1 MARK)
54 .The language which has recently become the defect standard for interfacing application
Programs with relational database system is
(A) Oracle. (B) SQL. (C) DBase. (D) 4GL.
55 .The way a particular application views the data from the database that the application uses is a
(A) module. (B) Relational model. (C) Schema. (D) Sub schema.
56 .In an E-R diagram an entity set is represent by a
(A) rectangle. (B) Ellipse. (C) Diamond box. (D) Circle.
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
57 .A report generator is used to
(A) Update files. (B) Print files on paper. (C) Data entry. (D) Delete files.
58 .The property / properties of a database is / are:
(A) It is an integrated collection of logically related records. (B) It consolidates separate files into a
common pool of data records. (C) Data stored in a database is independent of the application programs
using it. (D) All of the above.
59 .The DBMS language component which can be embedded in a program is
(A) The data definition language (DDL). (B) The data manipulation language (DML). (C) The
database administrator (DBA). (D) A query language.
60 .A relational database developers refers to a record as
(A) A criteria. (B) A relation. (C) A tuple. (D) An attribute.
61. The relational model feature is that there
(A) is no need for primary key data. (B) is much more data independence than some other database
models. (C) Are explicit relationships among records. (D) Are tables with many dimensions?
62 .Conceptual design
(A) is a documentation technique. (B) Needs data volume and processing frequencies to determine the
size of the database. (C) Involves modeling independent of the DBMS. (D) Is designing the relational
model.
63 .The methods in which records are physically stored in a specified order according to a key field
in each record is
(A) Hash. (B) Direct. (C) Sequential. (D) all of the above.
64 .A subschema expresses
(A) The logical view. (B) The physical view. (C) The external view. (D) all of the above.
65 .Count functions in SQL returns the number of
(A) Values. (B) Distinct values. (C) Groups. (D) Columns.
66. Which one of the following statements is false?
(A) The data dictionary is normally maintained by the database administrator.(B) Data elements in the
database can be modified by changing the data dictionary. (C) The data dictionary contains the name and
description of each data element. (D) The data dictionary is a tool used exclusively by the database
administrator.
67. An advantage of the database management approach is
(A) Data is dependent on programs. (B) data redundancy increases. (C) data is integrated and can be
accessed by multiple programs. (D) none of the above.
68 .A DBMS query language is designed to
(A) Support end users who use English-like commands. (B) Support in the development of complex
applications software. (C) Specify the structure of a database. (D) all of the above.
69. Transaction processing is associated with everything below except
(A) Producing detail, summary, or exception reports. (B) Recording a business activity.
(C) Confirming an action or triggering a response. (D) Maintaining data.
70 .It is possible to define a schema completely using
(A) VDL and DDL. (B) DDL and DML. (C) SDL and DDL. (D) VDL and DML.
71 .The method of access which uses key transformation is known as
(A) Direct. (B) Hash. (C) Random. (D) Sequential.
72 .Data independence means
(A) Data is defined separately and not included in programs. (B) Programs are not dependent on the
physical attributes of data. (C) Programs are not dependent on the logical attributes of data. (D) Both (B)
and (C).
73. The statement in SQL which allows changing the definition of a table is
(A) Alter. (B) Update. (C) Create. (D) Select.
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
B
D
A
B
D
B
C
B
C
A
C
A
B
C
D
C
B
B
D
A
PART-B
(2 MARKS)
74. Select the rows from borrower such that the loan numbers are lesser than any loan number
where the branch name is Downtown.
Query: select * from borrower where loan_no < any (Select loan_no from loan
Where branch name='downtown');
75. Define self-join and give an example query to illustrate self-join with a sample
Table. (A.U Nov/Dec 2010) (A.U Nov/Dec 2011)
Joining of a table to itself is called self-join. i.e., it joins one row in a table to another row.
Query: Select emp.emp_name, mngr.emp_name from employs emp, employ mngr
Where emp.manager_no=mngr.emp_no; Sample table: Employ
Emp_no Emp_name Manager_no
E001
Basu Ivan
E002
navindgi
E003
Rukmini
E004
Carol
E005
Cynthia
E002
E005E004
76. What is a view and give an example query to create a view from an existing table.
Any relation that is not a part of the logical model but which is made visible to the user as a virtual
(imaginary) relation is called a view.
Query: create view custall (name, city) as (Select cust_name, cust_city fromcustomer);
77. Define Degree and Domain of a relation. (A.U Nov/Dec 2006) (A.U Apr/May 2012)
Degree:
Number of attributes ‘n’ of its relation schema is called a degree of a relation. e.g. Account table
degree is 3, since three attributes are there in that relation.
Domain:
Set of permitted values for each attribute (or) data type describing the types of values that can
appear in each column is called a domain of a relation. eg.Set of all account numbers of the account table.
78. Define how a relation is defined mathematically. (A.U.APRIL/MAY2013)
A relation is defined mathematically as a subset of a Cartesian product of list of domains.
For e.g., in account table,
D1 ® set of all acc_nos
D2 ® set of all branch names
D3 ® set of all balances
And the relation account is a subset of D1 X D2 X D3
79. Define super key and give example to illustrate the super key.
Set of one or more attributes taken collectively, allowing to identify uniquely an entity in the entity
set.Eg1. {SSN} and {SSN, Cust_name} of customer table are super keys.Eg2. {Branch name} and
{Branch name, Branch city} of Branch table re super keys.
80. Define candidate key and give example to illustrate the candidate key.
Super keys with no proper subset are called the candidate keys. Otherwise it is called minimal
super key. Candidate key is nothing but the primary key used inSQL. Eg1. {SSN} is the candidate key for
the super keys {SSN} and {SSN, Cust_name} of customer table.Eg2. {Branch name} is the candidate key
for the super keys {Branch name} and {Branch name, Branch city} of Branch table.
81. List out the six fundamental operators and 4 additional operators in relational
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
Algebra. (A.U May/June 2009) (A.U Nov/Dec 2011)
Six Fundamental operators:
• Selection (s) • Projection (p)• Union (È)• Set Difference (-)
• Cartesian Product (X) •Rename (r)
Four Additional operators:
• Set Intersection (Ç) • Natural Join (*) • Division (÷) • Assignment (¬)
82. Which operators are called as unary operators and explain why they are called so.
Unary operators:
• Selection (s) • Projection (p) • Rename (r)
These operators are called as unary operators because they operate on only one relation.
83. Which operators are called as binary operators and explain why they are called so.
Binary operators:
• Union (È) • Set Difference (-) • Cartesian product (X)
These operators are called as binary operators because they operate on pairs of relations.
84. Write a relational algebra expression to find those tuples pertaining to loans of
More than 1200 made by the Perry ridge branch.
Relational algebra expression: sbranch_name = “Perry ridge” Ù amount >1200 (loan)
85. Explain the use of set difference operator and give an example to illustrate the
Same. (A.U Nov/Dec 2011) (A.U.APRIL/MAY2013)
Use of set difference operator:
Allows finding tuples that are in one relation but are not in another relation.
Example: Find all customers of the bank who have an account but not a loan.
Relational Algebra Expression: pCust_name (depositor) - pcust_name (borrower)
PART-C
(16 MARKS)
86. Explain Object oriented Concepts in database and storing objects in Relational
Database. (A.U May/June 2009) (A.U Nov/Dec 2011)
87. Explain about issues in OODBMS. (A.U Nov/Dec 2010) (A.U.APRIL/MAY2013)
88. Explain briefly on Object Oriented DBMSs-Standards and Systems.
89. Explain the advantages and disadvantages of OODBMS. (A.U Nov/Dec 2011)
II - CSE
UNIT III DATABASE DESIGN
PART-A
(1 MARKS)
90. E-R model uses this symbol to represent weak entity set?
(A) Dotted rectangle. (B) Diamond (C) doubly outlined rectangle (D) none of these
91 .SET concept is used in :
(A) Network Model (B) Hierarchical Model (C) Relational Model (D) None of these
92 .Relational Algebra is
(A) Data Definition Language. (B) Meta Language (C) Procedural query Language
(D) None of the above
93. Key to represent relationship between tables is called
(A) Primary key (B) Secondary Key (C) Foreign Key (D) None of these
94. _______ produces the relation that has attributes of R1 and R2
(A) Cartesian product (B) Difference (C) Intersection (D) Product
95 .The file organization that provides very fast access to any arbitrary record of a file is
(A) Ordered file (B) Unordered file (C) Hashed file (D) B-tree
96. DBMS helps achieve
(A) Data independence (B) Centralized control of data (C) Neither (A) nor (B) (D) both (A) and (B)
97 .Which of the following are the properties of entities?
(A) Groups (B) Table (C) Attributes (D) Switchboards Ans: C
98 .In a relation
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
(A) Ordering of rows is immaterial (B) No two rows are identical (C) (A) and (B) both are true (D)
None of these.
99 .Which of the following is correct:
(A) a SQL query automatically eliminates duplicates. (B) SQL permits attribute names to be repeated
in the same relation. (C) a SQL query will not work if there are no indexes on the relations (D) None
of these
100 .It is better to use files than a DBMS when there are
(A) Stringent real-time requirements. (B) Multiple users wish to access the data. (C) Complex
relationships among data. (D) All of the above.
101 .The conceptual models is
(A) Dependent on hardware. (B) Dependent on software.
(C) Dependent on both hardware and software . (D) Independent of both hardware and software.
102 .What is a relationship called when it is maintained between two entities?
(A) Unary (B) Binary (C) Ternary (D) Quaternary
103 .Which of the following operation is used if we are interested in only certain columns of a
Table?
(A) PROJECTION (B) SELECTION (C) UNION (D) JOIN
104.Which of the following is a valid SQL type?
(A) CHARACTER (B) NUMERIC (C) FLOAT (D) All of the above
105 .The RDBMS terminology for a row is
(A) tuple. (B) Relation. (C) Attribute. (D) Degree.
106.which of the following operations need the participating relations to be union compatible?
(A) UNION (B) INTERSECTION (C) DIFFERENCE (D) All of the above
107 .The full form of DDL is
(A ) Dynamic Data Language (B) Detailed Data Language (C) Data Definition Language (D) Data
Derivation Language
108 .Which of the following is an advantage of view?
(A) Data security (B) Derived columns (C) Hiding of complex queries (D) All of the above
109.Which of the following is a legal expression in SQL?
(A) SELECT NULL FROM EMPLOYEE; (B) SELECT NAME FROM EMPLOYEE;
(C) SELECT NAME FROM EMPLOYEE WHERE SALARY = NULL; (D) None of the above
ANSWERS:
90
C
91
A
92
C
93
C
94
A
95
C
96
D
97
C
98
C
99
D
100
B
101
D
102
B
103
A
104
D
105
A
106
D
107
C
108
D
109
B
PART-B
(2MARKS)
110. Explain the two conditions needed for the set difference operation (union
Operation) to be valid.
Two conditions are
• Relations, r and s must be of the same arity i.e., they must have same number of attributes.
• Domains of the it attribute of r and the ith attribute of s must be same for all i.
111. Explain with one example why the additional operators are separated from the
Fundamental operators?
Additional operators are used instead of fundamental operators to reduce the complexity of long
relational algebra expressions.
E.g. r Ç s = r – ( r – s )
Intersection can be used for repeated set difference operations.
112. Explain theta join. (A.U May/June 2008) (A.U Nov/Dec 2011) (A.U.APRIL/MAY2013)
Theta join is an extension to the natural join operation that allows combining a Selection operation
with condition, q and a Cartesian product into as ingle operation.
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
r q s = sq (r x s)r ÷ s = pR-S(r) - pR-S(pR-S(r) x s) -pR-S,S (r))
113. Define how an expression can be expressed in tuple relational calculus and list out the notations
used.
A query or expression can be expressed in tuple relational calculus as {t | P (t)}
which means the set of all tuples ‘t’ such that predicate P is true for ‘t’.Notations used:
• t[A] ® the value of tuple ‘t’ on attribute, A• t Î r ® tuple ‘t’ is in relation ‘r’• $ ® there exists
Definition for ‘there exists’ ($):
$ t Î r(Q(t))which means there exists a tuple ‘t’ in relation ‘r’such that predicate Q(t) is true.
• " ® for all Definition for ‘for all’ ("):"t Î r(Q(t))which means Q(t) is true for all tuples ‘t’ in relation’s’. •
_ ® Implication Definition for Implication (_):P_Q means if P is true then Q must be true.
114. Write an expression to find the names of all customers who have a loan from the
Perry ridge branch in tuple relational calculus.
Expression in tuple relational calculus :{t | $ s Î borrower ( t[cust_name] = s[cust_name] Ù $ u Î
loan (u[loan_no] = s[loan_no] Ù u[branch_name] =”perryridge”))}
115. Write an expression to find all customers who have an account at all branches
Located in Brooklyn in tuple relational calculus. (A.U.APRIL/MAY2013)
{t | " u Î branch ( u[branch_city] = “Brooklyn” _ $ s Î depositor (t[cust_name] = s[cust_name] Ù $
w Î account ( w[acc_no] =s[acc_no] Ùw[branch_name] = u[branch_name])))}
116. Define safety of expression in tuple relational calculus. (A.U Nov/Dec 2010)
Query or expression { t | P(t)} is safe if all values that appear in the result are values from Dom(p),
where Dom(p) is domain of P. Else it is unsafe. For example, the tuples selected in the tuple relational
calculus are unsafe.
117. Define domain relational calculus. (A.U NOV/DEC 2008) (A.U Nov/Dec 2011)
Domain relational calculus uses domain variables that take on values from an attribute’s domain
rather than values for an entire tuple.An expression in the domain relational calculus is of the
form{<x1,xn, … xn> | (P(x1,xn, … xn))}where x1,xn, … xn represents domain variables.P represents a
formula composed of atoms or domain variables.
118. Write an expression to find all customers who have an account, a loan or both at
The Perry ridge branch in domain relational calculus.
{ <c> | $ l (<c,l> Î borrower Ù $ b,a (<l,b,a> Î loan Ù b = “Perry ridge” ))Ú $ a (<c,a> Î depositor
Ù $ b,bal (<a,b,bal> Î account Ù b =“Perry ridge” ))}
119. Define and give the general format used for generalized projection. Give one
Example expression to illustrate the same.
Generalized projection extends the projection operation by allowing arithmetic functions to be
used in the projection list. General format used for Generalized projection ispF1 F2 … Fn(E)where is the
relational algebra expression.F1 F2 … Fn are the arithmetic expressions involving constants and attributes
in the schema of E. Special case these can be simply an attribute or a constant. Example expression for
illustration: pacc_no, branch_name, balance + 100 (account)
120. What is the use of outer join and list out the three types of outer join with the
Notations used in relational algebra?( A.U April/May2010) (A.U Apr/May 2012)
Natural join combines only the common columns. So some information will be lost, if it has no
common column. So outer join is used. It avoids this loss of information.
Three types of outer join:
• Left outer join ( )• Right outer join ( )• Full outer join ( )
121. Write a relational algebraic expression to delete all accounts at branches located
in Brooklyn.
r1 ¬ sbranch_city = “Brooklyn” (account branch) r2 ¬ pbranch_name, acc_no, balance (r1)
Account ¬ account – r2where r1 and r2 are temporary relations.
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
PART-C
(16 MARKS)
122. Discuss briefly about THE WEB? (A.U.APRIL/MAY2013)
123. Web-DBMS Architecture? (A.U NOV/DEC 2008) (A.U Apr/May 2012)
124. Explain about scripting languages, CGI and HTTP cookies (A.U Nov/Dec 2010)
125. Define Oracle internet Platform and explain briefly the various services provide by it? (A.U
Nov/Dec 2007) (A.U Apr/May 2011)
UNIT IV TRANSACTIONS
PART-A
(1 MARKS)
126 .The users who use easy-to-use menu are called
(A) Sophisticated end users. (B) Naïve users. (C) Stand-alone users. (D) Casual end users.
127 .Which database levels is closest to the users?
(A) External (B) Internal (C) Physical (D) Conceptual
128 .Which are the two ways in which entities can participate in a relationship?
(A) Passive and active (B) Total and partial (C) Simple and Complex (D) All of the above
129 .The result of the UNION operation between R1 and R2 is a relation that includes
(A) all the tuples of R1 (B) all the tuples of R2 (C) all the tuples of R1 and R2
(D) all the tuples of R1 and R2 which have common columns
130. Which of the following is a comparison operator in SQL?
(A) = (B) LIKE (C) BETWEEN (D) All of the above
131 .A set of possible data values is called
(A) Attribute. (B) Degree. (C) tuple. (D) Domain.
132 .Which of the operations constitute a basic set of operations for manipulating relational Data?
(A) Predicate calculus (B) Relational calculus (C) Relational algebra (D) None of the above
133. Which of the following is another name for weak entity?
(A) Child (B) Owner (C) Dominant (D) All of the above
134 .Which of the following database object does not physically exist?
(A) Base table (B) index (C) view (D) none of the above
135. NULL is
(A) The same as 0 for integer (B) the same as blank for character
(C) The same as 0 for integer and blank for character (D) not a value
136 .Which of the following is record based logical model?
(A) Network Model (B) Object oriented model (C) E-R Model (D) none of these
137 .A data dictionary is a special file that contains:
(A) The name of all fields in all files. (B) The width of all fields in all files. (C) The data type of all
fields in all files. (D) All of the above.
138 .A file manipulation command that extracts some of the records from a file is called
(A) SELECT (B) PROJECT (C) JOIN (D) PRODUCT
139 .The physical location of a record is determined by a mathematical formula that transforms A
file key into a record location is :
(A) B-Tree File (B) Hashed File (C) Indexed File (D) Sequential file.
140 .Using Relational Algebra the query that finds customers, who have a balance of over 1000 is
(A). Customer_name( s balance >1000(Deposit)) (B) S Customer_name( . balance >1000(Deposit))
(C). Customer_name( s balance >1000(Borrow)) (D) S Customer_name( . balance >1000(Borrow))
141 .A primary key is combined with a foreign key creates
(A) Parent-Child relation ship between the tables that connect them. (B) Many too many relationships
between the tables that connect them. (C) Network model between the tables that connect them. (D) None
of the above.
142. In E-R Diagram derived attribute are represented by
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
(A) Ellipse (B) Dashed ellipse (C) Rectangle (D) Triangle
143 .Cross Product is a:
(A) Unary Operator (B) Ternary Operator (C) Binary Operator (D) Not an operator
144 .An instance of relational schema R (A, B, C) has distinct values of A including NULL Values.
Which one of the following is true?
(A) A is a candidate key (B) A is not a candidate key (C) A is a primary Key (D) Both (A) and (C)
145. Consider the join of a relation R with relation S. If R has m tuples and S has n tuples,
Then the maximum size of join is:
(A) mn (B) m+n (C) (m+n)/2 (D) 2(m+n)
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
B
A
B
D
D
D
C
A
C
D
A
D
A
B
A
A
B
C
B
A
PART-B
(2 MARKS)
146. Write a relational algebraic expression to insert the information about Smith with his new
account number ‘A-157’ taken at the Perry ridge branch with Rs.1200.
Relational algebraic expression for insertion: account ¬ account È {(“A-157”, “Perry ridge”,
1200)}depositor ¬ depositor È {(“Smith”, “A-157”)}
147. Write a relational algebraic expression to insert a gift amount of Rs. 200/- for all Loan
customers of the Perry ridge branch. (A.U Nov/Dec 2010)
Relational algebraic expression for insertion: r1 ¬ sbranch_name = “Perry ridge” (borrower loan)
r2 ¬ pbranch_name, loan_no (r1) loan ¬ loan È (r2 x {(200)}) borrower ¬ borrower È pcust_name,
loan_no (r1)
148. Write a relational algebraic expression to update by adding the balances more
Than 10000 with Rs.60/- interest and otherwise Rs. 50/- interest.
Relational algebraic expression for updating:account ¬ pbranch_name, acc_no, balance ¬ balance
+ 60 (sbalance > 10000 (account)) Èpbranch_name, acc_no, balance ¬ balance + 50 (sbalance < 10000
(account))
149. Define materialized views and explain the use of such views.
Certain database systems allow view relations to be stored, but they make sure that if the actual
relations used in the view definition change then the view is kept up to date. Such views are called
materialized views. The process of keeping views up to date is called view maintenance.
Use of materialized views:
If the views are used frequently then materialized views are used. But benefits of materialization
must be weighed against the storage cost and the added overhead of updates.
150. Differentiate assertions and triggers. (i.e., write definitions) (A.U Nov/Dec 2009)
An assertion is a predicate expressing a condition that we wish the database to satisfy always.A
Trigger is a statement that is executed automatically by the system as aside effect of a modification to the
database.
151. List out the two requirements of triggers in database. (A.U.APRIL/MAY2013)
• Specify the conditions under which the trigger is to be executed.• Specify the actions to be taken
when the trigger executes.
152. Define Functional Dependencies. (A.U Nov/Dec 2007) (A.U Nov/Dec 2011)
Let X Í R and Y Í R, then the Functional dependency (FD) X ® Y holds on R if, in any relation
r(R), for all pairs of tuples t1 and t2 in r such that t1[X] =t2[X], it is also the case that t1[Y] = t2[Y].
153. List out the Functional Dependencies in the following relation and explain why.
ABCD
a1 b1 c1 d1
a1 b2 c1 d2
a2 b2 c2 d2
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
a2 b2 c2 d3
a3 b3 c2 d4
• A ® C holds, since for all tuples with same value for A holds in B too.• AB ® D holds, same case.• D ®
B holds, same case
154. Define Closure of Functional Dependency. (A.U NOV/DEC 2008) (A.U Nov/Dec 2009)
Let F be a set of FDs, then the closure of F is the set of all FDs logically implied by F. It is denoted
by F+
155. Define the three Armstrong’s Axioms or rules of inference.
• Reflexivity rule’s If a is a set of attributes and Y ÍX, then X ® Y holds.
• Augmentation rule’s If X ® Y holds and Z is a set of attributes, then ZX ® ZY holds.
• Transitivity rule’s If X ® Y holds and Y ® Z holds, then X ® Z holds.
156. Define union, decomposition, and Pseudo-transitivity rules. (A.U Nov/Dec 2011)
• Union rule’s If X ® Y holds and X ® Z holds, then X ® YZ holds.
• Decomposition rule’s If X ® YZ holds, then X ® Y holds and X ® Z holds.
• Pseudo-transitivity rule’s If X ® Y holds and ZY ® W holds, then XZ ® W holds.
157. List all the F+ using all the rules for the schema, R = (A, B, C, G, H, I) with the
Given Functional Dependencies ‘F’
A ® BA ® C
CG ® HCG ® I
B®H
• F+ for the given F is
o A ® H, transitivity rules A ® BC, union rule
o CG ® HI, union rileo AG ® H, pseudo-transitivity role AG ® I, pseudo-transitivity rule
158. Define normalization of data and denormalization. (A.U Nov/Dec 2009)
• Normalization:
Process of decomposing an unsatisfactory relation schema into satisfactory relation schemas by
breaking their attributes, so as to satisfy the desirable properties.
• Renormalizations:
Process of storing the join of higher normal form relations as base relation, which is in the lower
normal form.
159. Explain shortly the four properties or objectives of normalization.
• To minimize redundancy• to minimize insertion, deletion, and updating anomalies.
• Lossless-join or non-additive join decomposition• Dependency preservation
160. Define Partial Functional Dependency. (A.U May/June 2010) (A.U Nov/Dec 2011)
A FD x ® y is a partial dependency if some attribute A Î x can be removed from x and the
dependency still holds; i.e., for some A Î x, ( x – { A } )® y.
161. Define transaction-processing systems.
The concept of transaction provides a mechanism for describing logical units or database
processing. Transaction-processing systems are systems with large databases and many concurrent users
work with those systems.
162. Define read only transaction. (A.U.APRIL/MAY2013)
The database operations in a transaction do not update the database but only retrieve data and that
transaction is called a read-only transaction.
163. When does the transaction go into an active state and partially committed state?
A transaction goes into an active state immediately after it starts execution, where it can issue read
and write operations. When the transaction ends, it moves into the partially committed state.
164. What is called as committed state?
Once a transaction is committed, it has concluded its execution successfully and all its changes
must be recorded permanently in the database.
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
165. Define ACID property. (A.U Nov/Dec 2009) (A.U Nov/Dec 2011)
A–Atomicity, maintained by transaction manager component’s–Consistency, maintained by
application programmer by coding with integrity constraints. I – Isolation, maintained by concurrency
control component’s–Durability, maintained by recovery management component.
166. What is isolation of ACID properties? (A.U May/June 2009)
The execution of a transaction should not be interfered with any other transactions executing
concurrently.
167. Define cascading rollback.
An uncommitted transaction will be rolled back because of the failure of the first transaction, from
which other transactions reads the data item. This phenomenon of wasting the desirable amount of work is
called cascading rollback.
PART-C
(16 MARKS)
168. Explain in detail about active database concepts and triggers: (A.U May/June 2007)
169. What are temporal databases? Explain in detail. (A.U Nov/Dec 2010)
170. Write notes on deductive databases: (A.U May/June 2008) (A.U Nov/Dec 2011)
171. Explain mobile databases in detail. (A.U.APRIL/MAY2013)
UNIT V IMPLEMENTATION TECHNIQUES
PART-A
(1 MARKS)
172. The natural join is equal to:
(A) Cartesian Product (B) Combination of Union and Cartesian product (C) Combination of
selection and Cartesian product (D) Combination of projection and Cartesian product
173. Which one of the following is not true for a view?
(A) View is derived from other tables. (B) View is a virtual table. (C) A view definition is
permanently stored as part of the database. (D) View never contains derived columns.
174.A primary key if combined with a foreign key creates
(A) Parent-Child relationship between the tables that connect them. (B) Many to many relationship
between the tables that connect them. (C) Network model between the tables that connect them.
(D) None of the above.
175 .In E-R Diagram relationship type is represented by
(A) Ellipse (B) Dashed ellipse (C) Rectangle (D) Diamond
176 .Hierarchical models is also called
(A) Tree structure (B) Plex Structure (C) Normalize Structure (D) Table Structure
177.To delete a particular column in a relation the command used is:
(A) UPDATE (B) DROP (C) ALTER (D) DELETE
178.The ______ operators is used to compare a value to a list of literals values that have been
Specified.
(A) BETWEEN (B) ANY (C) IN (D) ALL
179 .A logical schema
A) is the entire database B) is a standard way of organizing information into a accessible part C)
describe how data is actually stored on disk D) none of these
180 .A B-tree of order m has maximum of _____________ children
(A) m (B) m+1 (C) m-1 (D) m/2
181._____________ function divides one numeric expression by another and returns the
Remainder.
(A) POWER (B) MOD (C) ROUND (D) REMAINDER
182 .A data manipulation command the combines the records from one or more tables is called
(A) SELECT (B) PROJECT (C) JOIN (D) PRODUCT
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
183 .In E-R diagram generalizations is represented by
(A) Ellipse (B) Dashed ellipse (C) Rectangle (D) Triangle
184._________ is a virtual table that draws its data from the result of an SQL
SELECT statement.
(A) View (B) Synonym (C) Sequence (D) Transaction
185..The method of access which uses key transformation is known as
(A) Direct (B) Hash (C) Random (D) Sequential
186 .A table joined with it is called
(A) Join (B) Self Join (C) Outer Join (D) Equi Join
187. _________ data type can store unstructured data
(A) RAW (B) CHAR (C) NUMERIC (D) VARCHAR
188 .Which two files are used during operation of the DBMS
(A) Query languages and utilities (B) DML and query language (C) Data dictionary and transaction
log (D) Data dictionary and query language
189. Relational Algebra is
(A) Data Definition Language. (B) Meta Language (C) Procedural query Language (D) None of the
above
190 .Hierarchical models is also called
(A) Tree structure (B) Plex Structure (C) Normalize Structure (D) Table Structure Ans: A
191 .The RDBMS terminology for a row is
(A) tuple. (B) Relation. (C) Attribute. (D) Degree.
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
D
C
A
C
B
A
A
D
A
B
C
D
A
B
B
A
A
C
C
A
PART-B
(2 MARKS)
192. What is blind write?
If a transaction writes a data item without reading the data is called blind write. This sometimes
causes inconsistency.
193. Define serial schedule.
A schedule, S is serial if for every transaction T participating in the schedule and all the operations
of T is executed consecutively in the schedule; otherwise the schedule is called Non-serial schedule.
194. What is the use of locking?
It is used to prevent concurrent transactions from interfering with one another and enforcing an
additional condition that guarantees serializability.
195. What is called as a time stamp? (A.U Nov/Dec 2010) (A.U Apr/May 2012)
A time stamp is a unique identifier for each transaction generated by the system. Concurrency
control protocols use this time stamp to ensure serializability.
196. What is shared lock and Exclusive lock?
Shared lock allows other transactions to read the data item and write is not allowed. Exclusive lock
allows both read and write of data item and a single transaction exclusively holds the lock.
197. When does a deadlock occur? (A.U May/June 2009) (A.U.APRIL/MAY2013)
Deadlock occurs when one transaction T in a set of two or more transactions is waiting for some
item that is locked by some other transaction in the set.
198. What is meant by transaction rollback? (A.U May/June 2008)
If a transaction fails for reasons like power failure, hardware failure or logical error in the
transaction after updating the database, it is rolled back to restore the previous value.
199. Write the reasons for using concurrent execution.
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
_ High throughput Number of transactions that are executed in a given amount of time is high.
_ Low delay Average response time is reduced. Average response time is the average time for a
transaction to be completed after it has been submitted.
200. Define recoverable schedule.
Recoverable schedule is the one where for each pair of transactions Ti and Tj such that Tj reads a
data item previously written by Ti, the commit operation of Ti appears before the commit operation of Tj.
201. Define Query optimization.
The DBMS must devise an execution strategy for retrieving the result of the query from the
database files. Process of choosing a suitable execution strategy for processing a query is known as Query
optimization.
202. Define Distributed database systems. (A.U May/June 2009) (A.U.APRIL/MAY2013)
A distributed system consists of a collection of sites, connected together via some kind of
communication network, in which each site is a full database system site in its own right.
o But the sites have agreed to work together so that a user at any site can access data anywhere in the
network exactly as if the data were all stored at the user’s own site.
203. What are the advantages of distributed system?
• Reliability: the probability that the system is up and running at any given moment.
• Availability: the probability that the system is up and running continuously throughout a specific period.
204. What is query processor?
The objective of minimizing network utilization implies the query optimization process itself
needs to be distributed as well as the query execution process.
205. Explain Client/Server. (A.U Nov/Dec 2009) (A.U Nov/Dec 2011)
Client/Server refers primarily to architecture, or logical division of responsibility, the client is the
application called the front end. The server is the DBMS, which is the back end.
206. What are the rules that have to be followed during fragmentation?
The three correctness rules are:
o Completeness: ensure no loss of data
o Reconstruction: ensure Functional dependency preservation
o Disjoint ness: ensure minimal data redundancy.
207. What are the objectives of concurrency control? (A.U May/June 2010)
o To be resistant to site and communication failure.
o To permit parallelism to satisfy performance requirements.
o To place few constraints on the structure of atomic actions.
208. What is multiple-copy consistency problem?
It is a problem that occurs when there is more than one copy of data item indifferent locations and
when the changes are made only in some copies not in all copies.
209. What are the types of locking protocols?
o Centralized 2 phase locking
o Primary 2 phase locking
o Distributed 2 phase locking
o Majority locking
210. What are the failures in distributed DBMS? (A.U May/June 2007)
o The loss of message
o The failure of a communication link
o The failure of a site Network partitioning
211. What is replication?
The process of generating and reproducing multiple copies of data at one or more sites is called
replication.
212. What are the types of replication?
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE
QUESTION BANK
II - CSE
o Read-only snapshots
o Updateable snapshots o MultiMate replication
o procedural replication
213. What are the applications of Data warehouse? (A.U Nov/Dec 2007)
• OLAP (Online Analytical Processing)
• DSS (Decision Support System)
• OLTP (On Line Transaction Processing)
214. What is parallel database?
In some of the architectures multiple CPUs are working in parallel and are physically located in a
close environment in the same building and communicating at a very high speed. The databases operating
in such environments known as parallel databases.
215. Define Data warehousing. (A.U NOV/DEC 2008)
Data warehouse is a “subject oriented, integrated, and non-volatile, time variant collection of data
in support of management’s decisions”.
216. Define data mining. (A.U May/June 2009) (A.U.APRIL/MAY2013)
The data mining refers to the mining or discovery of new information interns of patterns or rules
from vast amount of data.
PART-C
(16 MARKS)
227. Write notes on deductive databases:
228. Explain mobile databases in detail.
229. What are the Characteristics of mobile environment (A.U May/June 2008)
230. What is the Application: Intermittently synchronized databases?
231. Explain the advantages and disadvantages of DBMS. (A.U.APRIL/MAY2013)
232. Explain about scripting languages, CGI and HTTP cookies (A.U May/June 2007)
233. Define Oracle internet Platform and explain briefly the various services provide by it? (A.U
Nov/Dec 2007) (A.U.APRIL/MAY2013)
234. Explain the characteristics of biological data in GDB?
235. Write short notes on – Multimedia Databases. (A.U NOV/DEC 2008)
236. What are the Multimedia Database Applications (A.U May/June 2009)
237. Explain in detail the Parallel & Spatial Data base. (A.U May/June 2010)
238. Define Data mining? Briefly explain the different types of knowledge discovered during data
mining. (A.U Nov/Dec 2011) (A.U Apr/May 2012)
Mr.C.SELVAGANESAN ASST.PROFESSOR/CSE