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

DBMS Question

The document contains model questions for a database management systems exam. It includes 20 questions across multiple parts covering topics like database concepts, relational algebra, SQL, normalization, and concurrency control.

Uploaded by

examlab57
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
96 views

DBMS Question

The document contains model questions for a database management systems exam. It includes 20 questions across multiple parts covering topics like database concepts, relational algebra, SQL, normalization, and concurrency control.

Uploaded by

examlab57
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 57

FOURTH SEMESTER B-TECH DEGREE EXAMINATION OCT-2021

DEPAERTMENT OF COMPUTER SCIENCE AND ENGINEERING


CST 204: DATABASE MANAGEMENT SYSTEMS
MODEL QUESTION SET I
Max.MARKS :100 Duration :3Hrs
PART A
Answer all Questions.
Each question carries 3 Marks
1. List out any three salient features of a database systems. (3)

2 .When is multi-valued composite attribute used in ER modelling? (3)

3. For the SQL query, SELECT A, B FROM R WHERE B=’apple’ AND C = ‘orange’ on the table R(A, B, C,
D), where A is a key, write any two equivalent relational algebra expressions. (3)

4.0utline the concept of theta-join. (3)

5.How is the purpose of where clause is different from that of having clause? (3)

6. What is the use of a trigger? (3)

7 .When do you say that a relation is not in 1NF? (3)

8 .Given the FDs P→Q, P→R, QR→S, Q→T, QR→U, PR→U, write the sequence of Armstrong’s Axioms
needed to arrive at a. P → T b. PR → S (3)

9 .What is meant by the lost update problem? (3)

10. What is meant by check pointing? (3)

PART B

Answer any one Question from each module.

Each question carries 14 Marks

11 a. Design an ER diagram for the following scenario: There is a set of teams, each team has an ID
(unique identifier), name, main stadium, and to which city this team belongs. Each team has many
players, and each player belongs to one team. Each player has a number (unique identifier), name,
DoB, start year, and shirt number that he uses. Teams play matches, in each match there is a host
team and a guest team. The match takes place in the stadium of the host team. For each match we
need to keep track of the following: The date on which the game is played The final result of the match.
The players participated in the match. For each player, how many goals he scored, whether or not he
took yellow card, and whether or not he took red card. During the match, one player may substitute
another player. We want to capture this substitution and the time at which it took place. Each match
has exactly three referees. For each referee we have an ID (unique identifier), name, DoB, years of
experience. One referee is the main referee and the other two are assistant referee. (14)

1|P age
OR

12 a. Interpret the following ER diagram to relational schema. (8)

b. Distinguish between physical data independence and logical data independence with suitable
examples. (6)

13 EMPLOYEE(ENO, NAME, ADDRESS, DOB, AGE, GENDER, SALARY, DNUM, SUPERENO)


DEPARTMENT(DNO, DNAME, DLOCATION, DPHONE, MGRENO) PROJECT(PNO, PNAME, PLOCATION,
PCOST, CDNO) DNUM is a foreign key that identifies the department to which an employee belongs.
MGRENO is a foreign key identifying the employee who manages the department. CDNO is a foreign
key identifying the department that controls the project. SUPERENO is a foreign key identifying the
supervisor of each employee. Write relational algebra expressions for the following queries:-

(a) Names of female employees whose salary is more than 20000.

(b) Salaries of employee from ‘Accounts’ department

(c) Names of employees along with his/her superviser’s name

(d) For each employee return name of the employee along with his department name and the names
of projects in which he/she works

(e) Names of employees working in all the departments (14)

OR

14 a. Write SQL DDL statements for the following (Assume suitable domain types): i. Create the tables
STUDENT(ROLLNO, NAME, CLASS, SEM, ADVISER), FACULTY(FID, NAME, SALARY, DEPT). Assume that
ADVISER is a foreign key referring FACUTY table. ii. Delete department with name ‘CS’ and all
employees of the department. iii. Increment salary of every faculty by 10%. (10)

b. Illustrate foreign key constraint with a typical example. (4) COMPUTER SCIENCE AND ENGINEERING

2|P age
15. For the relation schema below, give an expression in SQL for each of the queries that follows:
employee(employee-name, street, city) works(employee-name, company-name, salary)
company(company-name, city) manages(employee-name, manager-name)

a) Find the names, street address, and cities of residence for all employees who work for the Company
‘RIL Inc.' and earn more than $10,000.

