Presentation is loading. Please wait.

Presentation is loading. Please wait.

Solutions to exercises from Lecture 4. ER Modeling I handout - Q1 DIVISION (DivisionID,…ManagerID) DEPARTMENT (DeptID,…DivisionID) EMPLOYEE (EmpID, …DeptID)

Similar presentations


Presentation on theme: "Solutions to exercises from Lecture 4. ER Modeling I handout - Q1 DIVISION (DivisionID,…ManagerID) DEPARTMENT (DeptID,…DivisionID) EMPLOYEE (EmpID, …DeptID)"— Presentation transcript:

1 Solutions to exercises from Lecture 4

2 ER Modeling I handout - Q1 DIVISION (DivisionID,…ManagerID) DEPARTMENT (DeptID,…DivisionID) EMPLOYEE (EmpID, …DeptID) PROJECT (ProjectID,…) EMPLOYEE_PROJECT (EmpID, ProjectID,…) not null null allowed

3 ER Modeling I - Q2 INSTRUCTOR (InstructorID, HighestDegree, …) COURSE (CourseID, ClassTitle, …) CLASS (ClassID, CourseID, InstructorID, Term…) TRAINEE (TraineeID, …) ENROLL (TraineeID, ClassID, Term…)* All foreign keys not null. * Optionally, create an EnrollmentID attribute to use as primary key.

4 ER Modeling I - Q3 CUSTOMER (CustomerID, …) INVOICE (InvoiceID, CustomerID, SalesRepID,…) LINE (InvoiceID, LineID, ProdID,…) PRODUCT (ProductID, …) SALESREP (SalesRepID, …) VENDOR (VendorID,…) SHIP (ShipID, ProductID, VendorID,…) All foreign keys not null

5 ER Modeling I - Q4 AGENT (AgentID, LName, Region…) CLIENT (ClientID, LName,…) MUSICIAN (MusicianID, AgentID, Name, DaysAvailable,…) EVENT (EventID, ClientID, MusicianID, Date, Time, Location…) INSTRUMENT (InsturmentID, …) MUSICIAN_INSTRUMENT (MusicianID, InstrumentID, YearsExperience…) All foreign keys not null.

6 ER Modeling I - Q5 CITY (CityID, …) TEAM (TeamID, CoachID, CityID, …) PLAYER (PlayerID, TeamID,…) COACH (CoachID, TeamID,…) GAME (GameID, HomeTeamID, VisitorTeamID,…) All foreign keys not null.

7 ER Modeling II - Q1 COMPANY (CompanyID, …) DEPARTMENT (DepartmentID, CompanyID…) EMPLOYEE (EmployeeID, DepartmentID, …) DEPENDENT (EmployeeID, DependentID, …) EMPLOYEE_HISTORY (EmployeeID, HistoryID, …) All foreign keys are not null

8 ER Modeling II - Q2 MEMBER (MemberID, …) WORKOUT (WorkoutID, MemberID, Date…) EXERCISE (ExerciseID…) WORKOUT_EXERCISE (WorkoutID, ExerciseID, NumberSets, NumberReps,…)

9 ER Modeling II - Q3 EMPLOYEE (EmployeeID, Name…PositionID) PART_TIME_EMPLOYEE (EmployeeID, HourlyRate…) FULL_TIME_EMPLOYEE (EmployeeID, Salary, OfficeRoom, …) POSITION (PositionID, Title, Job_Description…) All foreign keys not null.

10 ER Modeling II - Q4 USER (UserID, Name, Department,…) PROBLEM (ProblemID, TimeSpent, UserID, ResolverID,…) HARDWARE (ProblemID, Description, Solution…) SOFTWARE (ProblemID, SoftwareVersion, …) RESOLVER (ResolverID, Name, Phone, Level, …) All foreign keys not null.

11 ER Modeling II - Q5 EMPLOYEES (EmployeeID, SupervisorID, …) SKILLS (SkillID, SkillName, …) EMPLOYEE_SKILL (EmployeeID, SkillID, DateAcquired, Certification,…) PROJECTS (ProjectID, ProjectName, ManagerID, StartDate…) EMPLOYEE_PROJECT (EmployeeID, ProjectID, Role…) PROJECT_SKILL (ProjectID, SkillID, SkillLevelRequired, NumberStaff,…)* DEPENDENTS (EmployeeID, DependentID, DateOfBirth…) WORK_HISTORY(EmployeeID, HistoryID,…) BENEFITS (BenefitID, BenefitType, Company, Contact,…) EMPLOYEE_BENEFIT (EmployeeID, BenefitID,…) All foreign keys are not null. * Optionally, create a ProjectSkill_ID attribute to use as primary key.

12 ER Modeling II - Q6 ORCHARD (OrchardID, Location, …) SPECIES (SpeciesID, Name, OrchardID…) DISEASE (DiseaseID, Symptoms, Treatment,…) SPECIES_DISEASE (SpeciesDiseaseID, SpeciesID, DiseaseID, Date,…)* CUSTOMER (CustomerID, …) ORDER (OrderID, CustomerID, …) ORDERDETAILS (OrderID, DetailID, SpeciesID,…) All foreign keys not null. * Optionally, use the combination of SpeciesID, DiseaseID and Date as primary key and remove SpeciesDiseaseID entirely.


Download ppt "Solutions to exercises from Lecture 4. ER Modeling I handout - Q1 DIVISION (DivisionID,…ManagerID) DEPARTMENT (DeptID,…DivisionID) EMPLOYEE (EmpID, …DeptID)"

Similar presentations


Ads by Google