0% found this document useful (0 votes)
20 views2 pages

E-Commerce Database Design Project

dbms

Uploaded by

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

E-Commerce Database Design Project

dbms

Uploaded by

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

ADAMA SCIENCE AND TECHNOLOGY UNIVERSITY

SCHOOL OF ELECTRICAL ENGINEERING AND COMPUTING


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING
Database Systems SEng2208 Group Project

Designing a database for an online shopping platform. The platform allows customers to browse and
purchase products from various sellers. Each seller can offer multiple products on the platform, and
each product can be offered by multiple sellers. Customers can add products to their shopping carts,
place orders, make payments and do shipments of orders made by customers to their preferred
address. The database should support the following specifications:

i. Store information about customers, including their name, email, shipping address, and
payment details.
ii. Store information about sellers, including their name, contact information, and address.
iii. Store information about products including their name, description, price, and available
quantity.
iv. Keep track of the inventory for each product offered by sellers.
v. Enable customers to place orders, specifying the products, quantities, and associated sellers.
vi. Record order details, including the customer, order date, total amount, and shipping details.
vii. Customer orders shipment with tracking features for customers is also stored.
viii. Support cashless online payment methods for customers to complete their orders.
1. Based on these requirements, design a normalized database schema that represents the entities,
relationships, and attributes necessary to support the online shopping platform. Consider the
cardinality and relationships between entities, as well as any additional tables or fields that may be
required to fulfill the given functionalities.
2. Implement the above design using SQL.
a. Provide the DDL SQL statements to create the database schema [Database Tables, etc].
b. Provide the DML SQL statements to Insert at least 10 sample data in each table, select
statement for all tables to show outputs.
c. Implement trigger SQL statements on update, insert and delete statements
d. Implement views to generate reports [sales report, tax report, inventory report, customers
report, products report].
e. Create stored procedure report [parametrized and non-parametrized]
f. Implement join SQL statements
3. Create transactions scenarios that emulate customers purchase, inventory changes, changes in
payments and tax, etc.
4. Create users and provide necessary permissions using grant and revoke SQL statements.
5. Implement logging, backup and recovery the database.

Page 1 of 2
Evaluation:

1. Database schema using ERD design 20.


2. DDL and basic DML 15.
3. REPORT 15.
4. TRANSACTIONS 20.
5. SECURITY 15 AND RECOVERY 15.
Submission deadline on or Before December-06-2024.

Page 2 of 2

Common questions

Powered by AI

SQL triggers can automatically enforce data integrity by executing predefined actions in response to certain events, such as product inventory updates or order placements. For instance, a trigger could ensure that inventory quantities are decremented when a product is ordered, preventing sales beyond available stock. When orders are placed, a trigger might also log the transaction details or update related tables for auditing purposes. This automated enforcement helps maintain consistency and integrity within the database, reducing the likelihood of errors from manual processes .

To evaluate and optimize SQL query performance, start by analyzing execution plans to identify bottlenecks, such as inefficient joins. Index critical columns to speed up search queries and reduce full table scans. Use efficient join types and query structures, replacing subqueries with joins where possible. Minimize data retrieval by selecting only necessary columns and rows. Regularly review and optimize complex queries, particularly those used in reports and frequent transactions. Consider caching strategies for repetitive queries to improve overall response times and reduce system load .

To effectively manage customer, product, and seller data in an online shopping platform, the database should be normalized at least to the third normal form (3NF). This involves ensuring that each table has no repeated groups and dependencies are minimized. For example, storing Customers in one table with attributes like name, email, and shipping address, Products in another with name, description, and price, and Sellers with name and contact information ensures no redundancy. Associate product quantities with specific sellers for inventory management, using foreign keys to link orders to customers and products, further reducing data redundancy .

Parameterized stored procedures enhance flexibility and security in generating reports by allowing input variables at runtime, reducing the risk of SQL injection attacks. This means users can fetch dynamic reports based on specific criteria (e.g., sales data for a given date range). Non-parameterized procedures, by contrast, provide static implementations for routine and frequent reports, ensuring consistency and efficiency. Both types facilitate efficient database management, allowing complex operations to be encapsulated and reused, enhancing performance and maintainability of the reporting functions .

Role-based access control (RBAC) is crucial for managing database security by ensuring users have appropriate permissions for their responsibilities, reducing unintentional data exposure. In an online shopping platform, this means customers should only access their own data and not others, while sellers might manage information relevant to their products. Administrators have broader access to manage the system. Implementing RBAC minimizes security risks, streamlines permission management, and enforces the principle of least privilege—access required for a user's role—thus protecting sensitive data from unauthorized access .

Implementing a cashless online payment system presents challenges including ensuring transaction security, handling payment failures, and maintaining accurate financial records. Security can be enhanced using encryption and secure transaction protocols to protect sensitive payment data. Handling payment failures requires robust error-handling methods and clear communication with customers regarding issue resolutions or retries. Accurate financial records necessitate auditing mechanisms potentially with SQL triggers to automatically log transactions and generate error reports. Ensuring compliance with relevant financial regulations is also crucial .

Views in SQL provide a mechanism to simplify complex queries and present data in a user-friendly manner for reports such as sales and inventory. By defining views, users can obtain aggregated or filtered data from multiple tables without writing complex queries each time. For example, a sales report view might join Orders, Products, and Sellers tables to summarize sales data, while an inventory report view could present available stock levels per product and seller. This abstraction layer enhances usability and data accessibility without altering the underlying database schema .

Implementing effective logging, backup, and recovery strategies requires considerations of data integrity, security, and performance. For logging, it is crucial to define what activities to log (e.g., transactions, changes in sensitive data) to trace issues while not impacting system performance. Backup strategies should consider the frequency (e.g., daily incrementals, weekly full backups), storage requirements, and methods such as differential or full. For recovery, the plan must address recovery time objectives (RTOs) and recovery point objectives (RPOs), ensuring that backup procedures align with business continuity needs and data loss tolerance levels .

In designing a database schema for an online shopping platform, key entities include Customers, Products, Sellers, Orders, and Payments. The relationships among these entities involve: Customers place Orders, Orders include multiple Products, Products can be offered by multiple Sellers, and Sellers can provide multiple Products. Each Order can involve Payments, which are associated with Customers and manage shipping details. These entities and relationships require considering cardinality, such as many-to-many relationships between Products and Sellers, and one-to-many relationships between Customers and Orders .

Neglecting to implement transaction scenarios can severely impact database consistency and reliability. Without transaction management, partial updates or failures (e.g., during an order placement) might leave the database in an inconsistent state, such as debiting inventory without recording the sale in Orders. This can lead to data anomalies, such as double entries or inventory mismatches. Transaction scenarios ensure atomicity, consistency, isolation, and durability (ACID properties), crucial for maintaining system reliability by ensuring all operations in a transaction are completed successfully or rolled back entirely .

You might also like