Database Design - Section 4 - Overview | Oracle...

48
Database Design - Section 4 Instructor Guide

Transcript of Database Design - Section 4 - Overview | Oracle...

Page 1: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Database Design - Section 4 Instructor Guide

Page 2: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,
Page 3: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page i

Table of Contents

Database Design - Section 4 ............................................................................................................................1 Lesson 1 - Video Store ..................................................................................................................................1 What Will I Learn? ........................................................................................................................................2 Why Learn It?................................................................................................................................................3 Tell Me / Show Me........................................................................................................................................4 Try It / Solve It ..............................................................................................................................................8 Lesson 2 - Global Fast Foods (Progressive Project) .....................................................................................14 What Will I Learn? ........................................................................................................................................15 Why Learn It?................................................................................................................................................16 Tell Me / Show Me........................................................................................................................................17 Try It / Solve It ..............................................................................................................................................18 Lesson 3 - Supertypes and Subtypes..............................................................................................................20 What Will I Learn? ........................................................................................................................................21 Why Learn It?................................................................................................................................................22 Tell Me / Show Me........................................................................................................................................23 Try It / Solve It ..............................................................................................................................................27 Lesson 4 - Documenting Business Rules.......................................................................................................31 What Will I Learn? ........................................................................................................................................32 Why Learn It?................................................................................................................................................33 Tell Me / Show Me........................................................................................................................................34 Try It / Solve It ..............................................................................................................................................38 Lesson 5 - Review and Quiz 2.......................................................................................................................40 What Will I Learn? ........................................................................................................................................41 Why Learn It?................................................................................................................................................42 Tell Me / Show Me........................................................................................................................................43 Try It / Solve It ..............................................................................................................................................44

Page 4: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,
Page 5: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 1

Lesson 1 - Video Store

Lesson 1 - Video Store

Lesson Preparation

No further lesson preparation information for this lesson. What to Watch For

Watch out for confusion between entities that should be attributes and attributes that are really entities. Make sure that relationship lines are drawn correctly.

Connections Go back to DJ ERD, check naming conventions, and have students tell you something about the “DJs on Demand” business using the ERD.

Page 6: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 2

What Will I Learn?

What Will I Learn?

Page 7: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 3

Why Learn It?

Why Learn It?

Why Learn It?

Ask students: Why is the road sign for STOP the same color and shape throughout the country? Answer: It makes it easy to recognize wherever you are and everyone understands what it means. In this lesson, we will create an ERD for a video store and learn how to label and name relationships according to established conventions.

Page 8: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 4

Tell Me / Show Me

Tell Me / Show Me

Tell Me / Show Me

