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

dbmstotal assignment (1)

dbms

Uploaded by

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

dbmstotal assignment (1)

dbms

Uploaded by

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

DBMS Assignments

Theory assignments:
Assignment 1
1. State the differences between file system and DBMS.
2. Explain the advantages and disadvantages of indexing.
3. If a relational model has N attributes as {A1, A2...An} and candidate keys as {A1,
A2}, then the number of super keys?
4. Draw an ER diagram to model an online bookstore. The model should container the
following entities author, book, publisher, customer, shopping basket, warehouse.
5. Construct a B + -tree for the following set of key values: (2, 3, 5, 7, 11, 17, 19, 23, 29,
and 31) Assume that the tree is initially empty and values are added in ascending
order. Construct B + trees for the cases where the order of the nodes is as follows
a. Three
b. Five
c. Seven
Assignment 2

6. Consider the precedence graph of given figure. Is the corresponding schedule conflict

serializable? Explain your answer.


7. Consider the following two transactions and schedule (time goes from top to bottom).
Is this schedule conflict-serializable? Explain why or why not.
8. Explain all normalization in details with example.
9. Define a Relation Schema and a Relation?
10. Determine the closer of the following set of functional dependencies for a relation
scheme R(A,B,C,D,E,F,G,H), F={ AB→C, BD→EF, AD→G, A→H} List the
candidate keys of R.
Assignment 3

11. Explain the ACID properties in a database management system and why they are
important.
12. Consider the following table:
Student(ID, Name, Course, Instructor, Grade)
The following functional dependencies exist:
1. ID → Name, Course, Grade
2. Course → Instructor
identify the highest normal form of the table and explain the normalization process.
13. You are tasked with designing a database for an online bookstore. What tables and
relationships would you create to efficiently store information about books, authors,
customers, and orders?
14. What are relational integrity constraints? Discuss entity and referential constraints.
15. Insert the following key values 6, 16, 26, 36, 46 on a B+ tree with order = 3.

Assignment 4

16. Which key is responsible for maintaining referential integrity? How it maintain
referential integrity, Explain with example?
17. Determine the closure of the following set of functional dependencies for a relational
scheme R (A, B, C, D, E), F= {A͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢͢ →BC, CD→E, B→D, E→A}. List out the candidate keys
of R?
18. What is RDBMS?
19. Explain three level of architecture of DBMS?
20. Draw the ER Diagram for a Hospital Management System
Assignment 5

21. Given a relation R( A, B, C, D) and Functional Dependency set


22. FD = { AB → CD, B → C }, determine whether the given R is in 2NF? If not convert
it into 2 NF ?
23. Consider a relation- R ( A , B , C , D , E ) with functional dependencies-
A → BC
CD → E
B→D
E→A
find candidate key?
24. R(ABCDEFG)
AB->CD
AF->D
G->A
DE->F
C->G
F->E
Find
1. Candidate key
2. Find closure of all possible candidate key
LAB Assignments:
Assignment 1:
1. Perform the following:
a. Viewing all databases, SHOW DATABASES;
b. Creating a Database, (CREATE DATABASE school_db)
c. Viewing all Tables in a Database,
2. Creating Tables (CREATE TABLE) (Without Constraints), [Students(student_id,
name, Age, Gender), Course(course_id, course_name, credits)]
3. Creating Tables With constraints (eg. not null, primary key, foreign key)
 PRIMARY KEY ensures uniqueness and non-NULL values.
 NOT NULL prevents NULL values.
 UNIQUE ensures unique values in a column.
 CHECK enforces specific conditions.
 DEFAULT sets default values.
 AUTO_INCREMENT auto-generates unique numbers (useful for PRIMARY
KEY).
 FOREIGN KEY maintains referential integrity between tables.
Assignment 2:

4. Insert data in to tables.


5. Use ALTER commands to perform following tasks
 Add, Drop, Modify Columns
 Add, Drop Constraints
 Rename Tables and Columns
 Set/Remove Default Values
 Change Column Position (MySQL-specific)
 Enable/Disable Constraints (SQL Server-specific)
 Add/Remove Indexes
6. use RENAME, TRUNCATE, command
Assignment 3:

1. Consider a relational database:

Employee (employee – name, street, city)


Works (employee – name, company – name, salary)
Company (company – name, city)
Manages (employee – name, manager – name)
Write query, using SQL consisting of manager – name and the average salary of all
Employees who work for that manager. Explain why the database system should not allow
Updates to be expressed in terms of view.

2. Consider the following relational schema:

branch (branch_name, branch_city, assets)


customer (customer_name, customer street, customer city)
account (account_number, branch_name, balance)
depositor (customer_name, account_number)
borrower (customer_name, loan_number)

Answer the following SQL queries:

a. Find the loan number for each loan of an amount greater than $ 1200.
b. Find the names of all customers of the Bank who have a loan, an account, or both
from the Bank.
c. Find the customers of the Bank who have an account but not a loan.
d. Find the names of all customers with loans at the Perry ridge branch.
e. Find all customers who have an account at all branches located in Brooklyn city

Assignment 4:

1.

We want to change the country name for one of our tables, change David’ country name UK
to India and commit the operation.

2. Our customers' table, while performing some operations, we mistakenly updated the
first name of a customer as "JOHN", whereas it should be "PETER". Hence, we can
roll back our transaction to its original state.

You might also like