0% found this document useful (0 votes)
35 views

Assignment2_Group4

The document outlines multiple business scenarios requiring the creation of Crow's Foot Entity-Relationship Diagrams (ERDs) for various companies and institutions, including Two-Bit Drilling Company, Tiny Hospital, Granite Sales Company, Tiny College, FlyRight Aircraft Maintenance, and Martial Arts R Us. Each scenario specifies unique data modeling requirements, such as employee information, patient records, class attendance, manuscript submissions, and device registrations. The document emphasizes the need for specialization hierarchies and time-variant data tracking in the ERD designs.

Uploaded by

Mai Anh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views

Assignment2_Group4

The document outlines multiple business scenarios requiring the creation of Crow's Foot Entity-Relationship Diagrams (ERDs) for various companies and institutions, including Two-Bit Drilling Company, Tiny Hospital, Granite Sales Company, Tiny College, FlyRight Aircraft Maintenance, and Martial Arts R Us. Each scenario specifies unique data modeling requirements, such as employee information, patient records, class attendance, manuscript submissions, and device registrations. The document emphasizes the need for specialization hierarchies and time-variant data tracking in the ERD designs.

Uploaded by

Mai Anh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 17

GROUP 4

ASSIGNMENT 2/CHAPTER 5: ADVANCED DATA MODELING

1. 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 the 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.

2. Given the following business scenario, create a Crow’s Foot ERD using a specialization
hierarchy if appropriate. Tiny Hospital keeps information on patients and hospital rooms. The
system assigns each patient a patient ID number. In addition, the patient’s name and date of
birth are recorded. Some patients are resident patients who spend at least one night in the
hospital, and others are outpatients who are treated and released. Resident patients are
assigned to a room. Each room is identified by a room number. The system also stores the
room type (private or semi private) and room fee. Over time, each room will have many
patients. Each resident patient will stay in only one room. Every room must have had a
patient, and every resident patient must have a room.
3. 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.
4. In Chapter 4, you saw the creation of the Tiny College database design, which reflected
such business rules as “a professor may advise many students” and “a professor may chair
one department.” Modify the design shown in Figure 4.35 to include these business rules:
• An employee could be staff, a professor, or an administrator.
• A professor may also be an administrator.
• Staff employees have a work-level classification, such as Level I or Level II.
• Only professors can chair a department. A department is chaired by only one professor.
• Only professors can serve as the dean of a college. Each of the university’s colleges is
served by one dean.
• A professor can teach many classes.
• Administrators have a position title.
Given that information, create the complete ERD that contains all primary keys, foreign keys,
and main attributes.
5. Tiny College wants to keep track of the history of all its administrative appointments,
including dates of appointment and dates of termination. (Hint: Time-variant data is at work.)
The Tiny College chancellor may want to know how many deans worked in the College of
Business between January 1, 1960, and January 1, 2022, or who the dean of the College of
Education was in 1990. Given that information, create the complete ERD that contains all
primary keys, foreign keys, and main attributes.
6. Some Tiny College staff employees are information technology (IT) personnel. Some IT
personnel provide technology support for academic programs, some provide technology
infrastructure support, and some provide support for both. IT personnel are not professors;
they are required to take periodic training to retain their technical expertise. Tiny College
tracks all IT personnel training by date, type, and results (completed versus not completed).
Given that information, create the complete ERD that contains all primary keys, foreign keys,
and main attributes.
Minimal Tiny College IT Staffing Solution:
Expanded Tiny College IT Staffing Solution:

7. The FlyRight Aircraft Maintenance (FRAM) division of the FlyRight Company (FRC)
performs all maintenance for FRC’s aircraft. Produce a data model segment that reflects the
following business rules:
• All mechanics are FRC employees. Not all employees are mechanics.
• Some mechanics are specialized in engine (EN) maintenance. Others are specialized in
airframe (AF) maintenance or avionics (AV) maintenance. (Avionics are the electronic
components of an aircraft that are used in communication and navigation.) All mechanics
take periodic refresher courses to stay current in their areas of expertise. FRC tracks all
courses taken by each mechanic—date, course type, certification (Y/N), and performance.
• FRC keeps an employment history of all mechanics. The history includes the date hired,
date promoted, and date terminated.
Given those requirements, create the Crow’s Foot ERD segment.

