0% found this document useful (0 votes)
16 views7 pages

Online Shopping System Database Design

The document outlines the design of an Online Shopping System, detailing entities such as Shopping Website, Order, Admin, Product, Customer, Payment, and Tracking, along with their attributes and relationships. It emphasizes normalization principles to ensure data integrity and reduce redundancy, including constraints like primary keys, foreign keys, and unique constraints. Additionally, it highlights the importance of maintaining data consistency and accuracy within the database structure.

Uploaded by

Kanak Arora
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
16 views7 pages

Online Shopping System Database Design

The document outlines the design of an Online Shopping System, detailing entities such as Shopping Website, Order, Admin, Product, Customer, Payment, and Tracking, along with their attributes and relationships. It emphasizes normalization principles to ensure data integrity and reduce redundancy, including constraints like primary keys, foreign keys, and unique constraints. Additionally, it highlights the importance of maintaining data consistency and accuracy within the database structure.

Uploaded by

Kanak Arora
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

Nagar Yuwak Shikshan Sanstha’s

YESHWANTRAO CHAVAN
COLLEGE OF
ENGINEERING
(AN Autonomous institution Affiliated to Rashtra Sant Tukadoji Maharaj Nagpur University)

Hingna, Road, Wanadongri, Nagpur-41 110

NAAC Accredited with A++ Grade


Department of Computer Technology

Topic Name: Online Shopping System.

Submitted By:
o Kanak Arora: 06
o Kunika Khandal: 07
o Nidhi Sakhare: 08
o Parvani Satpute: 09
o Priya Kriplani: 10

Submitted To:
Prof. Gauri Chaudhary
Entities:

 Shopping Website:
Attribute: website_id, (PrimaryKey), website_name,
website_url
 Order:
Attribute: order_id (Primary Key), customer_id (Foreign Key to
Customer table), product_id (Foreign Key to Product table),
order_date, quantity, total_price
 Admin:
Attribute: admin_id (Primary Key), admin_name, email, password
 Product:
Attribute: product_id (Primary Key), product_name,
description, price, quantity_available
 Customer:
Attribute: customer_id (Primary Key), customer_name,
email, password, address, phone_number
 Payment:
Attribute: payment_id (Primary Key), order_id (Foreign Key to Order
table), payment_date, amount
 Tracking:
Attribute:tracking_id (Primary Key), order_id (Foreign Key to Order
table), status, location, update_date

Relationships:

 Admin manage Shopping Website:


Cardinality: One-to-One

 Shopping website has Product:


Cardinality: One-to-Many

 Order contains Product:


Cardinality: One-to-Many

 Customers make orders:


Cardinality: One-to-Many

 Customers make Payments:


Cardinality: One-to-Many

 Order has Tracking Details:


Cardinality: One-to-Many
Normalisation and integrity
constraints:
Normalization:
First Normal Form (1NF): Each product category, such as clothing or
electronics, should be stored in a separate table to avoid duplication and
ensure atomicity.
Second Normal Form (2NF): Product details, such as name, description,
and price, should be stored in a separate table linked to the product category
table to eliminate partial dependencies.
Third Normal Form (3NF): Additional details like product dimensions or
specifications should be stored in separate tables linked to the product table
to eliminate transitive dependencies.
Integrity Constraints:
Primary Key Constraint: Each table should have a primary key, such as a
unique product ID, to ensure that each product or customer is uniquely
identified.
Foreign Key Constraint: If the system includes customer information, a
foreign key constraint can link the customer table to other tables, such as
orders, to maintain referential integrity.
Unique Constraint: Product SKUs or order numbers should be unique to
prevent duplicate entries and ensure accurate tracking.
Not Null Constraint: Essential fields like product name, price, or customer
email should have a not null constraint to enforce the presence of meaningful
data.
Check Constraint: For instance, a check constraint can be used to ensure
that the quantity of a product ordered is greater than zero and not negative.
By applying normalization, the data is organized efficiently, reducing
redundancy and improving query performance. Integrity constraints enforce
data consistency, prevent data anomalies, and maintain the accuracy and
integrity of the online shopping system's database.

