In: Computer Science
The owner of Horne Design Wallcoverings has hired you as a consultant to design a database management system for his chain of three stores that sell wallpaper and accessories. He would like to track sales, customers and employees. After initial meeting with him, you have developed a list of business rules and specifications to begin the design of an E-R Model. The list of business rules are:
Questions / Requirement:
You are required to design a database solution for the above case study by coming out with the following parts:
Entity - Entity is anything like place, person etc. which has attributes to describe them.
Entity and attributes for given scenario:
ER diagram using crow foot notation
Here primary keys are underlined for each entity.
Tables for given ER
/* Create a table called customer */
CREATE TABLE customer(cust_Id integer PRIMARY KEY, cust_name
char(10),phone int);
/* Create a table called order */
CREATE TABLE order(ord_Id integer PRIMARY KEY,ord_date date,
quantity int);
/* Create a table called employee */
CREATE TABLE employee(emp_Id integer PRIMARY KEY, emp_name
char(10),skill char(20));
/* Create a table called homeDesign */
CREATE TABLE homeDesign(H_location char(20) );
/* Create a table called account */
CREATE TABLE account(a_Id integer PRIMARY KEY, a_type
char(10),balance decimal, last_pay_date date);
/* Create a table called item */
CREATE TABLE item(item_id integer PRIMARY KEY, item_type
char(10),price decimal, description char(50));