DB Ass 1
DB Ass 1
Database Systems
Q1: Interview some users of database systems. Which DBMS features do they find most
useful and why? Which DBMS facilities do they find least useful and why? What do these
users perceive to be the advantages and disadvantages of the DBMS?
- Efficient Data Retrieval: SQL-based querying enables rapid and precise data extraction.
- Reduction of Data Redundancy: Normalization techniques optimize storage and improve efficiency.
- Cost Constraints: Licensing and operational costs limit adoption for smaller enterprises.
Q2:
A). List at least two reasons why database systems support data manipulation using a
declarative query language such as SQL, instead of just providing a library of C or C++
functions to carry out data manipulation.
B). Assume that two students are trying to register for a course in which there is only
one open seat. What component of a database system prevents both students from being
given that last seat?
Page |2
Instructor Name: Ms. Maria Gul Department: AI- Blue
Student Name: Ibadullah Qureshi Assignment: 01
Registration No: B23F0001AI072
- Performance Optimization: The DBMS query engine optimizes execution plans for efficiency.
Solution:
To solve this, we should normalize the file structure by separating the MANAGER_ADDRESS field into
distinct fields:
-Street Address
-City
-State
-ZIP Code
Page |3
Instructor Name: Ms. Maria Gul Department: AI- Blue
Student Name: Ibadullah Qureshi Assignment: 01
Registration No: B23F0001AI072
(d) Identifying and Reducing Data Redundancy:
Some redundancies in the data include:
1. Repeated Manager Information:
o "Holly B. Parker" appears multiple times with the same phone number and address.
o "George F. Dorts" appears multiple times with the same phone number and address.
2. Repeated Addresses:
o "3334 Lee Rd., Gainesville, FL 37123" appears multiple times.
o "124 River Dr., Franklin, TN 29185" appears multiple times.
Solution
To eliminate redundancies, we can create separate tables:
Manager Table (Unique managers with their contact details)
Project Table (Links projects to managers using a Manager ID instead of duplicating details)
Page |4
Instructor Name: Ms. Maria Gul Department: AI- Blue
Student Name: Ibadullah Qureshi Assignment: 01
Registration No: B23F0001AI072
Q5 A university uses a database to store course enrollment data. The structure of the
database is subject to frequent changes, such as the addition of new fields or changes to
the format of existing data (e.g., changing the course code format from numerical to
alphanumeric). However, the university needs to ensure that students and faculty can
continue to access their enrollment records without any issues. How can the database
design incorporate data independence to allow these changes to occur without affecting
the users or application functionalities?
Logical Data Independence
Use Views and Abstraction Layers:
o Define views that provide a stable interface for applications and users, even if the
underlying schema changes.
o Example: If the course code format changes from numerical to alphanumeric, a view
can transform and present the data in a consistent way.
Schema Modifications Without Affecting Applications:
o If new fields are added (e.g., course prerequisites), existing queries and reports still
function because they don’t rely on newly added columns unless explicitly modified.
Application Programming Interfaces (APIs) or Stored Procedures:
o Encapsulate database access using APIs or stored procedures, so applications interact
with the data through these predefined interfaces rather than directly with tables.
2. Physical Data Independence
Storage Optimization Without Affecting Access:
o If the university changes indexing methods or migrates data to a different storage
system, users continue to access data without modification.
Efficient Query Performance:
o Changes in data storage techniques (e.g., indexing, partitioning, compression) do
not impact how queries retrieve course enrollment records.
Page |5