Using the REA diagram and attributes create Tables that incl

Using the REA diagram and attributes, create Tables that includes: Table Name, Table type, Primary Keys, Foreign Keys, Attributes, For Warehouse, Order, Inventory, Sale/Shipment, Salesperson, Customer, Cash, Cash Receipts, Cashier, and also tables for relationship lines.

All employees( Salesperson and Cashier) information is maintained in one table.

Solution

I am giving you the SQL query that can be used to create your tables :-

warehouse:-

CREATE TABLE Warehouse (WarehouseId int(50) primary key not null auto_increment, WarehouseName varchar(50), warehouseAreaNumber varchar(50));

Cash:-

CREATE TABLE Cash (Id int(50) primary key not null auto_increment, Amount varchar(50), depositeDate datetime);

Employee:-

CREATE TABLE Employee (EmployeeId int(50) primary key not null auto_increment, FirstName varchar(50), LastName varchar(50),DOBDate datetime,EmpoyeeSecurityCode varchar(100));

Cashier :-

CREATE TABLE Cashier (Id int(50) primary key not null auto_increment, FirstName varchar(50), LastName varchar(50), EmployeeId int(50), FOREIGN KEY (EmployeeId) REFERENCES Employee(EmployeeId));

Inventory:-

CREATE TABLE Inventory (Id int(50) primary key not null auto_increment, Name varchar(50), AvailableQuantity int(50),WarehouseId int(50),FOREIGN KEY (WarehouseId) REFERENCES Warehouse(WarehouseId));

Sale:-

CREATE TABLE Sale (SaleNumber int(50) primary key not null auto_increment, Name varchar(50), SaleDate datetime,actualSellingPrice int(100),Quantity int(50),InventoryId int(50),OrderId int(50),FOREIGN KEY (InventoryId) REFERENCES Inventory(Id), FOREIGN KEY (OrderId) REFERENCES Orderrr(OrderNumber));

Order:-

CREATE TABLE Order (OrderNumber int(50) primary key not null auto_increment, Name varchar(50), OrderDate datetime,OrderSellingPrice int(100),Quantity int(50),InventoryId int(50),FOREIGN KEY (InventoryId) REFERENCES Inventory(Id));

SalePerson:-

CREATE TABLE SalePerson (Id int(50) primary key not null auto_increment,SaleId int(50),OrderId int(50),FOREIGN KEY (SaleId) REFERENCES Sale(SaleNumber), FOREIGN KEY (OrderId) REFERENCES Order(OrderNumber));

Using the REA diagram and attributes, create Tables that includes: Table Name, Table type, Primary Keys, Foreign Keys, Attributes, For Warehouse, Order, Invento

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site