0% found this document useful (0 votes)
2 views3 pages

Assignment no 1 CS406

Uploaded by

faizanali107f
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
0% found this document useful (0 votes)
2 views3 pages

Assignment no 1 CS406

Uploaded by

faizanali107f
Copyright
© © All Rights Reserved
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 3

Assignment no 1 CS406

BC210414671

Solution:

1. Identify Key Entities:

Key entities for style maker are:


1. Product
2. Category
3. Customer
4. Order
5. Employee
6. Supplier
7. Inventory

2. Specify Attributes for Each Entity:

Here are the attributes for each entity categorized by type.

1. Product:

 ProductID (Primary Key, simple, Single-Valued)


 ProductName (simple, Single-Valued)
 Brand (simple, Single-Valued)
 CategoryID (Foreign Key, simple, Single-Valued)
 Price (simple, Single-Valued)
 Size (multi-valued - multiple sizes may be available for each product)
 StockQuantity (Derived from Inventory entity, Single-Valued).

2. Category:

 CategoryID (Primary Key, simple, Single-Valued)


 CategoryName (simple, Single-Valued)

3. Customer:

 CustomerID (Primary Key, simple, Single-Valued)


 FirstName (simple, Single-Valued)
 LastName (simple, Single-Valued)
 Email (simple, Single-Valued)
 Phone (Composite, Country Code, Area Code, Number, Single-Valued)
 Address (Composite, Street, City, State, Zip, Single-Valued)

4. Order:

 OrderID (Primary Key, simple Single-Valued)


 OrderDate (simple, Single-Valued)
 TotalAmount (derived - calculated based on product prices and quantities)

5. Employee:

 EmployeeID (Primary Key, simple)


 Name (composite - first name, last name)
 Position (simple), Salary (simple)
 ContactNumber (simple)

6. Supplier:

 SupplierID (Primary Key, simple)


 Name (simple)
 Contact (simple)
 Address (composite - street, city, zip code)

7. Inventory:

 InventoryID (Primary Key, simple, Single-Valued)


 ProductID (Foreign Key, simple, Single-Valued)
 SupplierID (Foreign Key, simple, Single-Valued)
 QuentityAvailable (simple, Single-Valued)
 RestockDate (Simple, Single-Valued)

3. Define Primary and Candidate Keys:


 Product: Primary Key - ProductID; Candidate Key - Name and Brand (unique
combination).
 Customer: Primary Key - CustomerID; Candidate Key - Email.
 Order: Primary Key - OrderID.
 Employee: Primary Key - EmployeeID.
 Supplier: Primary Key - SupplierID; Candidate Key – Name
 Inventory: Primary Key - InventoryID; Composite Candidate Key – (ProductID,
SupplierID)

4. Determine Relationships and Mapping Cardinalities:

 Product - Supplier: Many-to-Many (each product can have multiple suppliers,


and each supplier can supply multiple products).
 Customer - Order**: One-to-Many (each customer can place multiple orders, but
each order belongs to only one customer).
 Order - Product: Many-to-Many (each order can contain multiple products, and
each product can be part of multiple orders).
 Employee - Order: One-to-Many (each order is managed by one employee, but
an employee may manage multiple orders).
 Supplier - Product: One-to-Many (each supplier may supply multiple products).

You might also like