Skip to content

pettiboy/java-ecommerce-sqlite

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Java E-Commerce CLI Using SQLite

Usage

Clone repo

git clone git@github.com:pettiboy/java-ecommerce-sqlite.git
cd java-ecommerce-sqlite

Run code

run the main method in src/Driver.java

Tables

phone_otp

CREATE TABLE phone_otp(
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    phone TEXT NOT NULL,
    otp INTEGER NOT NULL
);

users

CREATE TABLE users(
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    phone TEXT NOT NULL,
    address TEXT NOT NULL,
    timestamp TEXT NOT NULL,
    isStaff TEXT NOT NULL
);

products

CREATE TABLE products(
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    name TEXT NOT NULL,
    price TEXT NOT NULL,
    description TEXT NOT NULL,
    isActive TEXT NOT NULL
);

orders

CREATE TABLE orders(
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    userId INTEGER NOT NULL,
    dateOrdered TEXT NOT NULL,
    complete TEXT NOT NULL,
    FOREIGN KEY(userId) REFERENCES users(id)
);

CREATE TABLE order_product (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    orderId INTEGER NOT NULL,
    productId INTEGER NOT NULL,
    FOREIGN KEY(orderId) REFERENCES orders(id),
    FOREIGN KEY(productId) REFERENCES products(id)
);

Why am I using TEXT instead of other datatypes?

This is because the values will be returned as String either way in java.

About

CLI E-commerce application using java and sqlite

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages