Uploaded by harshavb

Model QP-(21CSE403)-SY (2) (1).docx

advertisement
Duration: 3 Hrs
Maximum Marks: 100
DATABASE MANAGEMENT SYSTEM(INTEGRATED)
Note:
1. Part-A is mandatory.
2. Answer any five full questions from Part-B choosing at least one from each module.
3. Missing data may be suitably assumed.
PART-A
Q.No.
1
2
3
4
Question
L2
C
O
1
L2
2
2
L2
3
2
L2
4
2
L2
5
2
L2
2
2
BL
Number of tupules in a relation is known as
a)
Cardinality
b)
Degree
c)
Modality
d)
Domain
The physical storage structure can be changed without affecting
conceptual schema .This is known as
a)
Physical data independence
b)
Logical data independence
c)
External data independence
d)
None of the above
Which of the following is true
a)
CK=SK+PK
b)
CK=SK-PK
c)
CK=SK+PK+FK
d)
CK=PK+PK
If R and S are two database relations. If cardinalities of R and S are 4
PO
Mark
s
2
and 10 what will be the number of tuples if we use Join operation.
5
a)
14
b)
40
c)
10
d)
4
Which SQL constraint do we use to set some value to a field whose value has
not been added explicitly?
6
a)
Unique
b)
Not null
c)
Default
d)
Check
Which of the following can replace the below query?
SELECT Name, ID
FROM Student, Courses
WHERE Student_ID = Courses_ID
1|4
Q.No.
Question
a)
Select
Name,ID
Courses,Student
from
BL
b)
Select Name,ID from
Student
d)
Select Name,ID from
Student natural join Courses
where
CO
PO
Marks
Student_ID=ID
c)
7
Select ID from student Join
Courses
2NF relations are those that are in 1NF with all the attribute types
L2
2
2
L2
2
2
L2
3
2
L2
3
2
dependent on the ___ key.
8
a)
Primary key
b)
Candidate key
c)
Alternate key
d)
Foreign key
Let R = (A, B, C, D, E, F) be a relation scheme with the following
dependenciesC→F
E→A
EC → D
A→B
Which of the following is a candidate key
9
a)
CD
b)
EC
c)
CE
d)
AE
In a database, prior to and after a transaction, properties are used
to ensure ___.
a) Consistency
b) Redundancy
c)
10
Functional dependency
d)
Anonymity
Lock in a database is used to
a)
Concurrency controll
b)
Save memory
c)
Avoid FD
d)
Protect data
a)
Communication variables
b)
Connection variables
c)
SQL variables
d)
Programming variables
PART-B
Module-1
1
2|4
a)
Explain 3-Schema Architecture in detail.
L2
b)
Explain different types of attributes, entities and constraints which
supported in DBMS with an example
L3
1
1
10
10
Q.No.
Question
BL
CO
PO
Marks
OR
2
a)
Explain the characteristics of database approach.
L2
1
PO1
10
b)
With a neat diagram explain design phase of DBMS.
L3
1
PO1
10
2
PO1
10
2
PO2,
PO3
10
2
PO1
6
Module-2
3
a)
The SALARY database of an organization has a table with the
following attributes.
EMPLOYEE(empid:int,
emp_namee:string,
DOJ:date,
department:string,
salary:decimal)
i. Create the above table using suitable constraints.
ii. Enter the five tuples into the table
iii. Display all the number of employees working in each
department.
iv. Find the sum of the salaries of all employees.
v. Find the sum and average of the salaries of employees of a
particular
department.
b)
Explain following constructs used in SQL with an example
i)
Nested query
ii)
Triggers
iii)
Views
iv)
Aggregate function
v)
Assertion
L3
OR
4
3|4
a)
Consider the following database of student’s enrolment in courses
and books adopted for
each course.
STUDENT (regno: string, name: string, major: strong, bdate: date)
COURSE (course-no: int, cname: string, dept: string)
ENROLL (reg-no: string, course-no: int, sem: int, marks: int)
BOOK-ADOPTION (course-no: int, sem: integer, book-isbn: int)
TEXT (book-isbn: int book-title: string, publisher: string, author:
string)
i. Create the above tables by properly specifying the primary keys
and the foreign
Q.No.
Question
BL
CO
PO
Marks
keys
ii. Enter at least five tuples for each relation.
iii. Demonstrate how you add a new text book to the database and
make this book be
adopted by some department.
iv. Produce a list of text books (include Course-no, book-isbn,
book-title) in the
alphabetical order for courses offered by the ‘Compute Science’
department that use
more than two books.
v. List any department that has all its adopted books published by
a specific publisher.
b)
Explain with an example the basic constraints that can be
specified when the database table is created.
L3
2
PO2,
PO3
10
L3
3
PO2,
PO3
10
L1
3
PO1
10
Module-3
5
a)
Consider the relational database below,
Employee (pname, street, city)
Works (pname, cname, salary)
Company (cname, city)
Manages (pname, mgrname)
Write the SQL queries for the following using relational algebra
i)Find the names of all employees who work for First Bank
Corporation.
ii)Find the names and cities of residence of all employees who
work for First Bank Corporation.
iii)Find the names, street address, and cities of residence of all
employees who work for First Bank Corporation and earn more
than $10,000 per annum.
iv)Find the names of all employees in this database who live in the
same city as the company for which they
work.
c)
v)Find the names of all employees who live in the same city and
on the same street as do their managers.
Write a case study on streaming an application using HTTP source
and an JDBC sink.
OR
4|4
Q.No.
Question
6
a)
c)
7
a)
b)
8
Consider the following relation schema
Works(Pname,Cname,salary)
Lives(Pname,Street,City)
located_in (Cname, city)
Manager(Pname,Mgrname)
Write the SQL queries for the following using relational algebra
i. Find the names of all persons who live in the city
Bangalore.
ii. Retrieve the names of all person of "Infosys" whose
salary is between Rs .50000
iii. Find the names of all persons who lives and work in the
same city
iv. List the names of the people who work for “Tech M”
along with the cities they live in.
v)Find the average salary of “Infosys” persons
With an example explain cursors in Embedded SQL and JDBC
drivers.
Module-4
Explain insertion, deletion and modification anomalies. Why are
they considered bad?
Illustrate with example.
Explain 2NF,3NF with an example.
a)
OR
Explain the informal guidelines that may be used as measures to
determine the quality of relation schema design.
Write the algorithm to find the minimal cover for a sets of FD’s
Consider R={A,B,C,D,E,F} .FD’s {A->BCDE,CD->E,also find
super key and candidate key for the above relation.
Module-5
Discuss the transaction properties of database.
b)
Explain 2PL technique for concurrency control.
a)
b)
9
BL
CO
PO
Marks
L3
3
PO2,
PO3
10
L2
3
PO1
10
L2
4
PO2,
PO3
10
L2
4
PO2,
PO3
10
L2
4
10
L3
4
PO2,
PO3
PO2,
PO3
L2
5
PO1
10
L3
5
PO1
10
10
OR
10
5|4
a)
Why concurrency control is needed demonstrate with an example.
L2
5
PO1
10
b)
Write short notes on the following
I. transaction rollback and cascading rollback.
II. transaction support in SQL
III. shadow paging
IV. NO-UNDO/REDO Recovery Based on Deferred Update
V. Recovery Techniques Based on Immediate Update
L2
5
PO1
10
Download