8. “Martial Arts R Us” (MARU) needs a database. MARU is a martial arts school with
hundreds of students. The database must keep track of all the classes that are offered, who is
assigned to teach each class, and which students attend each class. Also, it is important to
track the progress of each student as they advance. Create a complete Crow’s Foot ERD for
these requirements:
• Students are given a student number when they join the school. The number is stored along
with their name, date of birth, and the date they joined the school.
• All instructors are also students, but clearly not all students are instructors. In addition to the
normal student information, for all instructors, the date that they start working as an instructor
must be recorded along with their instructor status (compensated or volunteer).
• An instructor may be assigned to teach any number of classes, but each class has one and
only one assigned instructor. Some instructors, especially volunteer instructors, may not be
assigned to any class.
• A class is offered for a specific level at a specific time, day of the week, and location. For
example, one class taught on Mondays at 5:00 p.m. in Room 1 is an intermediate-level class.
Another class taught on Mondays at 6:00 p.m. in Room 1 is a beginner-level class. A third
class taught on Tuesdays at 5:00 p.m. in Room 2 is an advanced-level class.
• Students may attend any class of the appropriate level during each week, so there is no
expectation that any particular student will attend any particular class session. Therefore, the
attendance of students at each individual class meeting must be tracked.
• A student will attend many different class meetings, and each class meeting is normally
attended by many students. Some class meetings may not be attended by any students. New
students may not have attended any class meetings yet.
• At any given meeting of a class, instructors other than the assigned instructor may show up
to help. Therefore, a given class meeting may have a head instructor and many assistant
instructors, but it will always have at least one instructor who is assigned to that class. For
each class meeting, the date of the class and the instructors’ roles (head instructor or assistant
instructor) need to be recorded. For example, Mr. Jones is assigned to teach the Monday, 5:00
p.m., intermediate class in Room 1. During a particular meeting of that class, Mr. Jones was
the head instructor and Ms. Chen served as an assistant instructor.
• Each student holds a rank in the martial arts. The rank name, belt color, and rank
requirements are stored. Most ranks have numerous rank requirements, but each requirement
is associated with only one particular rank. All ranks except white belt have at least one
requirement.
• A given rank may be held by many students. While it is customary to think of a student as
having a single rank, it is necessary to track each student’s progress through the ranks.
Therefore, every rank that a student attains is kept in the system. New students joining the
school are automatically given the rank of white belt. The date that a student is awarded each
rank should be kept in the system. All ranks have at least one student who has achieved that
rank at some time.