b) Find the names of all employees who live in the same cities as the companies for which they work.
c) Find the names of all employees who do not work for ‘KYS Inc.’. Assume that all people work for
exactly one company.

d) Find the names of all employees who earn more than every employee of ‘SB Corporation'. Assume
that all people work for at most one company.

e) List out number of employees company-wise in the decreasing order of number of employees.(14)

OR

16 a. Consider an EMPLOYEE file with 10000 records where each record is of size 80 bytes. The file is
sorted on employee number (15 bytes long), which is the primary key. Assuming un-spanned
organization and block size of 512 bytes compute the number of block accesses needed for selecting
records based on employee number if, i. No index is used ii. Single level primary index is used iii. Multi-
level primary index is used Assume a block pointer size of 6 bytes. (9)

b. Illustrate correlated and non-correlated nested queries with real examples. (5)

17 a. Illstrate3NF and BCNF with suitable real examples. (6)

b. Given a relation R(A1,A2,A3,A4,A5) with functional dependencies A1→A2A4 and A4→A5, check if
the decomposition R1(A1,A2,A3), R2(A1,A4), R3(A2,A4,A5) is lossless. (8)

OR

18 a. Consider the un-normalized relation R(A, B, C, D, E, F, G) with the FDs A→B , AC→G, AD→EF,
EF→G, CDE→AB. Trace the normalization process to reach 3NF relations. (7)

b. Illustrate Lossless Join Decomposition and Dependency Preserving Decomposition with typical
examples. (7)

19 a. Discuss the four ACID properties and their importance. (7)

b. Determine if the following schedule is conflict serializable. Is the schedule recoverable? Is the
schedule cascade-less? Justify your answers. r1(X), r2(Z), r1(Z), r3(X), r3(Y ), w1(X), c1, w3(Y), c3, r2(Y),
w2(Z), w2(Y), c2 (Note: ri(X)/wi(X) means transaction Ti issues read/write on item X; ci means
transaction Ti commits.) (7)

OR

20 a. Discuss the main characteristics of Key-value DB and Graph DB. (7)

b. Illustrate two-phase locking with a schedule containing three transactions. Argue that 2PL ensures
serializability. Also argue that 2PL ensures serializability. Also argue that 2Pl can lead to deadlock. (7)

STAFF HOD PRINCIPAL DIRECTOR

3|P age
FOURTH SEMESTER B-TECH DEGREE EXAMINATION OCT-2021
DEPAERTMENT OF COMPUTER SCIENCE AND ENGINEERING
CST 204: DATABASE MANAGEMENT SYSTEMS
MODEL QUESTION SET I
Max.MARKS :100 Duration :3Hrs
PART A

1. three salient features of a database systems:


a) it avoids data redundancy
b) helps in data isolation
c) removes concurrent access anomalies
2. multi-valued composite attribute: the attribute which has more than one value is called
multi valued attribute.
Eg: EMPLOYEE(Ename,Eid,EMobie,Eadddress,Edept)
In this the attribute address may have more than one value as its domain to represent
complete address of employee. Hence it is multi valued attribute

3.

4. The JOIN operation, denoted by , is used to combine related tuples from two relations
into single “longer” tuples. • This operation is very important for any relational database
with more than a single relation because it allows us to process relationships among
relations. JOIN operation on two relations5 R(A1, A2, ..., An) and S(B1, B2, ..., Bm) is • The
result of the JOIN is a relation Q with n + m attributes Q(A1, A2, ..., An, B1, B2, ... , Bm) in
that order;
THETA JOIN • where each is of the form Ai θ Bj, Ai is an attribute of R, Bj is an attribute of S, Ai and
Bj have the same domain, and • θ (theta) is one of the comparison operators {=, , ≥, ≠}. • Tuples
whose join attributes are NULL or for which the join condition is FALSE do not appear in the result •
the JOIN operation does not necessarily preserve all of the information in the participating relations,
▫ because tuples that do not get combined with matching ones in the other relation do not appear in
the result.

4|P age
5. For applying condition in the queries we use WHERE clause
Syntax : SELECT <attributes> FROM<tables WHERE <condition>
Eg: select name,id from STUDENT where dept=‘cse’
HAVING clause : In GROUP BY the grouping and functions are applied after the joining of the two
relations. Sometimes we want to retrieve the values of these functions only for groups that satisfy
certain conditions HAVING clause, which can appear in conjunction with a GROUP BY clause HAVING
provides a condition on the summary information regarding the group of tuples associated with each
value of the grouping attributes. Only the groups that satisfy the condition are retrieved in the
result of the query.

