Location via proxy:
[ UP ]
[Report a bug]
[Manage cookies]
No cookies
No scripts
No ads
No referrer
Show this form
Open navigation menu
Close suggestions
Search
Search
en
Change Language
Upload
Sign in
Sign in
Download free for days
0 ratings
0% found this document useful (0 votes)
13 views
Create DB Store
Uploaded by
abhishekshaw1507
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download now
Download
Save create-db-store For Later
Download
Save
Save create-db-store For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
0 ratings
0% found this document useful (0 votes)
13 views
Create DB Store
Uploaded by
abhishekshaw1507
AI-enhanced title
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content,
claim it here
.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
Download now
Download
Save create-db-store For Later
Carousel Previous
Carousel Next
Save
Save create-db-store For Later
0%
0% found this document useful, undefined
0%
, undefined
Embed
Share
Print
Report
Download now
Download
You are on page 1
/ 3
Search
Fullscreen
DROP DATABASE IF EXISTS `store`;
CREATE DATABASE `store`;
USE `store`;
CREATE TABLE `products` (
`product_id` int(11) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
`quantity_in_stock` int(11) NOT NULL,
`unit_price` decimal(4,2) NOT NULL,
PRIMARY KEY (`product_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;
INSERT INTO `products` VALUES (1,'Foam Dinner Plate',70,1.21);
INSERT INTO `products` VALUES (2,'Pork - Bacon,back Peameal',49,4.65);
INSERT INTO `products` VALUES (3,'Lettuce - Romaine, Heart',38,3.35);
INSERT INTO `products` VALUES (4,'Brocolinni - Gaylan, Chinese',90,4.53);
INSERT INTO `products` VALUES (5,'Sauce - Ranch Dressing',94,1.63);
INSERT INTO `products` VALUES (6,'Petit Baguette',14,2.39);
INSERT INTO `products` VALUES (7,'Sweet Pea Sprouts',98,3.29);
INSERT INTO `products` VALUES (8,'Island Oasis - Raspberry',26,0.74);
INSERT INTO `products` VALUES (9,'Longan',67,2.26);
INSERT INTO `products` VALUES (10,'Broom - Push',6,1.09);
CREATE TABLE `shippers` (
`shipper_id` smallint(6) NOT NULL AUTO_INCREMENT,
`name` varchar(50) NOT NULL,
PRIMARY KEY (`shipper_id`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;
INSERT INTO `shippers` VALUES (1,'Hettinger LLC');
INSERT INTO `shippers` VALUES (2,'Schinner-Predovic');
INSERT INTO `shippers` VALUES (3,'Satterfield LLC');
INSERT INTO `shippers` VALUES (4,'Mraz, Renner and Nolan');
INSERT INTO `shippers` VALUES (5,'Waters, Mayert and Prohaska');
CREATE TABLE `customers` (
`customer_id` int(11) NOT NULL AUTO_INCREMENT,
`first_name` varchar(50) NOT NULL,
`last_name` varchar(50) NOT NULL,
`birth_date` date DEFAULT NULL,
`phone` varchar(50) DEFAULT NULL,
`address` varchar(50) NOT NULL,
`city` varchar(50) NOT NULL,
`state` char(2) NOT NULL,
`points` int(11) NOT NULL DEFAULT '0',
PRIMARY KEY (`customer_id`)
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;
INSERT INTO `customers` VALUES (1,'Babara','MacCaffrey','1986-03-28','781-932-
9754','0 Sage Terrace','Waltham','MA',2273);
INSERT INTO `customers` VALUES (2,'Ines','Brushfield','1986-04-13','804-427-
9456','14187 Commercial Trail','Hampton','VA',947);
INSERT INTO `customers` VALUES (3,'Freddi','Boagey','1985-02-07','719-724-
7869','251 Springs Junction','Colorado Springs','CO',2967);
INSERT INTO `customers` VALUES (4,'Ambur','Roseburgh','1974-04-14','407-231-
8017','30 Arapahoe Terrace','Orlando','FL',457);
INSERT INTO `customers` VALUES (5,'Clemmie','Betchley','1973-11-07',NULL,'5 Spohn
Circle','Arlington','TX',3675);
INSERT INTO `customers` VALUES (6,'Elka','Twiddell','1991-09-04','312-480-8498','7
Manley Drive','Chicago','IL',3073);
INSERT INTO `customers` VALUES (7,'Ilene','Dowson','1964-08-30','615-641-4759','50
Lillian Crossing','Nashville','TN',1672);
INSERT INTO `customers` VALUES (8,'Thacher','Naseby','1993-07-17','941-527-
3977','538 Mosinee Center','Sarasota','FL',205);
INSERT INTO `customers` VALUES (9,'Romola','Rumgay','1992-05-23','559-181-
3744','3520 Ohio Trail','Visalia','CA',1486);
INSERT INTO `customers` VALUES (10,'Levy','Mynett','1969-10-13','404-246-3370','68
Lawn Avenue','Atlanta','GA',796);
CREATE TABLE `order_statuses` (
`order_status_id` tinyint(4) NOT NULL,
`name` varchar(50) NOT NULL,
PRIMARY KEY (`order_status_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci;
INSERT INTO `order_statuses` VALUES (1,'Processed');
INSERT INTO `order_statuses` VALUES (2,'Shipped');
INSERT INTO `order_statuses` VALUES (3,'Delivered');
CREATE TABLE `orders` (
`order_id` int(11) NOT NULL AUTO_INCREMENT,
`customer_id` int(11) NOT NULL,
`order_date` date NOT NULL,
`status` tinyint(4) NOT NULL DEFAULT '1',
`comments` varchar(2000) DEFAULT NULL,
`shipped_date` date DEFAULT NULL,
`shipper_id` smallint(6) DEFAULT NULL,
PRIMARY KEY (`order_id`),
KEY `fk_orders_customers_idx` (`customer_id`),
KEY `fk_orders_shippers_idx` (`shipper_id`),
KEY `fk_orders_order_statuses_idx` (`status`),
CONSTRAINT `fk_orders_customers` FOREIGN KEY (`customer_id`) REFERENCES
`customers` (`customer_id`) ON UPDATE CASCADE,
CONSTRAINT `fk_orders_order_statuses` FOREIGN KEY (`status`) REFERENCES
`order_statuses` (`order_status_id`) ON UPDATE CASCADE,
CONSTRAINT `fk_orders_shippers` FOREIGN KEY (`shipper_id`) REFERENCES `shippers`
(`shipper_id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;
INSERT INTO `orders` VALUES (1,6,'2019-01-30',1,NULL,NULL,NULL);
INSERT INTO `orders` VALUES (2,7,'2018-08-02',2,NULL,'2018-08-03',4);
INSERT INTO `orders` VALUES (3,8,'2017-12-01',1,NULL,NULL,NULL);
INSERT INTO `orders` VALUES (4,2,'2017-01-22',1,NULL,NULL,NULL);
INSERT INTO `orders` VALUES (5,5,'2017-08-25',2,'','2017-08-26',3);
INSERT INTO `orders` VALUES (6,10,'2018-11-18',1,'Aliquam erat volutpat. In
congue.',NULL,NULL);
INSERT INTO `orders` VALUES (7,2,'2018-09-22',2,NULL,'2018-09-23',4);
INSERT INTO `orders` VALUES (8,5,'2018-06-08',1,'Mauris enim leo, rhoncus sed,
vestibulum sit amet, cursus id, turpis.',NULL,NULL);
INSERT INTO `orders` VALUES (9,10,'2017-07-05',2,'Nulla mollis molestie lorem.
Quisque ut erat.','2017-07-06',1);
INSERT INTO `orders` VALUES (10,6,'2018-04-22',2,NULL,'2018-04-23',2);
CREATE TABLE `order_items` (
`order_id` int(11) NOT NULL AUTO_INCREMENT,
`product_id` int(11) NOT NULL,
`quantity` int(11) NOT NULL,
`unit_price` decimal(4,2) NOT NULL,
PRIMARY KEY (`order_id`,`product_id`),
KEY `fk_order_items_products_idx` (`product_id`),
CONSTRAINT `fk_order_items_orders` FOREIGN KEY (`order_id`) REFERENCES `orders`
(`order_id`) ON UPDATE CASCADE,
CONSTRAINT `fk_order_items_products` FOREIGN KEY (`product_id`) REFERENCES
`products` (`product_id`) ON UPDATE CASCADE
) ENGINE=InnoDB AUTO_INCREMENT=11 DEFAULT CHARSET=utf8mb4
COLLATE=utf8mb4_0900_ai_ci;
INSERT INTO `order_items` VALUES (1,4,4,3.74);
INSERT INTO `order_items` VALUES (2,1,2,9.10);
INSERT INTO `order_items` VALUES (2,4,4,1.66);
INSERT INTO `order_items` VALUES (2,6,2,2.94);
INSERT INTO `order_items` VALUES (3,3,10,9.12);
INSERT INTO `order_items` VALUES (4,3,7,6.99);
INSERT INTO `order_items` VALUES (4,10,7,6.40);
INSERT INTO `order_items` VALUES (5,2,3,9.89);
INSERT INTO `order_items` VALUES (6,1,4,8.65);
INSERT INTO `order_items` VALUES (6,2,4,3.28);
INSERT INTO `order_items` VALUES (6,3,4,7.46);
INSERT INTO `order_items` VALUES (6,5,1,3.45);
INSERT INTO `order_items` VALUES (7,3,7,9.17);
INSERT INTO `order_items` VALUES (8,5,2,6.94);
INSERT INTO `order_items` VALUES (8,8,2,8.59);
INSERT INTO `order_items` VALUES (9,6,5,7.28);
INSERT INTO `order_items` VALUES (10,1,10,6.01);
INSERT INTO `order_items` VALUES (10,9,9,4.28);
CREATE TABLE `sql_store`.`order_item_notes` (
`note_id` INT NOT NULL,
`order_Id` INT NOT NULL,
`product_id` INT NOT NULL,
`note` VARCHAR(255) NOT NULL,
PRIMARY KEY (`note_id`));
INSERT INTO `order_item_notes` (`note_id`, `order_Id`, `product_id`, `note`) VALUES
('1', '1', '2', 'first note');
INSERT INTO `order_item_notes` (`note_id`, `order_Id`, `product_id`, `note`) VALUES
('2', '1', '2', 'second note');
You might also like
POint of Sale Project Report
PDF
No ratings yet
POint of Sale Project Report
31 pages
Eudemon200E-B&C&F&X & Eudemon1000E-X V300R001 Configuration Guide-CLI 01
PDF
No ratings yet
Eudemon200E-B&C&F&X & Eudemon1000E-X V300R001 Configuration Guide-CLI 01
3,797 pages
CISSP Cheat Sheet Domain 1-2 PDF
PDF
No ratings yet
CISSP Cheat Sheet Domain 1-2 PDF
1 page
New Text Documfyfyffent
PDF
No ratings yet
New Text Documfyfyffent
7 pages
DB
PDF
No ratings yet
DB
18 pages
Grocery SQL
PDF
No ratings yet
Grocery SQL
3 pages
NorthWind Sample Database
PDF
No ratings yet
NorthWind Sample Database
26 pages
Northwind
PDF
No ratings yet
Northwind
21 pages
Online Fruit Shop Management System
PDF
No ratings yet
Online Fruit Shop Management System
19 pages
New Text Document
PDF
No ratings yet
New Text Document
4 pages
MySQL Codes For Learning
PDF
No ratings yet
MySQL Codes For Learning
12 pages
Database Commands - 2
PDF
No ratings yet
Database Commands - 2
12 pages
Northwind
PDF
No ratings yet
Northwind
101 pages
SQL
PDF
No ratings yet
SQL
41 pages
Database lab 4
PDF
No ratings yet
Database lab 4
7 pages
Reto 3 Java
PDF
No ratings yet
Reto 3 Java
20 pages
���+ᮧ�����+����+������
PDF
No ratings yet
���+ᮧ�����+����+������
4 pages
Message
PDF
No ratings yet
Message
7 pages
MYSQL Day1
PDF
No ratings yet
MYSQL Day1
4 pages
01-08说明
PDF
No ratings yet
01-08说明
5 pages
Stock
PDF
No ratings yet
Stock
4 pages
Dbms Lab
PDF
No ratings yet
Dbms Lab
15 pages
Ejercicio Base Datos Clientes
PDF
No ratings yet
Ejercicio Base Datos Clientes
7 pages
inventory management
PDF
No ratings yet
inventory management
20 pages
P1 (2)
PDF
No ratings yet
P1 (2)
3 pages
RDBMS Lab3
PDF
No ratings yet
RDBMS Lab3
7 pages
Create DB Inventory
PDF
No ratings yet
Create DB Inventory
1 page
SQL For Beginners LearnProgrammingAcademy
PDF
No ratings yet
SQL For Beginners LearnProgrammingAcademy
43 pages
MySQL Script Generated by MySQL Workbench
PDF
No ratings yet
MySQL Script Generated by MySQL Workbench
4 pages
SQL
PDF
No ratings yet
SQL
3 pages
1 Eje
PDF
No ratings yet
1 Eje
3 pages
Retailer Database
PDF
No ratings yet
Retailer Database
15 pages
Assignment 6
PDF
No ratings yet
Assignment 6
11 pages
SQL
PDF
No ratings yet
SQL
4 pages
Dbms Lab Work
PDF
No ratings yet
Dbms Lab Work
10 pages
Blink Basket
PDF
No ratings yet
Blink Basket
8 pages
Quuzzzzzz
PDF
No ratings yet
Quuzzzzzz
2 pages
Dbms Group CIA 3
PDF
No ratings yet
Dbms Group CIA 3
4 pages
Restaurant Management System Database Schema: Inventory
PDF
No ratings yet
Restaurant Management System Database Schema: Inventory
18 pages
Handson 8
PDF
No ratings yet
Handson 8
9 pages
Dbms 1
PDF
No ratings yet
Dbms 1
13 pages
Online Shopping System-Database Design - Bhupal Sapkota
PDF
100% (1)
Online Shopping System-Database Design - Bhupal Sapkota
4 pages
Store Project.sql
PDF
No ratings yet
Store Project.sql
3 pages
Retail Mart Management Zaid
PDF
No ratings yet
Retail Mart Management Zaid
4 pages
Datawarehouse
PDF
No ratings yet
Datawarehouse
5 pages
Analysis & SQL Commands
PDF
No ratings yet
Analysis & SQL Commands
35 pages
Tables
PDF
No ratings yet
Tables
27 pages
"No - Auto - Value - On - Zero" "+00:00": SET Start Transaction SET
PDF
No ratings yet
"No - Auto - Value - On - Zero" "+00:00": SET Start Transaction SET
8 pages
Sales and Cost Tables
PDF
No ratings yet
Sales and Cost Tables
4 pages
DDL
PDF
No ratings yet
DDL
9 pages
Database Examples Northwind MySQL
PDF
No ratings yet
Database Examples Northwind MySQL
25 pages
SQL Data
PDF
No ratings yet
SQL Data
179 pages
CSCI 414 Project 4
PDF
No ratings yet
CSCI 414 Project 4
104 pages
Database Management System Lab COE-317: Submitted by:-366/CO/14 SOMYA Sangal 374/CO/14 TWISHI Tyagi Coe-Iii
PDF
0% (1)
Database Management System Lab COE-317: Submitted by:-366/CO/14 SOMYA Sangal 374/CO/14 TWISHI Tyagi Coe-Iii
17 pages
S4
PDF
No ratings yet
S4
5 pages
DBS12 Uebungsblatt 08
PDF
No ratings yet
DBS12 Uebungsblatt 08
4 pages
MySQL Script Northwind
PDF
No ratings yet
MySQL Script Northwind
3 pages
collage level
PDF
No ratings yet
collage level
2 pages
Grocery billing store mysql queries
PDF
No ratings yet
Grocery billing store mysql queries
2 pages
Code Part
PDF
No ratings yet
Code Part
42 pages
Appb Dbcreate
PDF
0% (1)
Appb Dbcreate
9 pages
Apache Cassandra Developer Associate - Exam Practice Tests
From Everand
Apache Cassandra Developer Associate - Exam Practice Tests
Cristian Scutaru
No ratings yet
SkyEdge II - Hub Architecture-6 5 7
PDF
No ratings yet
SkyEdge II - Hub Architecture-6 5 7
5 pages
PDF System Reliability Management: Solutions and Technologies 1st Edition Adarsh Anand (Editor) Download
PDF
100% (3)
PDF System Reliability Management: Solutions and Technologies 1st Edition Adarsh Anand (Editor) Download
62 pages
Collections Java
PDF
No ratings yet
Collections Java
20 pages
A 5G Rural, Remote, and Difficult Areas Hope, A Review
PDF
No ratings yet
A 5G Rural, Remote, and Difficult Areas Hope, A Review
9 pages
HOW TO ACCESS THE LMS - PPSX
PDF
No ratings yet
HOW TO ACCESS THE LMS - PPSX
18 pages
SSH Tunneling Control: SSH Decryption To Prevent Non SSH Applications Bypass Firewall
PDF
No ratings yet
SSH Tunneling Control: SSH Decryption To Prevent Non SSH Applications Bypass Firewall
7 pages
Ebook VStextbook
PDF
No ratings yet
Ebook VStextbook
5 pages
Ibtasam Mateen (18-Arid-5157) Computer Arch
PDF
No ratings yet
Ibtasam Mateen (18-Arid-5157) Computer Arch
25 pages
SauceDemo (Bug Report)
PDF
No ratings yet
SauceDemo (Bug Report)
4 pages
Get (Ebook) Usability Testing of Medical Devices by Michael E. Wiklund, P.E., Jonathan Kendler, Allison Y. Strochlic ISBN 9781439811832, 1439811830 free all chapters
PDF
100% (1)
Get (Ebook) Usability Testing of Medical Devices by Michael E. Wiklund, P.E., Jonathan Kendler, Allison Y. Strochlic ISBN 9781439811832, 1439811830 free all chapters
82 pages
Inter/Intra-Vehicle Wireless Communication
PDF
No ratings yet
Inter/Intra-Vehicle Wireless Communication
1 page
QP-X-AI-Set-1 (1)
PDF
No ratings yet
QP-X-AI-Set-1 (1)
5 pages
Information & Communication Technology: DR - Rashmi Vishwakarma Teaching Associate
PDF
No ratings yet
Information & Communication Technology: DR - Rashmi Vishwakarma Teaching Associate
21 pages
Eee 3100
PDF
No ratings yet
Eee 3100
35 pages
IC 8155 Information
PDF
No ratings yet
IC 8155 Information
13 pages
PEF Prediction
PDF
No ratings yet
PEF Prediction
10 pages
OpenWRT Vlan
PDF
No ratings yet
OpenWRT Vlan
12 pages
SecureBoost A Lossless Federated Learning Framework
PDF
No ratings yet
SecureBoost A Lossless Federated Learning Framework
9 pages
INS - 4360704
PDF
No ratings yet
INS - 4360704
8 pages
Lecture 1 Notes
PDF
No ratings yet
Lecture 1 Notes
9 pages
Form 6 Recloser Control Product Aid Pa280009en
PDF
No ratings yet
Form 6 Recloser Control Product Aid Pa280009en
2 pages
System Call
PDF
No ratings yet
System Call
4 pages
Question Bank On Blockchain
PDF
No ratings yet
Question Bank On Blockchain
2 pages
Project Portfolios in Companies
PDF
No ratings yet
Project Portfolios in Companies
4 pages
class 5 study pack
PDF
No ratings yet
class 5 study pack
6 pages
Key Publications For SIRO
PDF
No ratings yet
Key Publications For SIRO
4 pages
JVM Architecture
PDF
No ratings yet
JVM Architecture
4 pages
1.2 Project Overview Title of Project:: Electronic Shop Management System
PDF
No ratings yet
1.2 Project Overview Title of Project:: Electronic Shop Management System
20 pages