STUDENT table: (STUDENT_ID, STUDENT_LNAME, STUDENT_FNAME, DOB,


DATE_JOIN, IS_INSRUCTOR (Y/N))
INSTRUCTOR table: (STUDENT_ID, DATE_HIRE, STATUS)
CLASS table: (CLASS_ID, STUDENT_ID, CLASS_LEVEL, TIME, CLASS_DAY,
LOCATION)
ATTENDANCE table: (MEETING_ID, STUDENT_ID, ATTEND_ROLE)
MEETING table: (MEETING_ID, CLASS_ID, MEETING_DATE)
RANK table: (RANK_NUM, RANK_NAME, BELT_COLOR)
REQUIREMENT table:(REQUIREMENT_ID, REQUIREMENT_DESCRIPTION,
RANK_NUM)
ATTAIN table: (STUDENT_ID, RANK_NUM)
9. The Journal of E-commerce Research Knowledge is a prestigious information systems
research journal. It uses a peer-review process to select manuscripts for publication. Only
about 10 percent of the manuscripts submitted to the journal are accepted for publication. A
new issue of the journal is published each quarter. Create a complete ERD to support the
business needs described below.
• Unsolicited manuscripts are submitted by authors. When a manuscript is received, the editor
assigns it a number and records some basic information about it in the system, including the
title of the manuscript, the date it was received, and a manuscript status of “received.”
Information about the author(s) is also recorded, including each author’s name, mailing
address, email address, and affiliation (the author’s school or company). Every manuscript
must have an author. Only authors who have submitted manuscripts are kept in the system. It
is typical for a manuscript to have several authors. A single author may have submitted many
different manuscripts to the journal. Additionally, when a manuscript has multiple authors, it
is important to record the order in which the authors are listed in the manuscript credits.
• At his or her earliest convenience, the editor will briefly review the topic of the manuscript
to ensure that its contents fall within the scope of the journal. If the content is not appropriate
for the journal, the manuscript’s status is changed to “rejected,” and the author is notified via
email. If the content is within the scope of the journal, then the editor selects three or more
reviewers to review the manuscript. Reviewers work for other companies or universities and
read manuscripts to ensure their scientific validity. For each reviewer, the system records a
reviewer number, name, email address, affiliation, and areas of interest. Areas of interest are
predefined areas of expertise that the reviewer has specified. An area of interest is identified
by an IS code and includes a description (e.g., IS2003 is the code for “database modeling”).
A reviewer can have many areas of interest, and an area of interest can be associated with
many reviewers. All reviewers must specify at least one area of interest. It is unusual, but
possible, to have an area of interest for which the journal has no reviewers. The editor will
change the status of the manuscript to “under review” and record which reviewers received
the manuscript and the date it was sent to each reviewer. A reviewer will typically receive
several manuscripts to review each year, although new reviewers may not have received any
manuscripts yet.
• The reviewers will read the manuscript at their earliest convenience and provide feedback to
the editor. The feedback from each reviewer includes rating the manuscript on a 10-point
scale for appropriateness, clarity, methodology, and contribution to the field, as well as a
recommendation for publication (accept or reject). The editor will record all of this
information in the system for each review received, along with the date the feedback was
received. After all of the reviewers have provided their evaluations, the editor will decide
whether to publish the manuscript and change its status to “accepted” or “rejected.” If the
manuscript will be published, the date of acceptance is recorded.
• After a manuscript has been accepted for publication, it must be scheduled. For each issue
of the journal, the publication period (fall, winter, spring, or summer), publication year,
volume, and number are recorded. An issue will contain many manuscripts, although the
issue may be created in the system before it is known which manuscripts will be published in
that issue. An accepted manuscript appears in only one issue of the journal. Each manuscript
goes through a typesetting process that formats the content, including fonts, font size, line
spacing, justification, and so on. After the manuscript has been typeset, its number of pages is
recorded in the system. The editor will then decide which issue each accepted manuscript will
appear in and the order of manuscripts within each issue. The order and the beginning page
number for each manuscript must be stored in the system. After the manuscript has been
scheduled for an issue, the status of the manuscript is changed to “scheduled.” After an issue
is published, the print date for the issue is recorded, and the status of each manuscript in that
issue is changed to “published.”
10. Global Unified Technology Sales (GUTS) is moving toward a “bring your own device”
(BYOD) model for employee computing. Employees can use traditional desktop computers
in their offices. They can also use a variety of personal mobile computing devices such as
tablets, smartphones, and laptops. The new computing model introduces some security risks
that GUTS is attempting to address. The company wants to ensure that any devices
connecting to their servers are properly registered and approved by the Information
Technology department. Create a complete ERD to support the following business needs:
• Every employee works for a department that has a department code, name, mailbox number,
and phone number. The smallest department currently has 5 employees, and the largest
department has 40 employees. This system will only track in which department an employee
is currently employed. Very rarely, a new department can be created within the company. At
such times, the department may exist temporarily without any employees. For every
employee, an employee number and name (first, last, and middle initial) are recorded in the
system. It is also necessary to keep each employee’s title.
• An employee can have many devices registered in the system. Each device is assigned an
identification number when it is registered. Most employees have at least one device, but
newly hired employees might not have any devices registered initially. For each device, the
brand and model need to be recorded. Only devices that are registered to an employee will be
in the system. While unlikely, it is possible that a device could transfer from one employee to
another. However, if that happens, only the employee who currently owns the device is
tracked in the system. When a device is registered in the system, the date of that registration
needs to be recorded.
• Devices can be either desktop systems that reside in a company office or mobile devices.
Desktop devices are typically provided by the company and are intended to be a permanent
part of the company network. As such, each desktop device is assigned a static IP address,
and the MAC address for the computer hardware is kept in the system. A desktop device is
kept in a static location (building name and office number). This location should also be kept
in the system so that, if the device becomes compromised, the IT department can dispatch
someone to remediate the problem.
• For mobile devices, it is important to also capture the device’s serial number, which
operating system (OS) it is using, and the version of the OS. The IT department is also
verifying that each mobile device has a screen lock enabled and has encryption enabled for
data. The system should support storing information on whether or not each mobile device
has these capabilities enabled.
• After a device is registered in the system, and the appropriate capabilities are enabled if it is
a mobile device, the device may be approved for connections to one or more servers. Not all
devices meet the requirements to be approved at first, so the device might be in the system for
a period of time before it is approved to connect to any server. GUTS has a number of
servers, and a device must be approved for each server individually. Therefore, it is possible
for a single device to be approved for several servers but not for all servers.
• Each server has a name, brand, and IP address. Within the IT department’s facilities are a
number of climate-controlled server rooms where the physical servers can be located. Which
room each server is in should also be recorded. Further, it is necessary to track which
operating system is being used on each server. Some servers are virtual servers and some are
physical servers. If a server is a virtual server, then the system should track which physical
server it is running on. A single physical server can host many virtual servers, but each virtual
server is hosted on only one physical server. Only physical servers can host a virtual server.
In other words, one virtual server cannot host another virtual server. Not all physical servers
host a virtual server.
• A server will normally have many devices that are approved to access the server, but it is
possible for new servers to be created that do not yet have any approved devices. When a
device is approved for connection to a server, the date of that approval should be recorded. It
is also possible for a device that was approved for a server to lose its approval. If that
happens, the date that the approval was removed should be recorded. If a device loses its
approval, it may regain that approval at a later date if whatever circumstance that led to the
removal is resolved.
• A server can provide many user services, such as email, chat, homework managers, and
others. Each service on a server has a unique identification number and name. The date that
GUTS began offering that service should be recorded. Each service runs on only one server
although new servers might not offer any services initially. Client-side services are not
tracked in this system, so every service must be associated with a server.
• Employees must get permission to access a service before they can use it. Most employees
have permissions to use a wide array of services, but new employees might not have
permission on any service. Each service can support multiple approved employees as users,
but new services might not have any approved users at first. The date on which the employee
is approved to use a service is tracked by the system. The first time an employee is approved
to access a service, the employee must create a username and password. This will be the same
username and password that the employee will use for every service for which the employee
is eventually approved

