You are on page 1of 6

Database Management

Entities
An entity is described as an object in a database system that can be included in a model.
At the same time, this is an object that can contain information in a database system. Normally,
entities are recognizable as concepts like location, people, things or important events that an
organization would like to store information about (Pallaw, 2015). Therefore, in the case of A2Z
Salon Inc. the following entities will be important and their information will be stored in the
system:
Stores: entity store will contain information about the 10 different stores owned by A2Z
Salon Inc. the main attributes of the entity store will be the name of the store, location, store ID,
store size, and specialty of the store.
Services: this is an important activity in the company as it is one of the primary sources
of revenue. Therefore, management should be able to track all the services offered to the
customers. The main services offered by the company include hair styling, hair color, pedicure,
manicure, hair shampoo and other-related services. The entity will have such attributes as type of
service, beautician offering the service, cost of the service, service location, and nature of the
service.
Customer: the customer entity is a fundamental entity to the company. The entity
encompasses all the customers served by the company and this includes those who are members
and those who are not. Therefore, the main entities used in this case include gender, age,
location, address or contact, and occupation.
Products: the entity products takes into perspective all the products offered by A2Z
Salon Inc. therefore, it is within the table product that such products as shampoos, conditioners,
cosmetics, and fragrances. In essence, all the beauty products will be contained in a table named
product under the entity name product.
Employees: the entity employees contain such attributes as name, gender, age, role,
qualification, and income among other-related attributes. There will be a table named employee
and will contain data to all employees in the company. It is important to monitor the employees
in the company and ensure that they perform the roles assigned to them with high expertise.
Appointment: this is not an object rather it is a special event or occurrence that
management needs to monitor in regard to order processing. In this case, appointment connotes
the early bookings made by the customers to get the required services. The attributes to the entity
include the customer name, gender, location, date booked, cost of services, nature of service, and
beautician booked.
Membership: just like appointment, membership is not an object rather it is a special
occurrence that needs attention of management. Under membership, data belonging to registered
customers will be saved and monitored. Therefore, the major attributes to the entity membership
include customer name, age, location, gender, date, and membership fee among other-related
attributes.
Styles: beauty is all about styles and each style requires a different level of expertise and
costs. Therefore, in this case style entity will contain such attributes as name of style, expert
beautician, cost/price, and products required among other important attributes that can be
decided by management.
Payment: management has to track all the payments from all the 10 stores. Therefore,
the database system must contain a payment entity if this is to become possible. The major
attributes attached to this entity include mode of payment, location payment made, amount paid,
and person who made the payment.
Sales: this is an integral entity that cannot miss in an ordering system. The primary
operations of the company are to make as much sales as possible. Therefore, it should be able to
track all its sales through the supply chain. The main attributes in this case include the product,
service, and amount paid.
Purchases: A2Z Salon Inc. does not product its products; this means that it has to order
them from major suppliers or manufacturers from the region. In this retrospect, the company has
to make records of its purchases in a bid to track its costs. The main attributes include cost,
supplier, location, and product supplied.
Supplier: A2Z Salon Inc. must keep the records of all its suppliers for better tracking of
its costs and products. This is a good way of ensuring that whenever the products are depleted
orders can be made as soon as possible to replenish stocks. The main attributes include name of
supplier, product, cost, and location.
Association between Entities
Stores entity will be directly associated with such entities as product, supplier, and
employees. The relationship is built on the premise of products being stored in stores, suppliers
supplying the products to the different stores, and the stores operated by employees. The entity
customer will be associated with such entities as service, product, appointment, employee,
payment, and styles. Customers will be required to make orders based on the products they want
and the type of service that they would require, and they have to make payments for the orders.
In the event that the order is a service, the customers will either make an appointment or choose
the employee they would want to attend to them and choose the style they want to do. Therefore,
the association between the entities is based on the demand of the customers or the nature of the
order made by the customers. In order to show the associations between the entities an entity
relationship diagram (ERD) will be used in the next section of the paper. Through the ERD all
cardinalities will be established to show the connection between the various entities.
Business Rules
A customer can make, change, or cancel one or many appointments. However, he/she
cannot change or cancel an appointment when time to the deadline is one hour. Further, an
appointment is only made by one employee at a time. Therefore, one employee will be handling
one appointment at a time and only after the completion of such an appointment he/she will take
another. Moreover, the appointment is for a specified date and period of time and for a particular
type of service or style. This means that if a client mistakenly makes an error in the selection of
the service or style required, he/she will be prompted to make a new appointment. At the same
time, a client can only be given a specified type of treatment. However, membership of more
than two years can get alternative treatments. A customer cannot make an appointment without
making a down payment and thereafter making full payments. The system will only allow
payment of about 20% before appointments are made and later the client will be charged for the
services after they have been rendered.
SQL Server
The first step is to create the salon database;
CREATE DATABASE salon_database;
Creating Tables
USE salon_database;
Stores
CREATE TABLE Stores (
Store_ID INT NOT NULL AUTO_INCREMENT,
Store_name VARCHAR (40) NOT NULL,
PRIMARY KEY (Store_ID),
UNIQUE (Store_name)
);
INSERT INTO Stores
(Store_ID, Store_name)
VALUES
(“Uphill”),
(“Downturn”),
(“Taskier”),
(“Centralk”),
(“Monsoon”);
Services
CREATE TABLE Services (
Service_ID INT NOT NULL AUTO_INCREMENT,
Service_name VARCHAR (50) NOT NULL,
Service_cost INT NOT NULL,
PRIMARY KEY (Service_ID),
UNIQUE (Service_name)
);
INSERT INTO Services
(Service_ID, Service_name, Service_cost)
VALUES
(“Coloring”, 100),
(“Styling”, 150),
(“Pedicure”, 140),
(“Manicure”, 160),
(“Shampoo”, 110);
Customers
CREATE TABLE Customers (
Customer_ID INT NOT NULL AUTO_INCREMENT,
Customer_name VARCHAR (50) NOT NULL,
Customer_age INT NOT NULL,
PRIMARY KEY (Customer_ID),
UNIQUE (Customer_name)
);
INSERT INTO Customers
(Customer_ID, Customer_name, Customer_age)
VALUES
(“Joyce”, 34),
(“Mary”, 55),
(“James”, 34),
(“Margaret”, 23),
(“Jane”, 56);
Products
CREATE TABLE Products (
Service_ID INT NOT NULL AUTO_INCREMENT,
Service_name VARCHAR (50) NOT NULL,
PRIMARY KEY (Service_ID),
UNIQUE (Service_name)
);
INSERT INTO Services
(Service_ID, Service_name)
VALUES
(“Coloring”),
(“Styling”),
(“Pedicure”),
(“Manicure”),
(“Shampoo”);
References

Pallaw, V. (2015). Database management systems (4th ed.). Darya Ganj, New Delhi: Asian
Books Private Ltd.

You might also like