Tugas Database Oracle
Tugas Database Oracle
1. The UID of a library book includes its BOOK number and SHELF number. Does this ERD follow the
rules of Second Normal Form? If you spot a violation, correct it.
Sugession: 2NF on shelf. [Assume that a book won’t have multiple author, even if it has we only track
major one so, 1NF is not violated their, problem specifically targets 2NF here.]
2. . Class Enrollment is the intersection entity that resolves the M:M between STUDENT and CLASS.
Does the ERD follow the rules of Second Normal Form? If you spot a violation, correct it.
Suggestion:
3. A store can be located in several shopping malls, and a shopping mall may house several stores.
To locate a particular store in a specific neighborhood, you will need to know the name and address of
the nearby shopping mall, plus the name of the store. Does the ERD follow the rules of Second
Normal Form? If you spot a violation, correct it.
Answer:
To locate a store, name and address of mall + store name is needed, then why location is present in
store listing entity. Ok, let’s be realistic here, inside mall, where is store? In shop no 100. This is what
here location means. I say no harm in storing a location value. Some may argue why location is not in
store entity, what if this store has another branch in another mall and it is located in shop no 200
there?
Now we come to store specialty, this may be the reason why I have this problem here. Store
franchises follow exactly same recipes’ and if there is a specialty, then it’s of the whole chain. Since
specialty is of store not only the one located in specific mall, I want to move it to Store Entity. 2NF
wants specialty to be dependent on Store UID.
Nama : Muhammad Ramzi Marasabessy
Section 6-4
1. Identify the transitive dependency in the model below. State which attributes violate Third Normal
Form.
Store address being dependent on store name, is a transitive dependency and violates 3NF.
3. A color scheme for a car includes specifications for paint color for the body and the interior colors
and materials. For example: The “Desert” color scheme includes silver paint and gray leather interior;
the “Sunburst” color scheme includes gold paint and cream leather interior. Does the model below
follow the rules of Third Normal Form? If you spot a violation, correct it.
Suggestion:
· Model I choose depend on manufacturer (make) – not all manufacturer make every
model.
· Color scheme available really depends on model I choose to buy.
· Paint color and interior color depends on color scheme I choose.
Assumptions:
1. A model must have at least one color scheme designed for it
2. A Color scheme must be created with at least one model in mind.
3. Once car is manufactured, I can’t change scheme and model of car.
4. Assume the following business rules:
• An athlete employs one agent.
• An agent may work for one or more athletes.
• An athlete may play for one team.
• A team may have one or more players
Does the model below contain one or more transitive dependencies? Identify the attributes involved in
the transitive dependencies.
5. Now that you have an idea of what makes a good UID, you need to be aware of the controversy,
benefits, and difficulty of uniquely identifying someone. Consider the idea of a national ID card. What
kinds of problems would the card create and what kinds of problems would it solve? If your country
already uses a national ID card, what are the benefits and issues associated with this? In your
opinion, could DNA mapping become the national ID card? Why or why not?
I am more satisfied with the concept of single identity of every person than afraid of.
Why satisfied:
· In all government transactions I just need to give SSN and done, say no paper work
while getting a new credit card.
· Say I update my name at one place, ideally it should get propagated everywhere ( in
reality it’s not so simple, since theoretically possible in future, so putting here under why satisfied)
Why afraid of:
· If someone has my SSN, he can even get a credit card that is another story that all credit
cards have fraud protections but still…
· It’s bad for me in a way that, only by knowing SSN they know how many payments of
credit card I missed ( I didn’t do it intentionally J )
DNA thing is a good idea but we are far way behind as of today. It won’t be an artificial UID like SSN
but costly to collect this data as of today.
Section 7-1
1. A show ticket is purchased from an agent, the box office, or the Internet. A ticket has a description,
an event, a date and a price. An agent has a name and a phone number. The box office has an
address and a phone number. The Internet has a URL address.
Draw the entities and represent the mutually exclusive relationship.
Assume that all type of sellers it for same price. One Ticket Instance must be booked by one and only
of (one Agent Instance, one box office instance or one website instance)
2. Draw the MENU entity as a supertype of the PROMOTIONAL, REGULAR, and OTHER entities.
The UID of MENU is code. MENU is related to FOOD ITEM through this relationship: each MENU
may contain one or more FOOD ITEMs, and each FOOD ITEM must be listed on one and only one
MENU. The UID of FOOD ITEM is a barred UID using its attribute “number”. Add appropriate
attributes to the other entities and be ready to defend your choices.
Section 7-2
1. Develop two ER diagrams to represent the following situation. Develop one using a
hierarchical structure and one using a recursive structure.
“Our company sells products throughout the United States. So we’ve divided the U.S. into
four major sales regions: the Northern, Eastern, Southern, and Western regions. Each sales
region has a unique region code. Each sales region is then divided into sales districts. For
example, the Western region is divided into the Rocky Mountain, Northwest, Pacific Coast,
and Pacific districts. Each district has a unique district code. Each district is made up of sales
territories. The Rocky Mountain district is composed of three territories: Wyoming-Montana,
Colorado, and Utah-New Mexico. The North-west district is made up of two territories: the
Washington and Oregon-Idaho territories. The Pacific Coast district is composed of two
territories: the California and Nevada territories. The Pacific District includes the Hawaii
territory and the Alaska territory. Each territory has a unique territory code.
Then each sales territory is broken down into sales areas. For example, Colorado is made up
of two sales areas: the Front Range and the Western Slope sales areas. Each sales area has a
unique sales-area code.
Each salesperson is responsible for one or more sales areas and has a specific sales quota. We
also have sales managers who are responsible for one or more sales districts and sales
directors who are responsible for one or more sales regions. Each sales manager is
responsible for the territories with his/her districts. We don’t overlap our employees’
responsibilities. Each sales area is always the responsibility of a single salesperson, and our
managers' and directors' responsibilities don’t overlap. Some-times our salespersons,
managers, and directors will have special assignments and will not be responsible for sales.
We identify all our sales personnel by their employee IDs.”
Hierarchical: Assume that every region must have at least one district and so on up to areas.
Recursive:
· To cover top and bottom entities in chain make optional on both end of pigs ear.
· Type attribute may take values e.g. area, territory, district region etc.
· To cover entities of type territory, relation b/w unit and employee on unit side becomes
optional. (Additional information to be recorded with this : Each sales manager is responsible for the
territories with his/her districts. But this does not mean I will store duplicate information with
territories)