11.
Use GCS

-- Tạo bảng Nhân viên (Employee)


CREATE TABLE Employee (
EmployeeID INT PRIMARY KEY IDENTITY(1,1),
FirstName VARCHAR(50) NOT NULL,
LastName VARCHAR(50) NOT NULL,
MiddleInitial CHAR(1),
Region VARCHAR(10) NOT NULL,
DateOfHire DATE NOT NULL,
Title VARCHAR(50) NOT NULL
);

-- Tạo bảng Khách hàng (Customer)


CREATE TABLE Customer (
CustomerID INT PRIMARY KEY IDENTITY(1,1),
CustomerName VARCHAR(100) NOT NULL,
PhoneNumber VARCHAR(20) NOT NULL,
Region VARCHAR(10) NOT NULL
);

-- Tạo bảng Dự án (Project)


CREATE TABLE Project (
ProjectID INT PRIMARY KEY IDENTITY(1,1),
CustomerID INT,
ProjectName VARCHAR(100) NOT NULL,
ContractDate DATE NOT NULL,
StartDate DATE,
EndDate DATE,
Budget DECIMAL(15,2),
ActualCost DECIMAL(15,2),
ManagerID INT,
FOREIGN KEY (CustomerID) REFERENCES Customer(CustomerID),
FOREIGN KEY (ManagerID) REFERENCES Employee(EmployeeID)
);

