Thanks to visit codestin.com
Credit goes to github.com

Skip to content

quyetdaika/design-database-using-PostgreSQL

Repository files navigation

Design Database

NodeJS


Introduction

  • 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

Design

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.

ER Diagram

Visualizes the logical structure and relationships between different entities my system. ERD

Relational Schema

Shows the detailed logical schema design for implementation as relational tables in RDBMS. RS

Object Descriptions and Necessity Level

1. Product Management (products table)

Includes information about products.

2. Order Management (orders table)

Helps track order status, order details including purchased products, customers, purchase dates, etc.

3. Customer Management

Stores customer information such as personal details, registered accounts and passwords. Also indicates customer loyalty via join date, total spending amount.

4. Category Management (categories table)

Product categories being sold, facilitating management for sellers and search for buyers.

5. Shopping Cart Management (cartlines table)

Manages products that customers are interested in but have not decided to purchase yet, can be added to cart in advance.

6. Product Review Management (feedback table)

Stores customer reviews after purchasing a product, helping other customers reference experiences from past buyers. Also allows the seller to acknowledge and improve quality.

Demo

Some CRUD on my Database

Create table and initial data

CREATE, INSERT, UPDATE createdata-ezgif com-video-to-gif-converter

Querying and Filtering data

  • Select laptops which price is less than 20m VND, display size is 15.6inch, and 8GB of RAM image
  • Show laptop list by Price low to high image

Note

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

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published