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

DBMS Tutorial (AB)

This document provides an overview of key concepts in database management systems (DBMS) through four chapters: 1. It introduces basic DBMS concepts like data vs. information, the overhead of DBMS for small databases, database design steps, evolution of database systems, advantages/disadvantages of DBMS, roles of DBA and database users, and database architecture. 2. Chapter 2 covers entity-relationship modeling including drawing ER diagrams for examples and defining keys. 3. Chapter 3 discusses relational data models and algebra including relations, joins, and operations. 4. The final chapter introduces SQL concepts like aggregate functions, join types with examples, views, and manipulation statements like alter, drop,

Uploaded by

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

DBMS Tutorial (AB)

This document provides an overview of key concepts in database management systems (DBMS) through four chapters: 1. It introduces basic DBMS concepts like data vs. information, the overhead of DBMS for small databases, database design steps, evolution of database systems, advantages/disadvantages of DBMS, roles of DBA and database users, and database architecture. 2. Chapter 2 covers entity-relationship modeling including drawing ER diagrams for examples and defining keys. 3. Chapter 3 discusses relational data models and algebra including relations, joins, and operations. 4. The final chapter introduces SQL concepts like aggregate functions, join types with examples, views, and manipulation statements like alter, drop,

Uploaded by

Rubik Raj Ray
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

DATABASE MANAGEMENT SYSTEM (DBMS) TUTORIAL

Compiled by Ankit Bhattarai


Department of Information and Communications Technology
Cosmos College of Management and Technology
2022
Cosmos College of Management and Technology

Chapter 1
1. Differentiate between data and information. Explain the reasons of overhead cost of using
DBMS in simple and small database.
2. As a database designer of an IT company you are assigned to carry out the task of
designing a database for an application. Now list out the steps that you would take in
setting up a database for that application.
3. Trace the evolution of database system & the needs to use this type of system in the
present context.
4. When not to use the database systems? Write down the disadvantages of DBMS.
5. Define RDMS. Explain the statement “DBA has central control over the database
system’.
6. Compare & contrast DDL, DML and DCL with examples of each.
7. Differentiate between DBMS and file system. Also, mention the case when not to use the
database system.
8. Mention the Role of DBA and explain different types of database users.
9. Explain the 3-tier architecture of database system in brief.

Chapter 2
1. Draw an ER diagram for social networking site. Include suitable four entity sets, multi
valued attribute, component attribute, mapping cardinalities, generalization/specialization
of your own.
2. Explain the distinction among the terms Primary Key, Candidate Key, Super Key and
Foreign Key with example.
3. Define data model. Write down the steps to design logical & physical data model.
4. What do you mean by Data Model? Discuss the importance in terms of security and
accessibility with various kinds of data models.
5. Compare different types of data models.
OR, On the basis of operation performed, distinguish between hierarchical model,
network model & relational model.
6. Draw an ER diagram for the following scenario
A university contains many faculties. The faculties in turn are divided into several
colleges. Each college offers numerous programs and each program contains many
courses. Teachers can teach many different courses and even the same course numerous
times. Courses can also be taught by many teachers. A student is enrolled in only one
program but a program can contain many students. Students can be enrolled in many
courses at the same time and the courses have many students enrolled.
7. Draw a neat ER diagram of Library Database. Assume entities, relations, attributes, Keys
and constraints and state them clearly.

Compiled by Ankit Bhattarai, CCMT (Database Management and Technology)


Cosmos College of Management and Technology

8. You are organizing an inter university gliding competition.


i. Each university consist of universityname, entryfee as attributes & have participated as a
team.
ii. Each university team consist of no. of players who takes part in the competition, everybody
who competes must be a member of one of the teams.
iii. Each player has playerid, name & experienclevel.
iv. Each player files a glider & has crew capacity constraint while flying.
v. Each glider consist of type, callsign & numseats as attributes.
vi. The competition is based on the task attribute which is evaluated while flying. Each task has
compDayNo, starttime & finishtime.