-- Tạo bảng Nhiệm vụ trong dự án (ProjectSchedule)


CREATE TABLE ProjectSchedule (
ScheduleID INT PRIMARY KEY IDENTITY(1,1),
ProjectID INT,
TaskName VARCHAR(100) NOT NULL,
StartDate DATE NOT NULL,
EndDate DATE NOT NULL,
SkillRequired VARCHAR(50) NOT NULL,
EmployeesRequired INT NOT NULL,
FOREIGN KEY (ProjectID) REFERENCES Project(ProjectID)
);
-- Tạo bảng Phân công công việc (Assignment)
CREATE TABLE Assignment (
AssignmentID INT PRIMARY KEY IDENTITY(1,1),
EmployeeID INT,
ScheduleID INT,
StartDate DATE NOT NULL,
EndDate DATE,
FOREIGN KEY (EmployeeID) REFERENCES Employee(EmployeeID),
FOREIGN KEY (ScheduleID) REFERENCES ProjectSchedule(ScheduleID)
);

-- Tạo bảng Nhật ký công việc (Work_Log)


CREATE TABLE Work_Log (
LogID INT PRIMARY KEY IDENTITY(1,1),
EmployeeID INT,
AssignmentID INT,
WorkDate DATE NOT NULL,
HoursWorked INT NOT NULL,
BillID INT,
FOREIGN KEY (EmployeeID) REFERENCES Employee(EmployeeID),
FOREIGN KEY (AssignmentID) REFERENCES Assignment(AssignmentID)
);

-- Tạo bảng Hóa đơn (Bill)


CREATE TABLE Bill (
BillID INT PRIMARY KEY IDENTITY(1,1),
ProjectID INT,
IssueDate DATE NOT NULL,
TotalAmount DECIMAL(15,2) NOT NULL,
FOREIGN KEY (ProjectID) REFERENCES Project(ProjectID)
);

-- Chèn dữ liệu mẫu


INSERT INTO Employee (FirstName, LastName, MiddleInitial, Region, DateOfHire, Title)
VALUES
('John', 'Doe', 'A', 'NW', '2020-01-15', 'Project Manager'),
('Jane', 'Smith', 'B', 'SW', '2019-06-23', 'Systems Analyst II');

INSERT INTO Customer (CustomerName, PhoneNumber, Region) VALUES


('Tech Solutions', '123-456-7890', 'NW'),
('Global Corp', '987-654-3210', 'SW');
INSERT INTO Project (CustomerID, ProjectName, ContractDate, StartDate, EndDate,
Budget, ActualCost, ManagerID) VALUES
(1, 'Enterprise System', '2023-01-01', '2023-02-01', '2023-08-01', 50000, NULL, 1);

-- Truy vấn danh sách nhân viên


SELECT * FROM Employee;

-- Truy vấn các dự án theo khách hàng


SELECT p.ProjectName, c.CustomerName FROM Project p
JOIN Customer c ON p.CustomerID = c.CustomerID;

-- Truy vấn tổng số giờ làm việc theo nhân viên


SELECT e.FirstName, e.LastName, SUM(w.HoursWorked) AS TotalHours FROM
Work_Log w
JOIN Employee e ON w.EmployeeID = e.EmployeeID
GROUP BY e.FirstName, e.LastName;

-- Tạo chỉ mục để tối ưu truy vấn


CREATE INDEX idx_project_customer ON Project(CustomerID);
CREATE INDEX idx_worklog_employee ON Work_Log(EmployeeID);

You might also like