To manage the employees and their activity, a small company has a Human Resources (HR) section and they need a database that will keep track of
employee and client data
If an employee has a carpark assigned
Assets each employee has access to (e.g., they may be assigned a computer to use, or a company car, etc.).
Projects that are created for a client
Clients can have many projects)
Employees can work on multiple projects
A timesheet records the work each employee does for which project
To make it clear how the entities are related we create some "Relationship Rules"
Each employee can be assigned a carpark. If a carpark is assigned it can only be assigned to one employee.
An employee can be assigned 0, 1 or many assets. An asset can be assigned to 0 or 1 employee.
A client can have 0,1 or many projects, but a project can only be assigned to 1 client
An employee can be assigned to 0,1 or many projects, and a project can be assigned to 1 or many employees. (The interaction is recorded in a a timesheet).
An Entity is something to keep simple facts ABOUT.
An Entity can be:
A Concrete (physical) thing (e.g., customer, vehicle).
An abstract thing.
An event (e.g., meeting, account, withdrawal, accident, assessment).
A long term association (e.g., enrolment, project).
Something else
When you read a scenario try to identify the entities (I have highlighted them in red). In this case Employee, Client, Timesheet, Asset, Carpark.
For each entity there will be associated attributes (fields). This is the Data you want to collect for each instance.
Employee (LastName, FirstName, Address, Address(TownCity), Mobile Phone),
(see this entity with instances of employees (sample data) following)
Client (LastName, FirstName, Address, Address(TownCity), Mobile Phone),
Entities with links to other entities
CarPark (Employee assigned to, Location)
Asset (Employee that the asset is assigned to, Description, Purchase Date, Value)
Project (Client the Project is for, Description, Start Date, Value)
Timesheet (Employee and Project the Timesheet is for, Date, Start Time, End Time, Description)
This is the Structure of the data. If we created a spreadsheet to show the actual data for Employees it could look like this.
Each line in the table related to a specific employee is known as a record (in an Object Oriented database this is called an instance). For example,
Bloggs, Joe, Mr, 12 Tui St, Hastings, 021 123-456
Create sample data for the other entities