6.TRIGGERS
Triggers can be used to specify the type of action to be taken when certain events occur and when
certain conditions are satisfied. It may be useful to specify a condition that, if violated, causes some
user to be informed of the violation. The condition is thus used to monitor the database.
Eg: To check whenever an employee’s salary is greater than the salary of his or her direct supervisor
in the COMPANY database. Several events can trigger this rule: inserting a new employee record,
changing an employee’s salary, or changing an employee’s supervisor. Suppose that the action to
take would be to call an external stored procedure SALARY_VIOLATION,5 which will notify the
supervisor.
CREATE TRIGGER SALARY_VIOLATION BEFORE INSERT OR UPDATE OF SALARY, SUPERVISOR_SSN ON
EMPLOYEE FOR EACH ROW WHEN ( NEW.SALARY > ( SELECT SALARY FROM EMPLOYEE WHERE SSN =
NEW.SUPERVISOR_SSN ) ) INFORM_SUPERVISOR(NEW.Supervisor_ssn, NEW.Ssn );
A typical trigger has three components: EVENT: These are usually database update operations that
are explicitly applied to the database. In this example the events are: inserting a new employee
record, changing an employee’s salary, or changing an employee’s Supervisor. In some cases, it may
be necessary to write more than one trigger to cover all possible cases. These events are specified
after the keyword BEFORE. which means that the trigger should be executed before the triggering
operation is executed. An alternative is to use the keyword AFTER, which specifies that the trigger
should be executed after the operation specified in the event is completed.
CONDITION: That determines whether the rule action should be executed. Once the triggering event
has occurred, an optional condition may be evaluated. If no condition is specified, the action will be
executed once the event occurs. If a condition is specified, it is first evaluated, and only if it evaluates
to true will the rule action be executed. The condition is specified in the WHEN clause of the trigger.

5|P age
ACTION: The action is usually a sequence of SQL statements, but it could also be a database
transaction or an external program that will be automatically executed. In this example, the
action is to execute the stored procedure INFORM_SUPERVISOR.
7. First Normal Form (1NF)
Relational Table should not contain any multivalued attribute. Ie the values should be
atomic means cannot divide into further values.

STUDID STUDNAME STUDADDRESS CONTACTNO. DEPT


101 ABCD HOUSENO.7, 19TH 4414241 CSE
STREET,HOUSTON
251 PQRST LONDON 2589639 ME

In this table address field contains more values ie not atomic so it is not in 1NF
STUDID STUDNAME STUDADDRESS CONTACTNO. DEPT
101 ABCD HOUSENO.7 4414241 CSE

101 ABCD 19TH STREET 4414241 CSE

101 ABCD HOUSTON 4414241 CSE

251 PQRST LONDON 2589639 ME

Now the table is of atomic values..so it is in 1NF

8. FDs P→Q, P→R, QR→S, Q→T, QR→U, PR→U


a) P → T
P->Q, Q->T THEN BY Transitivity rule P->T
b) PR → S
By pseudotransitivity
P->Q AND QR->S HOLDS THEN PR->S EXISTS

6|P age
9. lost update problem

10. check pointing


A checkpoint is used for recovery if there is an unexpected shutdown
in the database. Checkpoints work on some intervals and write all dirty
pages (modified pages) from logs relay to data file from i.e from a buffer
to physical disk. It is also known as the hardening of dirty pages.
Checkpoint is a mechanism where all the previous logs are removed
from the system and stored permanently in a storage disk.
Checkpoint declares a point before which the DBMS was in consistent
state, and all the transactions were committed

7|P age
11.ER DIAGRAM

8|P age
12.a. Synthezing ER Diagram to relational table

9|P age
13.b.physical aand logical data independence

10 | P a g e
13. Relational algebra queries

14.a.SQL Queries

14.b. foreign key constraint


Referential Integrity • A constraint involving two relations ▫ The
previous constraints involve a single relation. • Used to specify a
relationship among tuples in two relations: ▫ The referencing relation
and the referenced relation. Tuples in the referencing relation R1
have attributes FK (called foreign key attributes) that reference the
11 | P a g e
primary key attributes PK of the referenced relation R2. ▫ A tuple t1
in R1 is said to reference a tuple t2 in R2 if t1[FK] = t2[PK]. • A
referential integrity constraint can be displayed in a relational
database schema as a directed arc from R1.FK to R2. The value in the
foreign key column (or columns) FK of the the referencing relation R1
can be either:  (1) a value of an existing primary key value of a
corresponding primary key PK in the referenced relation R2, or
(2) a null.0

