- This is a project for the database lab course
- Purpose: To design a database to store and interact with data from an online electronics store
- Relational database management system : PostgreSQL
Overview of design
-
The database consists of 4 entities – customers, products, categories and orders. Each customer has a shopping cart (cartlines) containing product codes and intended purchase quantities. Customers also have multiple orders (orders), details of each order are stored in the orderlines table. Customer feedback on purchased products is stored in the feedback table.
-
The database is comprised of 7 tables. There are 4 tables corresponding to the 4 entities: customers, products, categories, orders and 3 associative entity tables to model many-to-many relationships: cartlines, orderlines, feedback.
Visualizes the logical structure and relationships between different entities my system.
Shows the detailed logical schema design for implementation as relational tables in RDBMS.
Includes information about products.
Helps track order status, order details including purchased products, customers, purchase dates, etc.
Stores customer information such as personal details, registered accounts and passwords. Also indicates customer loyalty via join date, total spending amount.
Product categories being sold, facilitating management for sellers and search for buyers.
Manages products that customers are interested in but have not decided to purchase yet, can be added to cart in advance.
Stores customer reviews after purchasing a product, helping other customers reference experiences from past buyers. Also allows the seller to acknowledge and improve quality.
Some CRUD on my Database
- Select laptops which price is less than 20m VND, display size is 15.6inch, and 8GB of RAM

- Show laptop list by Price low to high

Note
See more about query and trigger, function included at select-function-trigger.sql


