10.07.2015 Views

Chapter 4 Entity Relationship Modeling

Chapter 4 Entity Relationship Modeling

Chapter 4 Entity Relationship Modeling

SHOW MORE
SHOW LESS
  • No tags were found...

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

DatabaseSystems"Concern for manhimself and his fatemust always form thechief interest ofall technicalendeavor. Neverforget this in themidst of yourdiagrams andequations."- Albert Einstein (1879 - 1955)TopicsE-R Diagraming<strong>Chapter</strong> 4<strong>Entity</strong> <strong>Relationship</strong><strong>Modeling</strong><strong>Entity</strong> <strong>Relationship</strong> <strong>Modeling</strong>E-R ModelGraphical ModelVisual representationTypes of ModelsConceptual (Logical) ModelInternal ModelExternal ModelPhysical ModelLogical Database DesignIdentify important entitiesRelate entities to objectivesStandardize names and formatsIdentify Sources of dataDefine attributesIdentify ownership of dataLogical Database DesignIdentify <strong>Relationship</strong>sbetween entitiesNormalize entity relationshipsReduce redundancyand anomaliesInternal Database DesignImplement Database SystemPhysical Database DesignLet the RDBMS do itMap logical designto computer devicesIterative DesignBack and ForthDesign, test, re-designRequirementsEntities and Attributes<strong>Relationship</strong>sNormalizeImplement


PrototypesFirst VersionPlan to throw awaySample data, small sizeTest Major Features, User I/FThe ProcessFrom the problem DescriptionStep 1: Identify Important EntitiesStep 2: Define AttributesStep 3: Identify <strong>Relationship</strong>sIn-classClassify the following relationships1. person to driver's license2. person to social security number3. student to classes taken4. employee to dependents5. employee to spouse6. customer to purchase order7. person to hospital recordE-R Model ComponentsERA Models<strong>Entity</strong><strong>Relationship</strong>AttributeMeta EditMetaedit.exeER DetailsCardinalityLimit the number of occurrencesPROFESSOR(1,1)Connectivitiesteaches(1,4)CLASSER DetailsExistence DependencyDoes the Foreign Key Exist?Mandatory / Optional1,N 0,NCardinalitiesER DetailsWeak EntitiesEmployee to DependentEMPLOYEEPK EMP_NUMEMP_LNAMEEMP_FNAMEEMP_INITIALEMP_DOBEMP_HIREDATEDEPENDENThasPK,FK1 EMP_NUMPK DEP_NUM(1,1) (0,N)DEP_FNAMEDEP_DOBER DetailsRecursivePre-req CoursesMangersmanagesCOURSErequiresis prerequisite toDeveloping an E-R ModelA good work through ofDeveloping an E-R ModelPages 124 - 130Course to ClassEMPLOYEECOURSEPK CRS_CODECRS_TITLECRS_DESCRIPTIONCRS_CREDITSgeneratesPKCLASSCLASS_CODEFK1 CRS_CODECLASS_SECTIONCLASS_TIMECLASS_PLACECOURSE


Converting E-R to DBEntities become tablesAttributes become fields<strong>Relationship</strong>s become linksIn-ClassWork In Small GroupsPage 137Problem 3 - Department StoreProblem 4 - Temporary EmploymentProblem 3 - Department StoreUse the following business rules to write all appropriateconnectivities in the E-R diagram:a. A department employs many employees, but eachemployee is employed by one department.b. Some employees, known as "rovers," are not assignedto any department.c. A division operates many departments, but eachdepartment is operated by one divisiond. An employee may be assigned to many projects, and aproject may have many employees assigned to it.e. A project must have at least one employee.f. One of the employees manages each department, andeach department is managed by only one employee.g. One of the employees runs each division, and eachdivision is run by one employee.Problem 4 - Temporary EmploymentTemporary Employment Corporation (TEC) placestemporary workers in companies during peak periods.TEC's manager gives you the following description:- TEC has a file of candidates who are willing to work.- If the candidate has worked before, that candidate hasa specific job history.- Each candidate has several qualifications. Eachqualification may be earned by more than onecandidate.- TEC also has a list of companies that requesttemporaries.- Each time a company requests a temp, TEC makes anentry in the openings folder which contains an openingnumber, company name, required qualifications,starting date, anticipated ending date, and hourly pay.- Each opening requires only one specific or mainqualification.- When a candidate matches the qualification, (s)he isgiven the job, and an entry is made in the PlacementRecord folder. This folder contains an opening number,candidate number, total hours worked, and so on. Inaddition, an entry is made in the job history for thecandidate.- TEC uses special codes to describe a candidate'squalifications for an opening. Example:PRG-C++ Programmer, C++TEC wants to keep track of the following entities:COMPANY, OPENING, QUALIFICATION, CANDIDATEJOB_HISTORY, PLACEMENTDraw an accurate, complete ER diagram.Homework: 1 of 2Problem 6, Page 138 (Automata, Inc)Design ER ModelCreate and print using MetaEdit2 copiesDo the best you canNothing Handwritten!Homework: 2 of 2Find a better ER diagram toolNOT A DRAWING PROGRAM!Email program name and locationOnly One Chance - get it rightNo Changing LaterIssues... Limitations, Legal, etc...Each Team will Submit 2 programs2 members download, test & submit2 different members presentNext ClassExam!More E-R work, then examCovers <strong>Chapter</strong>s 1,2,3,4Classes 1-4Exam Format: Multiple Choice, WrittenAfter Exam: Group WorkEnd of Lesson

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!