0% found this document useful (0 votes)
44 views

Domain Key Normal Form: Key: Employee - ID Constraints

The document defines the domain key normal form for 9 tables related to an employee, sales, orders, products, suppliers, and receivables database. Each table is described with its primary key, foreign key constraints, and domain formats for attribute data types. The tables track information about employees, sales they generate, products ordered and received, suppliers that provide products, and receivables from suppliers.

Uploaded by

ryanbalkaran
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
44 views

Domain Key Normal Form: Key: Employee - ID Constraints

The document defines the domain key normal form for 9 tables related to an employee, sales, orders, products, suppliers, and receivables database. Each table is described with its primary key, foreign key constraints, and domain formats for attribute data types. The tables track information about employees, sales they generate, products ordered and received, suppliers that provide products, and receivables from suppliers.

Uploaded by

ryanbalkaran
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 9

Domain Key Normal Form

1) Table:Employee(Employee_ID, Employee_FirstName, Employee_LastName, Password)


Key: Employee_ID
Constraints:

An EMPLOYEE can have zero, one or many SALES, SALES results from the
EMPLOYEES.

EMPLOYEES make many ORDERS and record many RECEIVABLES.

Employee_ID does not begin with digit zero (0)

Domain Description:

Employee_ID: Integer (8) - AIIIIIIII where A is an integer value not equal to


zero (0) and I is an integer.

Employee_FirstName: VARCHAR (25)

Employee_LastName: VARCHAR (25)

Password: VARCHAR (9)

2) Table: SALE (Sale_ID, Employee_ID, Sale_Date, Product_Qty)


Key: Sale_ID
Constraints:

Sale must have Employee_ID

Employee_ID must be a foreign key

Domain Description:

Sale_ID: INTEGER (7) BIIIIIII where B is and integer value not equal to zero (0)
and I is an integer.

Employee_ID: Integer (8) - AIIIIIIII where A is an integer value not equal to zero
(0) and I is an integer.

Sale_Date : DATE

Product_Qty: INTEGER(7)

3) Table: SALE_PRODUCT(Sale_ID, Product_ID,Product_Quantity)


Key: Sale_ID, Product_ID
Constraints:

SALE_PRODUCT must contain both foreign keys Sale_ID and Product_ID which forms
a composite primary key.

Domain Description:

Sale_ID: INTEGER (7) BIIIIIII where B is and integer value not equal to zero (0) and I is
an integer.

Product_ID: INTEGER (7) CIIIIIII where C is an integer value not equal to zero (0) and
is an integer.

Product_Quantity: INTEGER(7)

4) Table: Order_ Product(Order_ID, Product_ID, Product_Quantity)


Key: Order_ID, Product_ID
Constraints:

ORDER_PRODUCT must contain both Order_ID and Product_Quantity which form a


composite primary key.

Domain Description:

Order_ID: INTEGER (7) DIIIIIII where D is an Integer value not equal to zero (0) and I
is an integer.

Product_ID: INTGER (7) EIIIIIII where E is an Integer value not equal to zero (0) and I
is an integer.

Product_Quantity: INTEGER (7)

5) Table: Product (Product_ID, Supplier_ID, Product_Purchase_Price,


Product_Selling_Price, Product_Description, Reorder_level , Stock_Level)
Key: Product_ID
Constraints:

Product must record an Order_Product, Sale_Product and a Receivables_Product.

Domain Description:

Product_ID: INTGER (7) EIIIIIII where E is an Integer value not equal to zero (0) and I
is an integer.

Supplier_ID: INTGER (7) FIIIIIII where F is an Integer value not equal to zero (0) and I
is an integer.

Product_Purchase_Price: Decimal

Product_Selling_Price: Decimal

Product_Description: VARCHAR(50)

Reorder_level: INTEGER(4)

Stock_Level: INTEGER(6)

6) Table: SUPPLIER(Supplier_ID, Supplier_Name, Supplier_Contact, Supplier_Address)


Key: Supplier_ID
Constraints:

Supplier must be recorded in an ORDER in order to generate RECEIVABLES and


restock PRODUCT

Domain Description:

Supplier_ID: INTEGER (7) FIIIIIII where F is an Integer value not equal to zero (0) and
I is an integer.

Supplier_Name: VARCHAR (25)

Supplier_Contact: VARCHAR (11)

Supplier_Address: VARCHAR (50)

7) Table: Order(Order_ID, Supplier_ID, Employee_ID, Order_Date)


Key: Order_ID
Constraints:

Order must include both Supplier_ID and Employee_ID

Domain Description:

Order_ID: INTEGER (7) GIIIIIII where G is an Integer value not equal to zero (0) and I
is an integer.

Supplier_ID: Supplier_ID: INTEGER (7) FIIIIIII where F is an Integer value not equal to
zero (0) and I is an integer.

Employee_ID: Employee_ID: Integer (8) - AIIIIIIII where A is an integer value not equal
to zero (0) and I is an integer.

Order_Date: DATE

8) Table: RECEIAVLABLES_PRODUCT(Receivable_ID, Product_ID, Product_Quantity )


Key: Receivable_ID, Product_ID
Constraints:

RECEIVABLES_PRODUCT must contain both Receivable_ID and Product_ID which


form a composite primary key.

Domain Description:

Receivable_ID: INTGER (7) HIIIIIII where H is an Integer value not equal to zero (0)
and I is an integer.

Product_ID: INTGER (7) EIIIIIII where E is an Integer value not equal to zero (0) and I
is an integer.

Product_Quantity: INTEGER (7)

9) Table: Receivables (Receivables_ID, Employee_ID, Supplier_ID, Date _Received)


Key: Receivables_ID
Constraints:

Receivables must contain both Employee_ID and Supplier_ID

Domain Description:

Receivables_ID: INTEGER (7) JIIIIIII where J is an Integer value not equal to zero (0)
and I is an integer.

Employee_ID: Employee_ID: Integer (8) - AIIIIIIII where A is an integer value not equal
to zero (0) and I is an integer.

Supplier_ID: Supplier_ID: Supplier_ID: INTEGER (7) FIIIIIII where F is an Integer


value not equal to zero (0) and I is an integer.

Date _Received: DATE

You might also like