This project is a PL/SQL-based e-commerce database simulation, created for the Database II course. The objective is to implement a structured database management system to handle an online store's data using stored procedures, functions, triggers, and views.
Click&Shop provides a simulated e-commerce environment, focusing on key database functionalities:
- Stored Procedures and Functions: Manage and automate data processes for users, products, orders, and payments.
- Triggers: Audit data changes in key tables such as
Product
andOrder
. - Views: Simplify complex queries for product listings, user reviews, order details, and payment history.
- Data Constraints and Validation: Ensure data integrity and business rules through constraints and validations.
The database includes the following main entities:
- User (UsuarioComprador): Stores user information with authentication details and address.
- Vendor (Vendedor): Manages vendor profiles, including sales data.
- Product (Producto): Includes details of products like category, inventory, and price.
- Order (Orden) & Cart (Carrito): Manages the user’s shopping cart, order processing, and item tracking.
- Review (Resenhas): Allows users to leave ratings and comments on products.
- Payment (Pago): Handles user payments and payment status.
- Audit (Auditoria): Logs actions on tables for auditing purposes.
- Product Management: Procedures to add and update products, with inventory control.
- Cart Operations: Add or remove items, calculate totals, and validate inventory.
- Order Processing: Generate orders from the cart, with status tracking.
- Payment Processing: Verify payments and update order statuses.
- Data Integrity: Triggers to audit data changes and ensure inventory is properly managed.
- User Reviews: Collects and displays user reviews and ratings.
- Admin Views: Simplified queries for product listings, user reviews, and order history.
- Create the database schema by running the provided SQL scripts.
- Set up sequences, tables, constraints, and insert initial data.
- Execute procedures and functions to manage the database as needed.
- Product List:
SELECT * FROM VistaProducto;
- User Reviews:
SELECT * FROM VistaResenhasUsuario;
- Customer Orders:
SELECT * FROM VistaOrdenesCliente;
- Customer Payments:
SELECT * FROM VistaPagosCliente;