BAED 201
Database Management System (DBMS)
ASSIGNMENT
1. Define Database Management System (DBMS) and provide some real-world examples where it is applied.
2. Explain the three levels of DBMS architecture (1-Tier, 2-Tier, 3-Tier). Provide one example application
for each architecture to demonstrate its usage.
3. Discuss the roles and functions of the Query Optimizer and Database Administrator in a DBMS.
4. Differentiate between the following concepts with suitable examples:
i. Relational DBMS vs NoSQL DBMS
ii. Physical Schema vs Logical Schema
iii. Candidate Key vs Composite Key
iv. Surrogate Key vs Natural Key
v. DROP TABLE vs TRUNCATE TABLE
5. Explain why a Weak Entity requires an identifying relationship. Describe a scenario where incorrectly
modeling a weak entity as a strong entity could lead to data anomalies.
6. What are the constraints in MySQL? List all the common constraints used in MySQL and illustrate each
with suitable examples.
7. Draw ER diagrams of the following:
i. Two entity types: Author and Book. Each book can have multiple authors, and each author can write
multiple books. Include the author’s contribution percentage per book in the ER diagram.
ii. A student can have multiple Phone_Numbers. Model this in an ER diagram and discuss how this
affects the retrieval complexity.
iii. A system tracks Projects, Employees, and Equipment. An employee can be assigned to multiple
projects, each project can use multiple pieces of equipment and each piece of equipment is managed
by exactly one employee. Draw an ER diagram and describe the necessary keys and constraints.
iv. A company has Employees and Departments. Each Employee works in one Department, and each
Department is managed by exactly one Employee. Model this relationship and explain the cardinality
and participation constraints.
v. A ternary relationship involving three entity types: Student, Course, and Instructor. Explain why
modeling this as three binary relationships may not capture the full semantics of the problem. Provide
an example where the ternary relationship is necessary.
8. Explain why total participation is represented by a double line in an ER diagram. Describe the potential
implications of mistakenly modeling it as partial participation in the database schema?
9. Discuss the purpose of the CREATE TABLE statement in DDL?
i. Write statements for create a table Student with columns: StudentID, Name, DOB.
ii. Write an INSERT INTO statement to add a new student with the following details:
StudentID: 101
Name: Amit Kumar
DOB: 24 March 1997
iii. Explain how the ALTER TABLE statement works. Write statements for adding a new column Email
of type VARCHAR(100) to the Student table.
10. i. Write a DDL statement to create a table Employee with the following columns:
EmployeeID (Primary Key, Integer type)
Name (limit of 50 characters)
Department (limit of 60 characters)
Salary (Decimal with 10 digits and precision of 2)
ii. How can you rename a table using DDL? Write a statement to rename the table Employee to
NewEmployee.
11. Explain how to insert data into a table with an auto-increment primary key. Provide an example using a
Customers table where CustomerID is auto-incremented, and only Name and Email are supplied.
12. Draw an ER diagram for hospital based on the given specifications: In a hospital, there are several
departments, such as Cardiology, Neurology, and Orthopaedics. Each department has a unique department
ID, a name, a location, and is headed by a doctor. Doctors have a unique employee ID, name,
specialization, phone number, and email. We track the following details about patients: name, unique
patient ID, sex, date of birth, phone number, and address (including street, city, and PIN code). Patients
may have multiple contact numbers and emergency contacts. Each patient is assigned to a primary doctor
but may also consult other doctors depending on their treatment needs. Each patient visit is recorded as an
appointment, which includes a unique appointment ID, appointment date and time, reason for visit, and
status (completed, cancelled, or pending). A patient may have multiple appointments with different
doctors. Doctors may perform treatments or procedures during appointments. Each treatment has a unique
treatment ID, name, type, and cost. Multiple treatments can be performed in a single appointment, and a
treatment can be associated with multiple patients over time. The hospital also maintains medical records
for each patient. A record includes a unique record ID, diagnosis, prescriptions, lab reports, and notes.
Medical records are linked to both the patient and the doctor who attended the patient. The hospital tracks
billing and payments, where each bill has a unique bill ID, total amount, payment method, and payment
status. Bills are associated with the patient and the services or treatments they received.
13. Design an Entity-Relationship (ER) diagram for a bank database that captures the key entities, their
attributes, and relationships. The database should include Customers, Accounts, Branches, Loans,
Employees, and Transactions. Describe the attributes for each entity, identify primary and foreign keys,
and explain the cardinality and type of relationships (one-to-one, one-to-many, or many-to-many) among
these entities. Also, mention any constraints that ensure data integrity, such as mandatory relationships or
optional associations