Giter Club home page Giter Club logo

onlinegrocery's Introduction

OnlineGrocery

create database amazon;

use amazon;

//------users table------ create table users(name varchar(100),email varchar(100)primary key, mobileNumber bigint, securityQuestion varchar(200), answer varchar(200),password varchar(100), address varchar(500),city varchar(100), state varchar(100),country varchar(100));

create table product(id int NOT NULL IDENTITY(1,1),
name varchar(500),image varchar(500),
category varchar(200),
price int,active varchar(10),
primary key(id));



drop table cart
//------cart table--------
create table cart(id int Not Null,email varchar(100),product_id int,
quantity int,price int,total int,
primary key(id),
FOREIGN KEY (email) REFERENCES users(email),
FOREIGN KEY (product_id) REFERENCES product(id)

);

create table Orders(id int NOT NULL IDENTITY(1,1),email varchar(100), address varchar(500)
,city varchar(100),state varchar(100),
country varchar(100),
mobileNumber bigint,orderDate varchar(100),deliveryDate varchar(100),
paymentMethod varchar(100),transactionId varchar(100),status varchar(10),
primary key(id),
FOREIGN KEY (email) REFERENCES users(email)

);

create table message(id int IDENTITY(1,1),email varchar(100),subject varchar(200),body varchar(1000),PRIMARY KEY(ID));





TEst Quires!!!
use amazon
insert into users (name,email) Values('yaswanth','[email protected]')
     INSERT INTO product(name,image,category,price,active) VALUES("Tomato-1kg","https://www.freepnglogos.com/uploads/tomato-png/tomato-and-kidney-stone-everyday-life-23.png","vegetables",10,"Yes");
INSERT INTO product(name,image,category,price,active) VALUES("Potato-1kg","http://alrafique.com/images/potatoes.png","vegetables",15,"Yes");
select *from product
select *from  cart
select *from users
delete  from Orders where email='[email protected]'
insert into cart values('[email protected]','onion',1,1,50,50)
insert into users(name,email,password) values('admin','[email protected]','admin')
update users set password='test' where email='[email protected]'

onlinegrocery's People

Contributors

yvyaswanth13 avatar

Watchers

 avatar

Forkers

shrivalli

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.