Skip to content

i-m-meet/WebTechnology_Assignment2

Repository files navigation

WebTechnology_Assignment2

WebTechnology_Assignment2

This repository contains the code for Assignment 2 of the Web Technologies

sql query used to create database

USE shopping;

CREATE TABLE products ( id INT AUTO_INCREMENT PRIMARY KEY, description VARCHAR(255) NOT NULL, image VARCHAR(255), pricing DECIMAL(10, 2) NOT NULL, shipping_cost DECIMAL(10, 2) NOT NULL );

CREATE TABLE users ( id INT AUTO_INCREMENT PRIMARY KEY, email VARCHAR(255) NOT NULL, password VARCHAR(255) NOT NULL, username VARCHAR(100) NOT NULL, purchase_history TEXT, shipping_address TEXT );

CREATE TABLE comments ( id INT AUTO_INCREMENT PRIMARY KEY, product_id INT NOT NULL, user_id INT NOT NULL, rating INT NOT NULL, image VARCHAR(255), comment_text TEXT, FOREIGN KEY (product_id) REFERENCES products(id), FOREIGN KEY (user_id) REFERENCES users(id) );

CREATE TABLE cart ( id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, product_id INT NOT NULL, quantity INT NOT NULL, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (product_id) REFERENCES products(id) );

CREATE TABLE orders ( id INT AUTO_INCREMENT PRIMARY KEY, user_id INT NOT NULL, product_id INT NOT NULL, quantity INT NOT NULL, total_amount DECIMAL(10, 2) NOT NULL, order_date TIMESTAMP DEFAULT CURRENT_TIMESTAMP, FOREIGN KEY (user_id) REFERENCES users(id), FOREIGN KEY (product_id) REFERENCES products(id) );

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages