0% found this document useful (0 votes)
8 views6 pages

Database Management Concepts and Practices

The document consists of tutorial questions related to database management, covering topics such as database definitions, user categories, DBMS benefits, normalization, and entity-relationship diagrams. It includes practical exercises involving the creation of ER diagrams, relational schemas, and SQL queries for various scenarios. Additionally, it addresses anomalies in database design and normalization processes.

Uploaded by

Kisangwa Mrumbi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
8 views6 pages

Database Management Concepts and Practices

The document consists of tutorial questions related to database management, covering topics such as database definitions, user categories, DBMS benefits, normalization, and entity-relationship diagrams. It includes practical exercises involving the creation of ER diagrams, relational schemas, and SQL queries for various scenarios. Additionally, it addresses anomalies in database design and normalization processes.

Uploaded by

Kisangwa Mrumbi
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Database Management

Tutorial Questions for Discussions

1. What is a database?
2. Describe four categories of database users
3. What is database management system (DBMS)?
4. What are the benefits of database system over traditional file-based system?
5. Outline some examples of DBMS
6. What are the five characteristics of good database?
7. What are three levels of database architecture?
8. What are the three common database models?
9. What is E/R model?
10. At which level of database architecture does E/R apply?
11. What are the three components of ER diagram?
12. Draw symbols for each of the three components of E/R diagram
13. Describe three types of cardinality ratio
14. What it is a degree of a relationship?
15. Explain how many-to-many relation can be handled in a database design
16. Explain how one-to-one relationship can be handled in a database design
17. Explain how composite attributes are handled in database design
18. Explain how multivalued attributes are handed in database design
19. What is normalization? What does it try to achieve in database designing?
20. What is denormalization? What does it try to achieve in database designing?
21. What is the characteristic of an unnormalized relation?
22. What are the conditions for the relation to be in 1NF?
23. What are the conditions for the relation to be in 2NF?
24. What are the conditions for the relation to be in 3NF?
25. What are the conditions for the relation to be in BCNF?
26. What are the conditions for the relation to be in 4NF?

QUESTION 27

UPS prides itself on having up-to-date information on the processing and current location of each
shipped item. To do this, UPS relies on a company-wide information system. Shipped items are
the heart of the UPS product tracking information system. Shipped items can be characterized
by item number (unique), weight, dimensions, insurance amount, destination, and final delivery
date. Shipped items are received into the UPS system at a single retail center. Retail centers are
characterized by their type, uniqueID, and address. Shipped items make their way to their
destination via one or more standard UPS transportation events (i.e., flights, truck deliveries).
These transportation events are characterized by a unique scheduleNumber, a type (e.g, flight,
truck), and a deliveryRoute.

(a) Please create an Entity Relationship diagram that captures this information about the UPS
system. Be certain to indicate identifiers and cardinality constraints.

(b) Transform the above ER diagram into relational database schema

QUESTION 28

Production tracking is important in many manufacturing environments (e.g., the pharmaceuticals


industry, children’s toys, etc.). The following ER diagram captures important information in the
tracking of production. Specifically, the ER diagram captures relationships between production
lots (or batches), individual production units, and raw materials.

(a) Please convert the ER diagram into a relational database schema. Be certain to indicate
primary keys and referential integrity constraints.

(b) Implement the schema into physical database (MYSQL DBMS)


QUESTION 29

Normalize the following schema, with given constraints, to 3NF:

books(accessionno, isbn, title, author, publisher)


users(userid, name, deptid, deptname)
accessionno → isbn
isbn → title
isbn → publisher
isbn →→ author
userid → name
userid → deptid
deptid → deptname

QUESTION 30
In the given employee table
a) There exist insertion anomaly? If yes, then explain.
b) There exist modification anomaly? If yes, then explain.
c) There exist deletion anomaly? If yes, then explain.
QUESTION 31
Table 4-8 shows a portion of a shipment table for a large manufacturing company.
Each shipment (identified by Shipment#) uniquely identifies the shipment Origin,
Destination, and Distance. The shipment Origin and Destination pair also uniquely
identifies the Distance.
a) Show the functional dependencies in the SHIPMENT relation.
b) In what normal form is SHIPMENT? Why?
c) There exist insertion anomaly? If yes, then explain.
d) There exist modification anomaly? If yes, then explain.
e) There exist deletion anomaly? If yes, then explain.
f) Convert SHIPMENT to 3NF if necessary. Show the resulting table(s) with the
sample data presented in SHIPMENT.

QUESTION 32

Convert the following table in


a) 1NF
b) 2NF
c) 3NF
QUESTION 33

Write SQL command for a) to e) and write the output of f) on the basis of table MOV

a) Find the total value of the movie cassettes available in the library.

b) Display a list of all movies with price over 20 and sorted by price

c)Display all the movies sorted by QTY in decreasing order.

d)Display a report listing a movie number, current value and replacement value for each movie
in the above table. Calculate the replacement value for all movies as QTY * Price * 1.15

e) Count the number of movies where Rating is not “G”

f) Give the output of the following SQL statement

[Link] MAX(price) FROM MOV WHERE PRICE > 30

[Link] SUM ( price * qty) FROM MOV WHERE QTY < 4

[Link] COUNT ( DISTINT TYPE)


QUESTION 34

Consider the insurance database given below:

person (driver-id, name, address)

car (license, model, year)

accident (report-number, date, location)

owns (driver-id, license)

participated (driver-id, car, report-number, damage-amount)

Construct the following SQL queries for this relational database

.i) Find the total number of people who owned cars that were involved in accidents in 2004.

ii) Find the number of accidents in which the cars belonging to “Thakre” were involved.

iii) Delete the Mazda belonging to “S Khan”.

Common questions

Powered by AI

Composite attributes, which are attributes that can be divided further into smaller subparts, are managed during the database design process by storing each component part as separate columns within the table. For example, an attribute like 'Full Name' can be divided into 'First Name' and 'Last Name' to handle the data more efficiently and allow for greater search capabilities. This approach facilitates more robust data analysis and query capabilities, aligning with normalized database designs .

Transforming an entity-relationship (ER) diagram into a relational database schema involves converting the entities and relationships diagrammatically represented in the ER model into relational tables. Each entity set in the ER diagram is usually converted into a table, with attributes becoming columns. The primary key of the entity becomes the primary key of the table. Relationships are converted into foreign keys or separate tables as needed, with referential integrity constraints applied to maintain correct associations between tables. This process enables transitioning from a conceptual design to a logical design, ensuring that the database fulfills the necessary requirements while being ready for implementation in a relational database management system .

To handle many-to-many relationships in a database design, an associative entity (or junction table) is created to store the relationship between the two participating entities. This table will include foreign keys from both tables it connects, and optionally, any attributes specific to this association. These foreign keys together typically form the primary key of the associative table. This strategy resolves the many-to-many relationship by converting it into two one-to-many relationships, making it manageable within relational database structures .

Converting a table exhibiting insertion, modification, and deletion anomalies into 3NF involves several steps: 1) Identify all functional dependencies in the table. 2) Ensure the table is in 1NF by removing repeating groups. 3) Convert the table to 2NF by ensuring that attributes are fully functionally dependent on the primary key. This involves removing partial dependencies. 4) Finally, achieve 3NF by eliminating transitive dependencies, ensuring no non-prime attribute depends transitively on the primary key. This may involve splitting the table into multiple related tables to uphold these conditions .

For a database relation to be in Boyce-Codd Normal Form (BCNF), it must first be in 3NF, and for every one of its dependencies (X → Y), X should be a superkey. Essentially, every determinant must be a candidate key, ensuring that there are no partial dependencies or transitive dependencies on a non-prime attribute .

To achieve the Fourth Normal Form (4NF) in database normalization, a table must first be in Boyce-Codd Normal Form (BCNF). Additionally, the table must not contain any non-trivial multivalued dependencies other than a candidate key. This means that for any multivalued dependency X →→ Y, X must be a superkey. If these conditions are violated, the database design should be adjusted to separate the independent multivalued facts into distinct tables, ensuring that each table contains data that is only dependent on its primary key .

A database management system (DBMS) offers several advantages over traditional file-based systems. These include improved data sharing and data security, better data integration, minimized data inconsistency, improved data access, increased end-user productivity, and improved data accuracy and reliability. DBMS also supports data backup and recovery more efficiently, provides a standardized way to access data, and facilitates concurrent access by multiple users .

Normalization to the Third Normal Form (3NF) requires that a schema is in Second Normal Form (2NF) and that all of its non-prime attributes are non-transitively dependent on every candidate key of the table. Boyce-Codd Normal Form (BCNF) is a stronger version of 3NF. A table is in BCNF if, after being in 3NF, every determinant in the table is also a candidate key. Hence, BCNF addresses certain anomalies that 3NF alone might not cover, particularly when the table contains more complex dependencies .

The entity-relationship (E/R) model is implemented in the conceptual level of the database architecture. The conceptual level provides a high-level view of the whole database, and the E/R model is used here to define the entities, attributes, and relationships involved in the database design, without considering how these entities and relationships will be physically represented in the database .

Common anomalies associated with database tables include insertion anomalies, modification anomalies, and deletion anomalies. Insertion anomalies occur when certain attributes cannot be inserted without the presence of other attributes. Modification anomalies happen when changes to data require multiple updates to avoid inconsistency. Deletion anomalies occur when the deletion of data representing one fact results in unintended loss of additional data. Normalization helps alleviate these issues by organizing the database into tables in a way that reduces these problems, ensuring that each piece of data is stored only once and dependencies between tables are managed more efficiently .

You might also like