Entity-Relationship Diagram:
Relation Database Schema:

Common questions

Powered by AI

Enforcing referential integrity through foreign key constraints ensures that relationships between tables are maintained accurately. In the context of orders and customers, a foreign key constraint ensures that each order is associated with a valid customer, meaning an order cannot exist without a corresponding customer. This prevents issues like orphaned records, enhances data consistency, and ensures that any changes in customer information are properly cascaded to related tables, such as order histories, which is critical for maintaining a reliable and accurate database system .

Enforcing a unique constraint on order numbers is crucial because it guarantees that each order can be uniquely identified and tracked through the system. This uniqueness supports diligent order management, from processing to fulfillment, without confusion or overlap. Failing to enforce this constraint could lead to duplicate orders, misplacement of records, and ultimately customer dissatisfaction if incorrect products are shipped. It could also result in inaccurate financial reporting and issues in inventory management due to incorrectly aggregated order details .

Not implementing normalization in the database of an online shopping system can lead to data redundancy, which means that the same data may be stored in multiple places. This can result in inconsistencies if the data is updated in one place but not another, leading to inaccurate information. Moreover, query performance may degrade as databases might become unnecessarily large due to duplicated data. Without normalization, there are increased chances of data anomalies during insert, update, or delete operations, which can significantly affect the integrity of the shopping system's operations .

Integrating third normal form (3NF) in an online shopping system ensures that each database table contains only data directly related to its primary key, thereby eliminating transitive dependencies. This leads to more efficient data storage by reducing redundancy and ensuring only necessary attributes are stored. However, it may increase the complexity of queries as retrieving complete data often requires joining multiple tables. Despite this, the benefits of data integrity and reduced chances of anomalies typically outweigh the complexity, leading to a more robust database operation .

The one-to-one relationship between an Admin and a Shopping Website signifies that each website is managed by one specific admin, who is solely responsible for its operation, maintenance, and decision-making. This setup allows for clear lines of responsibility and accountability, ensuring that only one person makes changes or updates, minimizing the risk of conflicting modifications. It also allows for personalized and focused management of the website's content and performance, although it may require scaling of administrative resources as the number of websites increases .

Using not null constraints on essential fields like customer emails ensures that critical contact information is always captured in the database. This is vital for operations like order confirmations, shipping notifications, and marketing communications. The absence of such data would prevent effective communication and hinder the ability to verify customer identities. Additionally, it could lead to incomplete customer profiles, reducing the quality of customer service and support, and potentially leading to lost business opportunities due to an inability to engage with the customers .

In a "One-to-Many" cardinality relationship between a shopping website and its products, a single shopping website can host multiple products. Each product belongs to exactly one website, ensuring that product details and availability are specific to that website and cannot be shared or duplicated across different sites. This structure allows for more efficient management of products by an admin and enables distinct product listings for each shopping website .

Primary keys play a crucial role in ensuring that each entry within a table, such as products or customers, is unique and can be individually identified. By assigning a unique identifier, such as a product ID or customer ID, primary keys prevent duplicate entries, thus maintaining data integrity. They also facilitate efficient retrieval and manipulation of records, as each entry can be directly accessed or referenced using its primary key, which is vital for managing and tracking entities within an online shopping system .

Partitioning product-related details across multiple tables according to normalization principles, such as in 2NF and 3NF, improves database efficiency by eliminating partial and transitive dependencies. This structure ensures that each table contains only related attributes, minimizing redundancy. For instance, storing product details like name and description separately from product dimensions or specifications means that updates or modifications affect only the relevant table without impacting unrelated data. This reduces the risk of anomalies and increases query performance, as queries retrieve data only from necessary tables rather than scanning through irrelevant or duplicated data .

Applying check constraints on fields like order quantity is important to ensure that the data entered into the database adheres to business rules and makes logical sense. For instance, a check constraint ensures that order quantities are greater than zero and not negative, preventing nonsensical or erroneous orders that could affect inventory levels and customer satisfaction. Without such constraints, users might input invalid data that could lead to logistical and financial discrepancies, disruption of the order fulfillment process, and potential loss due to incorrect stock adjustments .

You might also like