15.SQL queries

12 | P a g e
16.a.

13 | P a g e
16.b. correlated and non-correlated nested queries
CORRELATED NESTED QUERIES • If a condition in the WHERE-clause of a nested query references an
attribute of a relation declared in the outer query , the two queries are said to be correlated • The
result of a correlated nested query is different for each tuple (or combination of tuples) of the
relation(s) the outer query

Here the nested query has a different result for each tuple in the outer query. A query written with
nested SELECT... FROM... WHERE... blocks and using the = or IN comparison operators can always be
expressed as a single block query

14 | P a g e
17.3NF and BCNF

15 | P a g e
16 | P a g e
17.b

Intersection of decomposed relation shouldnt be null


and and the decomposed relation should preserve all
functional dependencies……
Hence it is lossless decomposition

17 | P a g e
18.a.

18 | P a g e
18.b.

19 | P a g e
19.a. ACID properties of transaction
1. Atomicity
2. Consistency
3. Isolation
4. Durability

20 | P a g e
Atomicity
• A transaction is said to be atomic if either all of the commands are succeeded or
none of them
• Responsibility of Recovery Subsystem
• Eg; Transfer Rs. 100 from A to B:
BEGIN TRANSACTION
R(A);
A=A-100;
W(A);
R(B);
B=B+100;
W(B)
END TRANSACTION

Consistency
• A transaction should be consistency preserving
• It should take the database from one consistent sate to another
• Reponsibility of Programers who wrote the database programs
• Eg: Transfer Rs. 100 from A to B
• A=1000 A=900
• B=1000 B=1100
• Total=2000 Total=2000
Isolation
• Transactions should be isolate to each other during concurrent
execution
• Responsibility: Concurrent control subsystem
Durability or Permanency
• The changes applied to the database by committed transaction must
persist in the database
• these changes must not be lost because of any failure
• Responsibility of Recovery Subsystem

21 | P a g e
19.b.

• If a transaction Tj reads a data item written by transaction Ti, then the


commit operation of T j should happen only after the commit Ti, then
such schedules are recoverable
• If Writer_transaction should commit first, then Reader_transaction
commit (Recoverable Schedules)
• Cascadeless Schedules
• Schedule which are free from Cascading Rollbacks
• If every transaction in the schedule reads only items that were written
by committed transaction, then such a schedule is called Cascadeless
schedules
Hence it is recoverable and cascaded schedules

22 | P a g e
20.a.

Graph databases and key-value databases have very different features and are used for
accomplishing different tasks. Key-value databases are streamlined and fast, but are
limited and not as flexible. Graph databases, on the other hand, are very flexible and
great for research, but not terribly fast. Both typically use a non-relational foundation.

The two key strengths of graph databases are their flexibility and their focus on
relationships. Graph databases are especially useful because they highlight relationships
and connections between relevant data. These databases generate insights using the
existing data by placing a priority on the relationships within the information. Graph
database models communicate how the data is related, but can also help in forming the
research questions. Graph databases are good for organizing data using relationships,
and responding to complex queries.

A graph database is deliberately designed to show all of the relationships within the data.
Rather than using tables, a graph uses nodes, edges, and properties when defining and storing
data. A graph database is typically used for processing complex data when a query needs to go
more than a couple of levels deep. Its queries can be extremely powerful, though its increased
complexity causes it to run more slowly. This design makes modern graph databases an
excellent choice for analyzing any relationships within the data.

The key-value database came about as the simplest and, consequently, the
fastest NoSQL architecture. It is basically a simple two-column hash table, with each
row having a unique “key” (or ID) and a “value” that is associated with the key. The
keys can connect with the appropriate single data values extremely quickly (much more
quickly than a relational database).

Scaling is also a strength of key-value databases. Many of these database designs are
open-source and free. Key-value database have the ability to read and write operations
very quickly. For example, a computer using a key-value database would link a typed in
name (Mike) with a file containing a stored a phone number and other pertinent
information. They are normally very fast, but querying is very limited.

Key-value databases provide easy access to records of the customer’s behavior and preferences,
allowing the website or salesperson to customize the customer’s experience. A key-value
database can store data from multi-channel marketing sources and portfolio management
applications, and can provide the real-time information. Understanding key-value databases
can be quite useful.

20b.
Two-Phase locking protocol which is also known as a 2PL protocol needs transaction
should acquire a lock after it releases one of its locks. It has 2 phases growing and
shrinking. The timestamp-based algorithm uses a timestamp to serialize the execution of
concurrent transactions.