The DJ Example Model Students have previously read the business scenario for the DJ business, but we will focus on certain aspects of it for this lesson. The ERD shown here does not exactly match the final model (subtypes are not shown, M:M is not resolved). Point this out and explain that they will eventually match by the end of the course. We are going through the steps to get to the final result. Discuss the ERD shown in the light of naming conventions/rules for entities, attributes, and relationships. Go through each entity and point out that it is represented by a softbox, and the name is in all caps and is singular. Point out each attribute, which are mandatory (marked with “*”), which are optional (marked with “o”), and which are part of the unique identifier (marked with “#*”). Examine the relationships, and read a couple using the dashed/solid lines to indicate optionality and the crow’s feet/single toe to indicate cardinality.

Page 9: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 5

Tell Me / Show Me

Tell Me / Show Me

Tell Me / Show Me

The DJ Example Model Students have previously read the business scenario for the DJ business, but we will focus on certain aspects of it for this lesson. The ERD shown here does not exactly match the final model (subtypes are not shown, M:M is not resolved). Point this out and explain that they will eventually match by the end of the course. We are going through the steps to get to the final result. Discuss the ERD shown in the light of naming conventions/rules for entities, attributes, and relationships. Go through each entity and point out that it is represented by a softbox, and the name is in all caps and is singular. Point out each attribute, which are mandatory (marked with “*”), which are optional (marked with “o”), and which are part of the unique identifier (marked with “#*”). Examine the relationships, and read a couple using the dashed/solid lines to indicate optionality and the crow’s feet/single toe to indicate cardinality.

Page 10: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 6

Tell Me / Show Me

Tell Me / Show Me

Tell Me / Show Me

A reserved word is one that has a specific meaning and function in the computer system, language, or database. For example, NULL is a reserved word in the Oracle database. So are DATE and DISTINCT. To avoid confusion, it is good to avoid these words. Instead of naming an attribute “date,” make it more descriptive, as in “birth date,” “date of sale,” “transaction date,” etc.

Page 11: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 7

Tell Me / Show Me

Tell Me / Show Me

Page 12: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 8

Try It / Solve It

Try It / Solve It

Try It / Solve It

Go over the whole scenario with the class before they work on the activity. Read the text and play the animations, pausing and replaying if necessary. At this point, students have been creating simple ERDs given business scenarios, but they haven’t really formally stated the business rules that determine the relationships. We will learn more about the different kinds of business rules in a later lesson. For now, review the given scenario with the class and have them identify the business rules. Write the business rules on the board: Each movie must have an ID, title, and category (e.g. comedy, suspense, drama, action, war, or sci-fi). There can be multiple copies of a movie. Each copy takes up one (video) tape. Each video tape has a tape number and a format (VHS or Beta). There can be only one movie on a single tape. We track name, birth name, and birthday of all star actors that appear in each movie. We don’t keep information on star actors that are not in any of our movies.

Page 13: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 9

A movie may not have a star actor. Only members can rent videos. Members are assigned a membership number, and we also track name, phone number, and address. A member can rent one or more videos.

Page 14: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 10

Try It / Solve It

Try It / Solve It

Try It / Solve It

Review the scenario and the graphic with the class and have them identify the business rules.

Page 15: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 11

Try It / Solve It

Try It / Solve It

Try It / Solve It

Review the scenario and the animation with the class and have them identify the business rules.

Page 16: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 12

Try It / Solve It

Try It / Solve It

Try It / Solve It

Review the scenario and the animation with the class and have them identify the business rules. Then have them work in pairs to construct the ERD.

Page 17: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 13

Page 18: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 14

Lesson 2 - Global Fast Foods (Progressive Project)

Lesson 2 - Global Fast Foods (Progressive Project)

Lesson Preparation

In this lesson, we have each student pair present their solution to the class. This is an informal presentation, but it will give them a “taste” of what it’s like to speak in front of a group and answer questions about their work. This will also give the teacher an idea of the relative presentation strengths and weaknesses of each student. This is useful to remember when we get to the Presentation Skills-related lessons, and it also will help the teacher advise each group when they get ready for their more-structured presentations.

What to Watch For Someone may want to model CUSTOMER. This is a valid concern. At this point, however, the business scenario hasn’t really given them anything to track about CUSTOMER. If it comes up, tell them that it will become clear as the scenario unfolds. Remind them that in the real world of consulting, your client may not give you all the relevant information right away and may actually change things along the way! They will see this happen during the course.

Connections Compare the Global Fast Foods model to other restaurants you’ve visited (fast food and otherwise). Would the data model be the same? Would some things be different?

Page 19: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 15

What Will I Learn?

What Will I Learn?

What Will I Learn?

"Defend" means to be able to answer questions about your data model, particularly questions that ask “why.” Why is the relationship optional/mandatory? Why is it “one or more” vs. “one and only one.” Why is the attribute mandatory/optional? Why did you pick that attribute or combination of attributes as the unique identifer instead of something else? “Defending” your data model successfully requires that you understand the business, can represent it in an entity relationship diagram, and can explain it to someone else.

Page 20: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 16

Why Learn It?

Why Learn It?

Page 21: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 17

Tell Me / Show Me

Tell Me / Show Me

Tell Me / Show Me

Show the animation and have the class read the interview notes with the owner of Global Fast Foods. Have the class identify at least one entity (ORDER, FOOD ITEM, or STAFF). If they identify more than one, just pick one and draw the entity on the board. They will complete the ERD in the Try It/Solve It activity.

Page 22: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 18

Try It / Solve It

Try It / Solve It

Try It / Solve It

Read additional interview notes and further develop the ERD. Explain that they will have to present their solutions to the class. If someone asks, chicken mole is a Mexican dish made with chicken in a savory chocolate sauce. Sopapilla is a Mexican dessert that consists of fried sweet dough filled with honey, sometimes sprinkled with cinnamon sugar or powdered sugar. Give them 20 minutes to work on the activity, and use the remaining 10 minutes for presentations.

Page 23: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 19

They are not expected to have the whole data model yet, but they should at least come up with ORDER, STAFF, and FOOD ITEM. The solution shows an M:M relationship between FOOD ITEM and ORDER. Point it out and tell them it will be resolved later. Remind them that age is a volatile attribute -- it is better to model date of birth. Check that they have correct optionality for the attributes and that relationships are drawn correctly. Have them read the ERDish out loud to check for accuracy. Global Fast Foods is a progressive project that is built throughout the course. The completed ERD is available under Lesson Materials on the Lesson Overview page.

Page 24: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 20

Lesson 3 - Supertypes and Subtypes

Lesson 3 - Supertypes and Subtypes

Lesson Preparation

No further lesson preparation information for this lesson. What to Watch For

Nothing to watch for in this lesson. Connections

Review the complete ERD for the DJ business. Point out the subtypes for EMPLOYEE.

Page 25: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 21

What Will I Learn?

What Will I Learn?

Page 26: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 22

Why Learn It?

Why Learn It?

Page 27: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 23

Tell Me / Show Me

Tell Me / Show Me

Page 28: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 24

Tell Me / Show Me

Tell Me / Show Me

Tell Me / Show Me

Read the diagram as: Every QUIZ, MIDTERM, or FINAL is an EXAM (and thus has attributes such as description, weight, grade, and date). Conversely: Every EXAM is either a QUIZ, a MIDTERM, or a FINAL.

Page 29: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 25

Tell Me / Show Me

Tell Me / Show Me

Tell Me / Show Me

When teaching supertypes and subtypes, you can use three questions to see if the subtype is correctly identified: (1) Is this subtype a kind of supertype? (2) Have I covered all possible cases? (exhaustive) (3) Does the example fit into one and only one subtype? (mutually exclusive) To illustrate: Ask if it’s possible, according to the DJ model, for an EMPLOYEE to be both a DJ and an event planner for the same event (answer: no).

Page 30: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 26

Tell Me / Show Me

Tell Me / Show Me

Page 31: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 27

Try It / Solve It

Try It / Solve It

Try It / Solve It

This is meant to bring the students up to date on what has been modeled for the Global Fast Foods ERD so far. It will also help students who did not arrive at an accurate solution for the previous activity on Global Fast Foods.

Page 32: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 28

Try It / Solve It

Try It / Solve It

Try It / Solve It

Page 33: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 29

Assessment:

Page 34: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 30

Try It / Solve It

Try It / Solve It

Try It / Solve It

Assessment: The subtypes for AUTOMOBILE are not mutually exclusive. A 4-DOOR VEHICLE could also be a SEDAN and/or a SPORT UTILITY VEHICLE. Suggestion for improvement: remove 4-door vehicle subtype. Consider making “number of doors” an attribute of the supertype. Add other nonoverlapping subtypes or an “OTHER” subtype. The subtypes of BUILDING are not exhaustive. Surely there are other BUILDINGs that are not a HOUSE. Add more subtypes or add an OTHER subtype. Some possible subtypes of building are CHURCH, SCHOOL, CASTLE. Ask students to name other examples of BUILDINGs that could be subtypes.

Page 35: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 31

Lesson 4 - Documenting Business Rules

Lesson 4 - Documenting Business Rules

Lesson Preparation

None. What to Watch For

Students must recognize whether a business rule can be implemented by the data model or must be implemented by programming. Give examples: Business rule: Only an employee with a title of manager can manage other employees (this can be represented by the DJ data model). Business rule: The event planner must contact the customer before the DJ can be assigned to the event. Although the ERD shows that both types of employees can be assigned to an event for a customer, this particular rule will need extra code to enforce in the database.

Connections Why are business rules changed or modified? For example, rules are changed as society changes, or the business leaders feel the change will benefit the business. Laws can be imposed that require business rules to change. Has your school changed any business rules since you've been a student?

Page 36: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 32

What Will I Learn?

What Will I Learn?

Page 37: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 33

Why Learn It?

Why Learn It?

Why Learn It?

“Implemented by programming” means that once the database is created, a programmer would write code that would enforce a business rule.

Page 38: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 34

Tell Me / Show Me

Tell Me / Show Me

Tell Me / Show Me

Discussion: What kinds of rules does your employer have that affect you?

• Each shift I work must be documented on a time clock punch card. • Each shift must be supervised by a manager.

Our school has many business rules: • Is it reasonable/effective for a class not to have a teacher assigned? • Is it reasonable/effective for two students to have the same student id number or no

student id number at all? • Is it reasonable to schedule a teacher to teach a class if no students are enrolled? • Is it reasonable to allow students to come to school if they are not enrolled in any (one or

more) classes?

Page 39: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 35

Tell Me / Show Me

Tell Me / Show Me

Tell Me / Show Me

Ask students the question: What procedural business rule is evident from the animation? Answer: The project manager first works with the client to confirm the event. Then he assigns an event manager and a DJ to the event. Discussion: How do you represent this in the ER diagram? Can you? Answer: No, this is a rule that will have to be implemented by a computer program. Visualize a system where the partners can look up events and update them. The program could allow only the project manager to enter a new event and then assign the partners who will be working on it. Once the assignment is made, the system could send out an email notification to the event manager and the DJ, giving them details about the event, the customer contact information, etc. Discuss a real-world example of a procedural rule: Students must have studied algebra and geometry in order to sign up for trigonometry. Could you represent this in the ERD? Answer: No. How would you implement this with programming? Answer: When a student tries to sign up online for the trigonometry class, a piece of code would “check” to see if that student had taken algebra and geometry.

Page 40: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 36

If the student had taken the subjects, can you think of an additional business rule that a school may want in this scenario? Answer: Student achieved a passing grade.

Page 41: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 37

Tell Me / Show Me

Tell Me / Show Me

Tell Me / Show Me

Discussion: Why would you document this? Why would you document anything? Answers include: What if you leave the project? What if you don’t implement the database? The person who does implement the database will discover that the perfect database may not address all the needs of the business because of situations like this!

Page 42: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 38

Try It / Solve It

Try It / Solve It

Try It / Solve It

Structural Rules: A patient is someone who is admitted to the hospital. Each room assignment must include the building number and room number. Each room may be occupied by one or more patients. A physician must have a valid license number. Each drug must be prescribed by a physician. Each drug prescribed must have a label showing label number, dosage, treatment duration, and expiration date. The drug code, name, and cost must be recorded for all drugs. Each prescription must have a number and date. Each physician may be assigned to more than one patient. Each patient must have an assigned physician. Procedural Rules: Changes to prescriptions can be made only by licensed physicians. Patients cannot refill prescriptions without a physician's signature.

Page 43: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 39

Physicians cannot remove drug labels. Patients cannot change hospital rooms without a physician's recommendation. Nurses cannot reassign patients without physician approval. Programming Rules: Drugs costs are billed at current cost at the time of patient discharge. Physician fees may reflect additional costs associated with patient complications, additional patient requests, etc.

Page 44: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 40

Lesson 5 - Review and Quiz 2

Lesson 5 - Review and Quiz 2

Lesson Preparation

Review lesson content for fifteen minutes before you administer the quiz. This is a good time to answer questions, clarify recently learned concepts and terminology, and go over some of the practice solutions from previous lessons.

What to Watch For None.

Connections None.

Page 45: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 41

What Will I Learn?

What Will I Learn?

Page 46: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 42

Why Learn It?

Why Learn It?

Page 47: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 43

Tell Me / Show Me

Tell Me / Show Me

Page 48: Database Design - Section 4 - Overview | Oracle Academyacademy.oracle.com/.../Database_Design_-_Section_4_Instructor_Gui… · Database Design - Section 4 ... (subtypes are not shown,

Copyright © Oracle, 2004. All rights reserved.

Database Design - Section 4 Page 44

Try It / Solve It

Try It / Solve It

Try It / Solve It

Assessment: You may want to encourage students to retake the quiz until they achieve a passing score. Or you may prefer to allow only one attempt at the quiz. Have students work in small groups to review what they missed on the quiz. Based on what types of questions they missed, have students write out the rules (e.g., rules for subtypes). Have a member from each group present a summary back to the class about what areas their group can improve.