Draw an ER diagram for the case & show cardinality mappings.

9. Suppose you are given the following requirements for a simple database for the
Employee Management System:
i. An employee may work in up to two departments or may not be assigned to any
department.
ii. Each department must have one and may have up to three phone numbers.
iii. Each department can have anywhere between 1 and 30 employees.
iv. Each phone is used by one, and only one, department.
v. Each phone is assigned to at least one, and may be assigned to up to 30
employees.
vi. Each employee is assigned at least one, but no more than 5 phones.

Construct a clean and concise ER diagram for the database. Clearly indicate the
cardinality mappings.

Compiled by Ankit Bhattarai, CCMT (Database Management and Technology)


Cosmos College of Management and Technology

Chapter 3
1. How does a view differ with relation? Define the role of view in security.
2. Explain the different types of basic operation used in relational algebra.
3. Consider the following relations stud_1 and stud_2

Stud_1
Name Roll_no Marks Roll_no Address

Harry 301 85 301 Patan


Preeti 302 76 303 Kathmandu
Sana 303 88 305 Bhaktapur

306 Kirtipur

i. What are the steps to compute stud_1 natural join stud_2? Using it, write the result.
ii. Show the name and Roll_no of those students whose marks are less than 86 from relation
stud_1 (Write only relational algebra expression).
iii. Write the result of following in between stud_1 and stud_2 relation:
a) Right outer join
b) Left outer join
4. What do you mean by database schema? Explain different levels of data models used in
database design. (NOTE: Checkout types of data models too)
5. Consider the following schema
employee (E_id*, Name, Street, City)
Works (E_id*, C_id*, Post, Salary)
Company (C_id*, Cname, location)

Write RA expression for following:


i) An employee changes E_id as E202 whose address is Minnesota.
ii) Remove all employee record who worked as manager and C_id=C306.

6. Consider the relational database:

Teacher (name, age, address)


Works (name, f_no)
Faculty (f_no, faculty_name, block, room)
Write Relational Algebra for the following cases:
i. Display the block of teacher named Laure.
ii. Count the number of teachers working in block ‘Annapurna’

Compiled by Ankit Bhattarai, CCMT (Database Management and Technology)


Cosmos College of Management and Technology

iii. Delete all the faculty of block named ‘Machhapuchhre’.


iv. Insert the given data (112, Tunnelling, Dhaulagiri, 215) in faculty.
7. Consider the following schema of a relational database
Branch (branch-name,branch-city,assets)
Account(account-number,branch-name,balance)
Customer(customer-id,customer-name,customer-street,customer-city)
Depositor(customer-id,account-name)
Loan(loan-number,branch-name,amount)
Borrow(customer-id,loan-number)
Write the relational algebra for the following queries:
i. Find all customer either acoount or loan.
ii. List the name and city of customer who have their account at the branch location
“Jumla”
iii. Delete all account in the branch “B7”
iv. Increase balance by 5% to all branches.
8. Consider the following relational schema:
Customers (cid, cname, city)
Products (pid, pname, city, quantity, price)
Agents (aid, aname, city)
Orders (ordno, cid, aid, pid, month, quantity, total)
Write the relational algebraic expression for the following tasks:
i. Find all (ordno, cid) pairs for order with a total value less than 1000
ii. Find all product names of products in Berkeley ordered in April.
iii. Find pids of products ordered through agent 3 but not through agent 8.

9. Write short notes on:


i. Data Dictionary
ii. Constraints

Chapter 4
10. What does HAVING clause do and what is its relationship with GROUP BY clause?
Explain with examples.
11. Differentiate between SQL and MYSQL. Why access to database from a general purpose
programming language is required? Explain.
12. What is aggregate function? Explain its various types.
13. Explain different types of join in DBMS with an example.
14. What are views in SQL? Explain equi join, natural join, left & right outer join with
examples.
15. Explain views in SQL with suitable example.

