Uploaded by VISHAV BHARTI

IN2213-G6 S22 Assignment2-1 ANUPREET 202004752

advertisement
Program + Semester
ISBA II
Course Name
Database Systems Management
Section Code
IN2213-G6
Summer 2022
Type of Evaluation
Assignment # 2-1
Percentage Weight of Total
Evaluation
7%
Course Instructor
Muhammad Waqar
Aslam
Due Date
Week 7 (June 26, 2022)
Total Marks:
/7
Student Name: _ANUPREET_ Student ID #: _202004752_
Note: Please use proper referencing (where necessary) when submitting your report. Report without
references shall not be acceptable. If you do not have software for drawing ERD, you can draw on paper
by hand and take picture and include that in your report. Do not forget to write your name and id on the
paper on which you hand draw ERD.
Question No. 1 (Marks 3)
Given the following business scenario, create a Crow’s Foot ERD using a specialization hierarchy
if appropriate. Two-Bit Drilling Company keeps information on employees and their insurance
dependents. Each employee has an employee number, name, date of hire, and title. If an
employee is an inspector, then the date of certification and certification renewal date should
also be recorded in the system. For all employees, the Social Security number and dependent
names should be kept. All dependents must be associated with one and only one employee.
Some employees will not have dependents, while others will have many dependents. Please
give reasoning for any selection that you make. Providing only ERD is not enough.
ANSWER No. 1:- The corporation is in charge of keeping track of all employee information,
including insurance dependents. Employees may have one or more dependents, but only one
employee should be linked to all dependents. Each piece of information about an employee is
contained in its own table, and information about their dependents is contained in their
insurance dependent table. For some inspectors, extra information such as certification and
renewal dates are supplied.Attributes in the EMPLOYEE table include EMP_NO, EMO_NAME,
EMP_DATEHIRED, EMP_TITLE, EMP_TYPE, and EMP_SSN. The INSURANCE_DEPENDENT table
contains
dependent
EMP_NO,
DEPENDENT_NAME,
DEPENDENT_DOB,
and
DEPENDENT_RELATIONSHIP values (relationship of dependent and employee). One EMPLOYEE
may have 0 or more DEPENDENTS, but each DEPENDENT is tied to just one EMPLOYEE in the
relationship. EMP_TYPE is the subtype discriminator that indicates the presence of an
INSPECTOR.
Page 1 of 5
Question No. 2 (Marks 4)
Given the following business scenario, create a Crow’s Foot ERD using a specialization hierarchy
if appropriate. Granite Sales Company keeps information on employees and the departments in
which they work. For each department, the department name, internal mailbox number, and
office phone extension are kept. A department can have many assigned employees, and each
employee is assigned to only one department. Employees can be salaried, hourly, or work on
contract. All employees are assigned an employee number, which is kept along with the
employee’s name and address. For hourly employees, hourly wages and target weekly work
hours are stored; for example, the company may target 40 hours/week for some employees, 32
for others, and 20 for others. Some salaried employees are salespeople who can earn a
commission in addition to their base salary. For all salaried employees, the yearly salary amount
is recorded in the system. For salespeople, their commission percentage on sales and
commission percentage on profit are stored in the system. For example, John is a salesperson
with a base salary of $50,000 per year plus a 2 percent commission on the sales price for all
sales he makes, plus another 5 percent of the profit on each of those sales. For contract
employees, the beginning date and end date of their contracts are stored along with the billing
rate for their hours. Please give reasoning for any selection that you make. Providing only ERD
is not enough.
ANSWER No.2:- Entities are represented by boxes in this notation, whereas relationships are
represented by lines. At the end of the line, several forms are used to represent the cardinality
of the relationship.
Page 2 of 5
Cardinality: This term refers to the uniqueness of the data value included in a specific table
column. When the cardinality is low, the column will include more duplicate elements.
1. Cardinality (0,N) represents zero or many relationships.
2. Cardinality (1,N) represents one or many relationships.
3. Cardinality (1,1) represents one and only one relationship.
4. Cardinality (0,1) represents zero and one relationship.
The following database tables will be utilized to produce ERD: DEPARTMENT (DEPT NUM, DEPT
NAME, DEPT MAILBOX, DEPT EXTENSION) EMPLOYEE (EMP NUM, EMP LNAME, EMP FNAME,
EMP CITY, EMP STATE, EMP ZIP, EMP TYPE, DEPT NUM) A department can have several
employees, but only one employee can work in that department. As a result, EMPLOYEE and
DEPARTMENT have a many to one relationship (M:1).
Furthermore, personnel might be classified as :1. Salaried employees.
2. Hourly employees.
3. Contract employees.
As a result, database tables are employed to keep track of all changes to these three sorts of
personnel. These are the tables:
HOURLY(Emp Num, Hourly Wage, Hourly HourTarget)
SALARIED(Emp Num, Salaried Amount, Salaried IsSales)
CONTRACT (EMP NUM, Con BegDate, Co EndDate, Con Rate)A salaried employee can be a
salesperson who earns commission on top of their base wage, hence a second table called
SALESPERSON must be created.
BELOW is the ERD Model:-
Page 3 of 5
REFERENCES:1. By. (2020, July 3). Integrity constraints in DBMS. W3schools. Retrieved June 10, 2022,
from https://www.w3schools.blog/integrity-constraints-dbms.
2. Primary key and foreign key. GeeksforGeeks. (2020, March 28). Retrieved June 10, 2022,
from https://www.geeksforgeeks.org/difference-between-primary-key-and-foreign-key/
Page 4 of 5
Page 5 of 5
Download