Two Phase Locking Protocol also known as 2PL protocol is a method of


concurrency control in DBMS that ensures serializability by applying a lock to

23 | P a g e
the transaction data which blocks other transactions to access the same data
simultaneously. Two Phase Locking protocol helps to eliminate the concurrency
problem in DBMS.
This locking protocol divides the execution phase of a transaction into three
different parts.

• In the first phase, when the transaction begins to execute, it requires


permission for the locks it needs.
• The second part is where the transaction obtains all the locks. When a
transaction releases its first lock, the third phase starts.
• In this third phase, the transaction cannot demand any new locks.
Instead, it only releases the acquired locks.

24 | P a g e
FOURTH SEMESTER B-TECH DEGREE EXAMINATION OCT-2021
DEPAERTMENT OF COMPUTER SCIENCE AND ENGINEERING
CST 204: DATABASE MANAGEMENT SYSTEMS
MODEL QUESTION SET II
Max.MARKS :100 Duration :3Hrs
PART A
Answer all Questions.
Each question carries 3 Marks

1. How is DML different from DDL. Write sample statements in DDL and DML (3)
2. What are the responsibilities of DBA (3)
3. What are the basic types available for attributes in SQL . (3)
4. List aggregate functions available in SQL. (3)
5.what do you mean by normalization? Why we go for normalization? (3)
6. What is the use of an assertions? (3)
7. When do you say that a relation is in BCNF? (3)
8. Write an algorithm to compute attribute closure of set attribute (X) under the se of
functional dependencies F (3)
9. What is meant by secondary level indexing in DBMS? (3)
10. What are characteristics of NoSQL (3)
PART B
Answer any one Question from each module.
Each question carries 14 Marks
11 a. With the help of neat diagram explain about the three schema architecture of DBMS(9)
b. With suitable example, define integrity constraints (5)
OR
12 a. A company has the following scenario: There are s set of salesperson. Some of them
manage other salespersons. However, a salesperson cannot have more than one manager. A
salesperson can be an agent for many customers. A customer is managed by exactly one sales
person. A customer can place any number of orders. An order can be placed by exactly one
customer. Each order list may have more than one items. An item may be listed in many
orders. An item assembled from different parts and parts can be common for many items.

Page 1 of 18
One or more employees assemble an item from parts. A supplier can supply different parts in
certain quantities. Apart may be supplied by different suppliers. (10)
i) Identify and list of entities, suitable attributes, primary key, foreign key and
relationships to represent the scenario
ii) Draw an ER diagram to model the scenario.

b. Write note on various database users. (4)


13. Synthesize following ER diagram to relational database

(14)
OR
14 a. The relational schema for library describing members, books, issues information is given
below. Foreign keys have same name as primary key (10)
BOOKS(ACC_NO, ISBN, TITLE, EDITION, YEAR)
MEMBERS(MEMERID,MEMBERNAME,MEMBERTYPE)
ISSUEDTO(ACC_NO, MEMERID,DATE_OF_ISSUE)
Write relational algebra expressions for the following queries
i) Accession numbers and names of third edition books published in 2018 (3)
ii) Names and dates of issue of books taken by a member with name ‘George’ (3)
iii) Names of book not taken by any member (4)

b. Illustrate derived and multivalued attributes with a typical example. (4)


15. In the following tables ADVISOR and TAUGHTBY are foreign keys referring to the table
PROFESSOR. ROLLNO and COURSEID in ENROLLMENT refer to tables with primary
keys of same name.
STUDENT(ROLLNO,NAME,AGE,GENDER,ADDRESS,ADVISOR)

Page 2 of 18
COURSE(COURSEID,CNAME,TAUGHTBY,CREDITS)
PROFESSOR(PROFID,PNAME,PHONE)
ENROLLMENT(ROLLNO,CORSEID,GRADE)
Write SQL expressions for the following queries
i) Names of courses taught by “Prof.John”
ii) Names of student who have not enrolled for any course taught by “Prof. Mathew”
iii) For each course, name of the course and number of students enrolled for the course.
(14)
OR
16. Consider a file with 2,00,000 records stored in disk with fixed length blocks of size
256bytes. Each record is of size 50 bytes. The primary key is 4 bytes and block pointer is 6
bytes, compute the following assuming that multilevel primary index is used as access path
i) Blocking factor for data records
ii) blocking factor for index records
iii)number of data blocks
iv) number of first level index blocks
v)number of levels of multilevel index (14)
17. Write notes on 3NF and BCD normalization of relational database (14)
OR
18. Differentiate lossless join and dependency preservation of the normalization (14)