Compiled by Ankit Bhattarai, CCMT (Database Management and Technology)


Cosmos College of Management and Technology

16. Compare alter, drop, delete & update statements. How Group by clause differ from
Having Clause? Explain it with suitable example.

17. Write the SQL statements for the following queries by reference of Players_details
relation:

Players_id Players_name Join_year Players_club Players_worth


1 Paul Pogba 2016 Manutd 200M
2 Ronaldo 2018 Juventus 105M
3 Messi 2007 Barcelona 300M
4 Mbappe 2017 PSG 230M
5 Hazard 2019 Real Madrid 160M
i. Create the table Players_details relation.
ii. Modify the data so that Hazard now plays for real madrid club.
iii. List all records for players who have played for the same club for more than 3 year.
iv. Delete the records of all players having worth more than 200 million.

18. Consider the following relational database model:


employee(employee-name,street,city)
works(employee-name,company-name,salary)
company(company-name,city)
manages(employee-name,manager-name)
Write SQL queries for the following needs:
i. Modify the database so that Himal now lives in Humla
ii. Give all employees of “Global Bank” a 10 percent raise.
iii. Give all managers of “Global Bank” a 30 percent raise unless the salary becomes
greater than 100,000
iv. Delete employee who has maximum amount of salary.

Compiled by Ankit Bhattarai, CCMT (Database Management and Technology)


Cosmos College of Management and Technology

19. Write the SQL statements for the following queries by reference of Hotel_details relation:

hotel_id hotel_name estb_year hotel_star hotel_worth

1 Hyatt 2047 Five 15M

2 Lalitpur 2043 Three 5M

3 Sherpa 2058 Five 20M

4 Yeti 2052 Four 11M

5 Hotel Barahi 2055 Three 7M

i. Create a database named hotel & table relation.


ii. Create a view named Price which shows hotel name & its worth.
iii. Modify the data so that Hotel Chitwan is now four star level.
iv. Delete the records of all hotels having worth more than 9M.
20. Consider the following three relations.
Doctor (Name,age,address)
Works(Name,Depart_no,salary)
Department(Depart no,depname,floor,room)
Write down the SQL statement for the following.
i. Display the name of Engineer who do not work in any department.
ii. Modify the database so that Er. Ramesh lives in Bharatpur.
iii. Delete all record of Engineer working in civil department.
iv. Display the name of Engineers who work in at least two departments.

21. Consider the following three relations.


Student (Rollno, Name, age, address)
Studies(Rollno, faculty_no,cost)
Faculty( Faculty_no, faculty_name, block, classroom)
Write down the SQL statement for the following:
i. Display the name of students who have paid more than 100000 cost for
admission.
ii. Modify the database so that Ram now have Rollno 19172.
iii. Delete all the records of student studying in block ‘C’.
iv. Display name of students studing in Computer faculty at block ‘C’.

Compiled by Ankit Bhattarai, CCMT (Database Management and Technology)


Cosmos College of Management and Technology

22. Consider a relational schema :


Teacher(TeacherID,TeacherName,Office)
Write SQL statement for the following task:
i. To create a table
ii. To eliminate duplicate rows
iii. To add a new column ‘Gender’ in the table
iv. To sort data in a table
v. To delete rows
vi. Count number of rows based on office
23. Explain QBE & stored Procedure in detail with the help of example.
24. What type of mechanism is used when we have established link between two or more
than relations/tables? Explain all its types in brief.

Chapter 5
1. What do you mean by integrity constraints? Explain assertion and triggers in SQL with
their syntax.
2. What is referential integrity? Explain with example about functional dependency and
multi valued dependency.
3. Differentiate between normalization and de-normalization. Explain decomposition
including its types.
4. Explain BCNF with suitable example.
5. Explain multi valued dependency and 4NF with suitable example.
6. Define functional dependency. Explain the closure set of functional dependency with
example
7. Briefly explain how to normalize a database from un-normalized form to 1NF, 2NF, 3NF
and 4NF.
8. Define 3NF. Convert the following 2NF relation into 3NF (Consider Name as primary
key).

