The entity relationship is modelled based on the following assumptions.
create table client (
clientID integer primary key,
firstName varchar(50) not null,
lastname varchar(50) not null,
contact varchar(25) not null
create table staff (
staffID integer primary key,
firstName varchar(50) not null,
lastname varchar(50) not null,
address varchar(100) not null
create table nonregular_appointment (
appointmentID integer primary key,
appointmentDate date not null,
appointmentTime varchar(15) not null,
cost decimal(8,2)
create table service (
serviceID integer primary key,
name varchar(50) not null,
serviceType varchar(25) not null
create table booking(
bookingID integer primary key,
clientID integer not null,
cost decimal(8,2) not null,
dateBooked date not null,
timeBooked varchar(15) not null,
foreign key (clientID) references client (clientID)
create table time_based (
serviceID integer primary key,
chargeBasis decimal not null,
foreign key (serviceID) references service (serviceID);
create table item_based (
serviceID integer primary key,
rate decimal not null,
foreign key (serviceID) references service (serviceID)
create table staff_services (
staffID integer not null,
serviceID integer not null,
rate decimal not null,
primary key (serviceID,staffID),
foreign key (serviceID) references time_based (serviceID),
foreign key (staffID) references staff (staffID)
create table booked_services (
bookingID integer not null,
serviceID integer not null,
staffID integer not null,
primary key (serviceID,bookingID),
foreign key (serviceID) references service (serviceID),
foreign key (staffID) references staff (staffID),
foreign key (bookingID) references booking (bookingID)
create table appointment_services (
appointmentID integer not null,
serviceID integer not null,
staffID integer not null,
primary key (serviceID,appointmentID),
foreign key (serviceID) references service (serviceID),
foreign key (staffID) references staff (staffID),
foreign key (appointmentID) references nonregular_appointment (appointmentID)
insert into client (clientID, firstName, lastName, contact) values (‘1′,’Lebron’,’James’,’+3342343123′);
insert into client (clientID, firstName, lastName, contact) values (‘2′,’Kevin’,’Durant’,’+3342343123′);
insert into client (clientID, firstName, lastName, contact) values (‘3′,’Steph’,’Curry’,’+3342343123′);
insert into staff (staffID, firstName, lastName, address) values (‘1′,’Jon’,’Snow’,’winterfell’);
insert into staff (staffID, firstName, lastName, address) values (‘2′,’Arya’,’Stark’,’winterfell’);
insert into staff (staffID, firstName, lastName, address) values (‘3′,’Cersei’,’Lannister’,’kings landing’);
insert into nonregular_appointment (appointmentID, appointmentDate, appointmentTime) values (‘1′,’2018-12-12′,’10:00AM’);
insert into nonregular_appointment (appointmentID, appointmentDate, appointmentTime) values (‘2′,’2018-12-12′,’11:00AM’);
insert into nonregular_appointment (appointmentID, appointmentDate, appointmentTime) values (‘3′,’2018-12-12′,’12:00PM’);
insert into service (serviceID,name, serviceType) values (1,’massage’,’time-based’);
insert into service (serviceID,name, serviceType) values (2,’waxing’,’time-based’);
insert into service (serviceID,name, serviceType) values (3,’Nails’,’item-based’);
insert into booking (bookingID, clientID, cost, dateBooked, timeBooked) values (1,1,233,’2018-12-12′,’9:00AM’);
insert into booking (bookingID, clientID, cost, dateBooked, timeBooked) values (2,2,433,’2018-12-12′,’10:00AM’);
insert into booking (bookingID, clientID, cost, dateBooked, timeBooked) values (3,3,321,’2018-12-12′,’11:00AM’);
insert into time_based (serviceID, chargeBasis) values (1,1);
insert into time_based (serviceID, chargeBasis) values (2,0.5);
insert into item_based(serviceID, rate) values (1,12);
insert into staff_services (staffID, serviceID, rate) values (1,1,12);
insert into staff_services (staffID, serviceID, rate) values (2,2,32);
insert into staff_services (staffID, serviceID, rate) values (1,2,21);
insert into booked_services(bookingID, serviceID, staffID) values (1,1,1);
insert into booked_services(bookingID, serviceID, staffID) values (2,2,2);
insert into booked_services(bookingID, serviceID, staffID) values (1,2,3);
insert into appointment_services(appointmentID, serviceID, staffID) values (1,1,1);
insert into appointment_services(appointmentID, serviceID, staffID) values (2,2,2);
insert into appointment_services(appointmentID, serviceID, staffID) values (1,2,3);
Essay Writing Service Features
Our Experience
No matter how complex your assignment is, we can find the right professional for your specific task. Contact Essay is an essay writing company that hires only the smartest minds to help you with your projects. Our expertise allows us to provide students with high-quality academic writing, editing & proofreading services.Free Features
Free revision policy
$10Free bibliography & reference
$8Free title page
$8Free formatting
$8How Our Essay Writing Service Works
First, you will need to complete an order form. It's not difficult but, in case there is anything you find not to be clear, you may always call us so that we can guide you through it. On the order form, you will need to include some basic information concerning your order: subject, topic, number of pages, etc. We also encourage our clients to upload any relevant information or sources that will help.
Complete the order formOnce we have all the information and instructions that we need, we select the most suitable writer for your assignment. While everything seems to be clear, the writer, who has complete knowledge of the subject, may need clarification from you. It is at that point that you would receive a call or email from us.
Writer’s assignmentAs soon as the writer has finished, it will be delivered both to the website and to your email address so that you will not miss it. If your deadline is close at hand, we will place a call to you to make sure that you receive the paper on time.
Completing the order and download