19. What do you mean by locking? Explain about two phase locking (14)
OR
20. Compare key value DB and column family DB with its properties (14)

STAFF HOD PRINCIPAL DIRECTOR

Page 3 of 18
FOURTH SEMESTER B-TECH DEGREE EXAMINATION OCT-2021
DEPAERTMENT OF COMPUTER SCIENCE AND ENGINEERING
CST 204: DATABASE MANAGEMENT SYSTEMS
MODEL QUESTION SET II
ANSWER KEY
Max.MARKS :100 Duration :3Hrs
PART A

1.DDL and DML

Page 4 of 18
2. responsibilities of DBA

3.types of attributes
Simple attribute vs Composite attribute
• Single valued vs Multivalued attributes
• Stored vs Derived attributes
Refer 64 to 72 slides of module1

Page 5 of 18
4.Aggregate functions
Aggregate functions are used to summarize information from multiple tuples into a single-tuple
summary. • Grouping is used to create sub-groups of tuples before summarization. • A number of
built-in aggregate functions exist:

1. COUNT,

2. SUM,

3. MAX,

4. MIN, and

5. AVG

function returns the number of tuples or values as specified in a query. • The functions SUM, MAX,
MIN, and AVG can be applied to a set or multiset of numeric values and return, respectively, the
sum, maximum value, minimum value, and average (mean) of those values • These functions can be
used in the SELECT clause or in a HAVING clause

5.Normalization

6.Assertions
An Assertion is a statement in SQL that ensures a certain condition will always exist in the
database. It can be specified which can be used to specify additional types of constraints
that are outside the scope of the built-in relational model constraints such as primary and
unique keys, entity integrity, and referential integrity. Users can specify general constraints
via declarative assertions, using the CREATE ASSERTION statement. Eg: to specify the
constraint that the salary of an employee must not be greater than the salary of the
manager of the department that the employee works for in SQL, we can write the following
assertion:

Page 6 of 18
CREATE ASSERTION SALARY_CONSTRAINT CHECK ( NOT EXISTS ( SELECT * FROM EMPLOYEE E,
EMPLOYEE M, DEPARTMENT D WHERE E.Salary>M.Salary AND E.Dno=D.Dnumber AND
D.Mgr_ssn=M.Ssn ) );

7.BCNF(Boyce Code Normal Form)


• Boyce–Codd normal form (or BCNF or 3.5NF) is a normal form used in database
normalization.
• It is a slightly stronger version of the third normal form (3NF).
• If a relational schema is in BCNF then all redundancy based on functional
dependency has been removed, although other types of redundancy may still exist.
• A relational schema R is in Boyce–Codd normal form if and only if for every one of
its dependencies X → Y, at least one of the following conditions hold:
X → Y is a trivial functional dependency (Y ⊆ X)
X is a super key for schema R

DB(Patno,time,doctor)
R1(Patno,PatName)
R2(time,appNo)

8.attribute closure set