Name Address Phone Salary Post

Gill KTM 456789 20000 Engineer

Van BKT 654321 20000 Engineer

Robert KTM 456789 20000 Engineer

Brown BKT 654321 10000 Overseer

Albert KTM 454545 10000 Officer

Compiled by Ankit Bhattarai, CCMT (Database Management and Technology)


Cosmos College of Management and Technology

9. Define constraint. What are the different types of constraints that can be used while
creating a table?
10. What is database anomaly? Explain different types of database anomalies with suitable
examples.
11. Write short notes on:
i. 3.5 NF
ii. Join Dependency
iii. Cascading in referential Integrity
iv. Assertions Vs Triggers
v. 4NF and 5NF

Chapter 6
1. Is it necessary to manage security at OS level if security in database level is already
done? Explain private key cryptosystem.
2. Discuss about the Access control mechanisms and cryptography methods to secure the
database.
3. Why security is needed in database? How security can be granted using view explain?
OR, how does a view differ with relation? Explain the role of view in security.
4. Explain two different parts of access control in detail.
5. Write short notes on:
i. Bell-La Padula
ii. Encryption and decryption
iii. Authorization vs Authentication
6. Compare security & integrity in DBMS.

Chapter 7
1. How equivalence of expressions used in a query optimization. Explain with example.
Also, explain the cost estimation of query Optimization.
2. What is query processing? Explain with diagram describing each step in detail.
3. What is query cost estimation? Explain cost based & heuristic based choice of evaluation
plan for query optimization.
4. What are equivalence rules? How are they related with query optimization?
5. What are equivalence rules? List down the different equivalence rules.
6. Define query optimization. Write down the steps of query optimization.

Chapter 8
1. How the file is organized using hash function and hashing? Explain.

Compiled by Ankit Bhattarai, CCMT (Database Management and Technology)


Cosmos College of Management and Technology

2. What is memory hierarchy? Explain the hierarchy of storage.


3. Compare the advantages and disadvantages of heap file organization and sequential file
organization. If records are to be processed randomly which one do you prefer among
those two organizations?
4. Define B+ tree. Write down algorithm for insertion & deletion in B+ Tree.
5. Construct B+-tree for the following set of key values: (1, 3, 6, 7, 11, 19, 23, 30, 32).
Assume that the tree is initially empty and values are added in ascending order.
Construct B+-trees for the case where the number of pointers that will fit in one node is
Four. Also show the form of the tree after insertion of 9.
6. Create a B+ tree of order 4 with following data: (3, 8, 15, 25, 1, 20, 14, 15, 10, 11, 13) of
order 4. Assume that, tree is initially empty and values are added in ascending order.
Also, show the formation of tree after the deletion of 15.

Chapter 9
1. What are the three types of failure? Explain each with example.
2. Justify the statement “Remote backup system is a must in country like Nepal where
natural disasters are common’.
3. Explain two types of recovery techniques.
4. Compare the shadow paging recovery scheme with the log-based recovery schema.
5. What do you mean by deferred modification and immediate modification?

Chapter 10
1. What is conflict serializable? Explain the concept of locking for concurrency control.
2. When the schedule is called serializable? Explain view and conflict serializable with
example.
3. Differentiate between exclusive lock and shared lock.
4. Define Conflict serializability. Explain deadlock & the conditions which prevent it.
5. What is concurrency control? Explain the ACID properties of transaction in detail.
6. Define schedule. Compare conflict serializability with respect to view serializability.

Chapter 11
1. Write short notes on:
i. ORM
ii. Object Oriented DBMS (OODBMS)
iii. Data Mining and data warehouse
2. Compare and Contrast between heterogeneous and homogeneous distributed databases.
3. What are distributed databases? Explain the architecture of distributed database system.

Compiled by Ankit Bhattarai, CCMT (Database Management and Technology)

You might also like