DB Ca3
DB Ca3
Class Assignment 03
Wali Ur Rehman
SP23-BDS-054
Umer Javed
SP23 BDS-052
Problem no 1 – Course Training
Answer:
Trainee:
1. Social Security Number (SSN) (Primary Key)
2. Surname
3. Age
4. Gender
5. Place of Birth
6. Employer’s Name (if applicable)
7. Employer’s Address (if applicable)
8. Employer’s Telephone Number (if applicable)
9. Courses Taken
10. Final Assessment for Each Course
11. Current Seminars
12. Employment Type (Employee or Self-Employed)
13. For Employees:
Previous Employers
Periods Employed
Level
Position
Area of Expertise
Title (if applicable)
Instructor:
1. Instructor ID (Primary Key)
2. Surname
3. Age
4. Place of Birth
5. Phone Number
6. Employment Type (Full-Time or Freelancer)
7. Courses Qualified to Teach
8. Previous Courses Taught
9. For Full-Time Instructors:
Fixed Pay
Allowances
Course:
1. Course Code (Primary Key)
2. Title
Course Edition:
1. Edition ID (Primary Key)
2. Start Date
3. End Date
4. Number of Participants
5. Course Code (Foreign Key)
6. Duration Type (Short or Long)
Seminar:
1. Seminar ID (Primary Key)
2. Location
3. Date
4. Time
5. Course Edition ID (Foreign Key)
Relationships:
1. Trainee-Course Edition (Many-to-Many)
Each Trainee can take multiple Course Editions.
Each Course Edition can have multiple Trainees.
Store Final Assessment for each course taken by a Trainee.
3. Trainee-Seminar (Many-to-Many)
Each Trainee can attend multiple Seminars.
Each Seminar can have multiple Trainees.
4. Instructor-Course (Many-to-Many)
Each Instructor can be qualified to teach multiple Courses.
Each Course can have multiple qualified Instructors.
Problem no 2 - Cafeteria
Answer:
Entities and Attributes:
Menu:
• Attributes: MenuID, Name, Price
MenuOffering:
• Attributes: Date, QuantitySold
MenuComponent:
• Attributes: ComponentID, Name, Type (Main Course or Side Dish)
Recipe Ingredient:
• Attributes: IngredientID, Name, CaloriesPer100g
ComponentIngredient:
• Attributes: ComponentID, IngredientID, QuantityInGrams
Relationships:
• A Menu can be offered on multiple days (MenuOffering).
• A Menu consists of one Main Course and multiple Side Dishes (MenuComponent).
• A MenuComponent can have multiple Ingredients
Problem no 3 – Cricket Website Database
Answer:
Venue:
- VenueID
- Name
- Location
Event:
- EventID
- MatchID (Foreign Key)
- EventType
- Timestamp
- Description
Relationships:
- Players form Teams
- Teams have Coaches
- Teams participate in Tournaments
- Tournaments comprise Matches
- Matches are adjudicated by Referees
- Matches are played at Venues
- Players participate in Matches
- Matches have chronological Events
Problem no 4 – Finance Company
Answer:
Customer:
Attributes: CustomerID, Name, Address, Type (Individual, Employee, Institution)
Institution:
Attributes: InstitutionID, FocalPerson, OtherDetails
Employee:
Attributes: EmployeeID, JobType (Permanent, Contractual), JobExperience (for Permanent),
ContractDuration, StartDate, EndDate
InvestmentScheme:
Attributes: SchemeID, SchemeType (Shares, Debentures, Fixed Deposits)
FixedDeposit:
Attributes: DepositID, Term (1, 2, or 3 years), PaymentScheme (On Maturity, Periodic),
InterestRate, InterestPaymentFrequency (Quarterly, Semi-Annually, Annually)
Debenture:
Attributes: DebentureID, Term (1, 2, or 3 years), Type (Convertible, Nonconvertible)
Share:
Attributes: ShareID, Type (Equity, Preferred), DividendRate
Transaction:
Attributes: TransactionID, Date, Amount, CustomerID, SchemeID
Relationships:
- Customers invest in different investment schemes (InvestmentScheme).
- Fixed deposits can be renewed on maturity.
- Debentures and shares are issued periodically.
- Employees deal with depositors.