Page 7 of 18
9.Secondary level indexing
Secondary Indexes • Similar to the other indexes, but the data file is not ordered (or not ordered by
this index field). • The index is dense, with one entry for every record in the data file. • The index
entries are sorted on the index field, with a block pointer to the block of the main file containing the
corresponding record. • (Block pointer because, as a key field, there's only one record to be
retrieved, thus only one block, and the whole block must be retrieved anyway.

10.NoSQL
NoSQL databases (aka "not only SQL") are non-tabular databases and store data differently
than relational tables. NoSQL databases come in a variety of types based on their data
model. The main types are document, key-value, wide-column, and graph. They provide
flexible schemas and scale easily with large amounts of data and high user loads.

Here are the four main types of NoSQL databases:


• Document databases.
• Key-value stores.
• Column-oriented databases.
• Graph databases.

Page 8 of 18
11.a.Three schema architecture

Page 9 of 18
11.b.Integrity constraints
Relational Integrity Constraints
• Constraints are conditions that must hold on all valid relation states.
• There are three main types of constraints in the relational model:
▫ Key constraints
▫ Entity integrity constraints
▫ Referential integrity constraints

Page 10 of 18
• Another implicit constraint is the domain constraint ▫ Every value in a tuple must be from
the domain of its attribute (or it could be null, if allowed for that attribute)

Refer 32 to 37 slides of module2

12.a.ER diagram

Refer to ER diagram of model set 1 and redraw

Page 11 of 18
12.b.database users

Page 12 of 18
13. relational tables

14.a.realational algebra

Page 13 of 18
14.b.

In some cases, two (or more) attribute values are related ,for example, the Age and Birthdate
attributes of a person. • For a particular person entity, the value of Age can be determined from the
current (today’s) date and the value of that person’s birthdate. • The Age attribute is hence called a
derived attribute and is said to be derivable from the birthdate attribute, which is called a
stored attribute .

Page 14 of 18
15.SQL queries

16.

17.3NF andBCNF
Refer note or model set 1 answer of question 17 a

Page 15 of 18
18.Lossless and dependency perservation

Page 16 of 18
Refer note or model set 1 question no.18.b
19.two phase locking
Refer note or model set 1 question no.20.b.

Page 17 of 18
20.keyvalued DB and column family Db
A key-value database is a type of nonrelational database that uses a simple
key-value method to store data. A key-value database stores data as a collection of key-
value pairs in which a key serves as a unique identifier. Both keys and values can be
anything, ranging from simple objects to complex compound objects.

Features are
• Retrieving a value (if there is one) stored and associated with a given key.
• Deleting the value (if there is one) stored and associated with a given key.
• Setting, updating, and replacing the value (if there is one) associated with a given
key
Redis, Riak, and Oracle NoSQL database are examples of key-value databases.

A column family contains multiple rows. Each row has a unique key called Row
Key, which is a unique identifier for that row. Each column in column store databases has a
Name, Value, and TimeStamp fields. Each row can contain a different number of columns.
A column family is a database object that contains columns of related data. It is a tuple
(pair) that consists of a key–value pair, where the key is mapped to a value that is a set of
columns. In analogy with relational databases, a column family is as a "table", each key-
value pair being a "row".

Column-family Database features


• Each column family can be compared to a container of rows in an RDBMS table
where the key identifies the row and the row consists of multiple columns.
• Rows do not need to have the same columns, and columns can be added to any row
at any time without having to add it to other rows.
Cassandra DB is an example for column family database

Page 18 of 18
FOURTH SEMESTER B-TECH DEGREE EXAMINATION OCT-2021
DEPAERTMENT OF COMPUTER SCIENCE AND ENGINEERING
CST 204: DATABASE MANAGEMENT SYSTEMS
MODEL QUESTION SET III
Max.MARKS :100 Duration :3Hrs
PART A
Answer all Questions.
Each question carries 3 Marks

1. List out any three salient features of database systems (3)


2. Justify the importance of weak entity set with the help of example (3)
3. Illustrate the GROUP BY clause with the help of an example . (3)
4. Define the following terms
i)data model ii)database schema iii)meta data (3)
5.What are Armstrong axioms? (3)
6. Compare sparse indexing and dense indexing (3)
7. When do you say that a relation is in 2NF? (3)
8. What do you mean by minimal cover of Functional dependency (3)
9. What are the ACID properties of transaction (3)
10. What are characteristics of Document DB (3)
PART B
Answer any one Question from each module.
Each question carries 14 Marks
11 a. Explain about various data models of DBMS (9)
b. With suitable example, database languages (5)
OR
12 a. How a database is represented in ER diagram? Give various notations used in ER
diagram (10)
b. Write note on participation. (4)
13.a. Explain various join operation with examples (10)

Page 1 of 15
b. Give syntax for CREATE table and explain the components in it (4)
OR
14. Consider the following relations for the Bank database (Primary keys are underlined).

Customer (customer_name, customer_street, customer_city)

Branch (branch_name, branch_city, assets)

Account (account_number, branch_name, balance)

Depositor (customer_name, account_number)

Loan (loan_number, branch_name,amount)

Answer the following in SQL:

i. Create tables with primary keys and foreign keys?


ii. Create an assertion for the sum of all loan amounts for each branch must be less than the
sum of all account balances at the branch (14)

15. Explain the structure of B trees and B+ trees with neat diagram (14)
OR
16. What do you mean by views? Give the syntax for creating views. (14)
17. Discuss about dependency preserving properties of functional dependency (14)
OR
18. Differentiate 2NF and 3NF of normalization with examples (14)

19. What do you mean by transaction? Explain concurrency control . (14)


OR
20. Compare conflict and serial schedules (14)

STAFF HOD PRINCIPAL DIRECTOR

Page 2 of 15
FOURTH SEMESTER B-TECH DEGREE EXAMINATION OCT-2021
DEPAERTMENT OF COMPUTER SCIENCE AND ENGINEERING
CST 204: DATABASE MANAGEMENT SYSTEMS
MODEL QUESTION SET III
ANSWER KEY
Max.MARKS :100 Duration :3Hrs

1. three salient features of database systems


• self describing
• Isolation of data and programs ie data independence
• Data abstraction
• Support for multiple views
• Multi user transaction processing
2. weak entity set
Entity type that does not have any key attribute. ▫ A weak entity is dependent on a strong
entity to ensure the its existence. ▫ Unlike a strong entity, a weak entity does not have any
primary key. ▫ It instead has a partial discriminator key. ▫ A weak entity is represented by a
double rectangle. The relation between one strong and one weak entity is represented by a
double diamond.

3. GROUP BY clause
The WHERE-clause specifies the conditions for selection and join of tuples from the relations
specified in the FROM-clause • GROUP BY specifies grouping attributes • HAVING specifies a
condition for selection of groups • ORDER BY specifies an order for displaying the result of a
query • A query is evaluated by first applying the WHERE-clause, then GROUP BY and
HAVING
The GROUP BY clause specifies the grouping attributes, which should also appear in the
SELECT clause, • so that the value resulting from applying each aggregate function to a
group of tuples appears along with the value of grouping attributes

Page 3 of 15
4. data model ii)database schema iii)meta data

5. Armstrong axioms

Page 4 of 15
6. sparse indexing and dense indexing

Page 5 of 15
7. Second normal form(2NF)

Page 6 of 15
8.

9.ACID property
Refer note or answer of 19.9 of model set1

Page 7 of 15
10. Document DB
Amazon DocumentDB (with MongoDB compatibility) is a database service that is
purpose-built for JSON data management at scale, fully managed and integrated
with AWS, and enterprise-ready with high durability.
Amazon DocumentDB is designed to give you the scalability and durability you need
when operating mission-critical MongoDB workloads. Storage scales automatically
up to 64TiB without any impact to your application. It supports millions of requests
per second with up to 15 low latency read replicas in minutes, without any
application downtime, regardless of the size of your data.
With the launch of support for MongoDB 4.0 compatibility, Amazon DocumentDB supports the
ability to perform ACID transactions across multiple documents, statements, collections, and
databases.

ACID Transactions
With the launch of support for MongoDB 4.0 compatibility, Amazon DocumentDB supports the
ability to perform ACID transactions across multiple documents, statements, collections, and
databases.

Migration support
Customers can easily migrate their MongoDB databases on-premises or on Amazon EC2 to
Amazon DocumentDB for free (for six months per instance) with virtually no downtime using the
AWS Database Migration Service (DMS). With DMS, you can migration from a MongoDB replica
set or from a sharded cluster to Amazon DocumentDB. For more information about migrating
both relational and non-relational databases to Amazon DocumentDB, see Migrating to Amazon
DocumentDB.

Fully Managed
Automatic Provisioning and setup
Getting started with Amazon DocumentDB is easy. Just launch a new Amazon DocumentDB
cluster using the AWS Management Console. Amazon DocumentDB instances are pre-
configured with parameters and settings appropriate for the instance class you have selected.
You can launch a cluster and connect your application within minutes without additional
configuration.

Monitoring and Metrics


Amazon DocumentDB provides Amazon CloudWatch metrics for your cloud database instances.
You can use the AWS Management Console to view over 40 key operational metrics for your
cluster, including compute, memory, storage, query throughput, MongoDB opcounters, and
active connections.

Automatic Software Patching


Amazon DocumentDB will keep your database up-to-date with the latest patches. You can
control if and when your cluster is patched via Database Engine Version Management.

Performance at scale
High Throughput, Low Latency for Document Queries

Page 8 of 15
11.data models

Page 9 of 15
11.b Database languages
Refer answer of 1 of model set2
12.a. ER notes of first module
b. refer slides from 106 to110

13.a.refer 100 to 120 slides of module 2 notes


b.refer slides 142 to 145 of module 2

Page 10 of 15
14.SQL query

Page 11 of 15
15.B trees and B+ trees

Page 12 of 15
Page 13 of 15
16. Views

Page 14 of 15
17.refer model 2 set qno.18
18.refer model2 qno.18 and notes
19.refer slides 4,19,31 to 35 of module 5 for transaction,12
to16 for concurrency
20.refer 45 to 68 slides of module 5

**********************

Page 15 of 15

You might also like