Skip to content

Instantly share code, notes, and snippets.

@matarillo
Created May 30, 2020 13:11
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save matarillo/c22a19c5a80bf5a0fe2f9334edc9db9f to your computer and use it in GitHub Desktop.
Save matarillo/c22a19c5a80bf5a0fe2f9334edc9db9f to your computer and use it in GitHub Desktop.
-- MySQL dump 10.13 Distrib 8.0.20, for Win64 (x86_64)
--
-- Host: buster.mshome.net Database: wingtiptoys
-- ------------------------------------------------------
-- Server version 5.7.29
/*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
/*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
/*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
/*!50503 SET NAMES utf8mb4 */;
/*!40103 SET @OLD_TIME_ZONE=@@TIME_ZONE */;
/*!40103 SET TIME_ZONE='+00:00' */;
/*!40014 SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0 */;
/*!40014 SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0 */;
/*!40101 SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='NO_AUTO_VALUE_ON_ZERO' */;
/*!40111 SET @OLD_SQL_NOTES=@@SQL_NOTES, SQL_NOTES=0 */;
--
-- Table structure for table `cartitems`
--
DROP TABLE IF EXISTS `cartitems`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `cartitems` (
`ItemId` varchar(128) CHARACTER SET utf8 NOT NULL,
`CartId` longtext,
`Quantity` int(11) NOT NULL,
`DateCreated` datetime NOT NULL,
`ProductId` int(11) NOT NULL,
PRIMARY KEY (`ItemId`),
KEY `ProductId` (`ProductId`),
CONSTRAINT `CartItem_Product` FOREIGN KEY (`ProductId`) REFERENCES `products` (`ProductId`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `cartitems`
--
LOCK TABLES `cartitems` WRITE;
/*!40000 ALTER TABLE `cartitems` DISABLE KEYS */;
/*!40000 ALTER TABLE `cartitems` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `categories`
--
DROP TABLE IF EXISTS `categories`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `categories` (
`CategoryId` int(11) NOT NULL AUTO_INCREMENT,
`CategoryName` varchar(100) CHARACTER SET utf8 NOT NULL,
`Description` longtext,
PRIMARY KEY (`CategoryId`),
UNIQUE KEY `CategoryID` (`CategoryId`)
) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `categories`
--
LOCK TABLES `categories` WRITE;
/*!40000 ALTER TABLE `categories` DISABLE KEYS */;
INSERT INTO `categories` VALUES (1,'Cars',NULL),(2,'Planes',NULL),(3,'Trucks',NULL),(4,'Boats',NULL),(5,'Rockets',NULL);
/*!40000 ALTER TABLE `categories` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `orderdetails`
--
DROP TABLE IF EXISTS `orderdetails`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `orderdetails` (
`OrderDetailId` int(11) NOT NULL AUTO_INCREMENT,
`OrderId` int(11) NOT NULL,
`Username` longtext,
`ProductId` int(11) NOT NULL,
`Quantity` int(11) NOT NULL,
`UnitPrice` double DEFAULT NULL,
PRIMARY KEY (`OrderDetailId`),
UNIQUE KEY `OrderDetailId` (`OrderDetailId`),
KEY `OrderId` (`OrderId`),
CONSTRAINT `Order_OrderDetails` FOREIGN KEY (`OrderId`) REFERENCES `orders` (`OrderId`) ON DELETE CASCADE ON UPDATE NO ACTION
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `orderdetails`
--
LOCK TABLES `orderdetails` WRITE;
/*!40000 ALTER TABLE `orderdetails` DISABLE KEYS */;
/*!40000 ALTER TABLE `orderdetails` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `orders`
--
DROP TABLE IF EXISTS `orders`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `orders` (
`OrderId` int(11) NOT NULL AUTO_INCREMENT,
`OrderDate` datetime NOT NULL,
`Username` longtext,
`FirstName` varchar(160) CHARACTER SET utf8 NOT NULL,
`LastName` varchar(160) CHARACTER SET utf8 NOT NULL,
`Address` varchar(70) CHARACTER SET utf8 NOT NULL,
`City` varchar(40) CHARACTER SET utf8 NOT NULL,
`State` varchar(40) CHARACTER SET utf8 NOT NULL,
`PostalCode` varchar(10) CHARACTER SET utf8 NOT NULL,
`Country` varchar(40) CHARACTER SET utf8 NOT NULL,
`Phone` varchar(24) CHARACTER SET utf8 DEFAULT NULL,
`Email` longtext NOT NULL,
`Total` decimal(18,2) NOT NULL,
`PaymentTransactionId` longtext,
`HasBeenShipped` tinyint(1) NOT NULL,
PRIMARY KEY (`OrderId`),
UNIQUE KEY `OrderId` (`OrderId`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `orders`
--
LOCK TABLES `orders` WRITE;
/*!40000 ALTER TABLE `orders` DISABLE KEYS */;
/*!40000 ALTER TABLE `orders` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Table structure for table `products`
--
DROP TABLE IF EXISTS `products`;
/*!40101 SET @saved_cs_client = @@character_set_client */;
/*!50503 SET character_set_client = utf8mb4 */;
CREATE TABLE `products` (
`ProductId` int(11) NOT NULL AUTO_INCREMENT,
`ProductName` varchar(100) CHARACTER SET utf8 NOT NULL,
`Description` varchar(10000) CHARACTER SET utf8 NOT NULL,
`ImagePath` longtext,
`UnitPrice` double DEFAULT NULL,
`CategoryId` int(11) DEFAULT NULL,
PRIMARY KEY (`ProductId`),
UNIQUE KEY `ProductID` (`ProductId`),
KEY `CategoryID` (`CategoryId`),
CONSTRAINT `Product_Category` FOREIGN KEY (`CategoryId`) REFERENCES `categories` (`CategoryId`) ON DELETE NO ACTION ON UPDATE NO ACTION
) ENGINE=InnoDB AUTO_INCREMENT=17 DEFAULT CHARSET=latin1;
/*!40101 SET character_set_client = @saved_cs_client */;
--
-- Dumping data for table `products`
--
LOCK TABLES `products` WRITE;
/*!40000 ALTER TABLE `products` DISABLE KEYS */;
INSERT INTO `products` VALUES (1,'Convertible Car','This convertible car is fast! The engine is powered by a neutrino based battery (not included).Power it up and let it go!','carconvert.png',22.5,1),(2,'Old-time Car','There\'s nothing old about this toy car, except it\'s looks. Compatible with other old toy cars.','carearly.png',15.95,1),(3,'Fast Car','Yes this car is fast, but it also floats in water.','carfast.png',32.99,1),(4,'Super Fast Car','Use this super fast car to entertain guests. Lights and doors work!','carfaster.png',8.95,1),(5,'Old Style Racer','This old style racer can fly (with user assistance). Gravity controls flight duration.No batteries required.','carracer.png',34.95,1),(6,'Ace Plane','Authentic airplane toy. Features realistic color and details.','planeace.png',95,2),(7,'Glider','This fun glider is made from real balsa wood. Some assembly required.','planeglider.png',4.95,2),(8,'Paper Plane','This paper plane is like no other paper plane. Some folding required.','planepaper.png',2.95,2),(9,'Propeller Plane','Rubber band powered plane features two wheels.','planeprop.png',32.95,2),(10,'Early Truck','This toy truck has a real gas powered engine. Requires regular tune ups.','truckearly.png',15,3),(11,'Fire Truck','You will have endless fun with this one quarter sized fire truck.','truckfire.png',26,3),(12,'Big Truck','This fun toy truck can be used to tow other trucks that are not as big.','truckbig.png',29,3),(13,'Big Ship','Is it a boat or a ship. Let this floating vehicle decide by using its artifically intelligent computer brain!','boatbig.png',95,4),(14,'Paper Boat','Floating fun for all! This toy boat can be assembled in seconds. Floats for minutes!Some folding required.','boatpaper.png',4.95,4),(15,'Sail Boat','Put this fun toy sail boat in the water and let it go!','boatsail.png',42.95,4),(16,'Rocket','This fun rocket will travel up to a height of 200 feet.','rocket.png',122.95,5);
/*!40000 ALTER TABLE `products` ENABLE KEYS */;
UNLOCK TABLES;
--
-- Dumping routines for database 'wingtiptoys'
--
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
/*!40014 SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS */;
/*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
/*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
-- Dump completed on 2020-05-28 19:51:54
--
-- PostgreSQL database dump
--
-- Dumped from database version 10.13 (Debian 10.13-1.pgdg90+1)
-- Dumped by pg_dump version 12.2 (Ubuntu 12.2-4)
SET statement_timeout = 0;
SET lock_timeout = 0;
SET idle_in_transaction_session_timeout = 0;
SET client_encoding = 'UTF8';
SET standard_conforming_strings = on;
SELECT pg_catalog.set_config('search_path', '', false);
SET check_function_bodies = false;
SET xmloption = content;
SET client_min_messages = warning;
SET row_security = off;
SET default_tablespace = '';
--
-- Name: cartitems; Type: TABLE; Schema: public; Owner: wingtiptoys
--
CREATE TABLE public.cartitems (
"ItemId" character varying(128) NOT NULL,
"CartId" text,
"Quantity" integer NOT NULL,
"DateCreated" timestamp without time zone NOT NULL,
"ProductId" integer NOT NULL
);
ALTER TABLE public.cartitems OWNER TO wingtiptoys;
--
-- Name: categories; Type: TABLE; Schema: public; Owner: wingtiptoys
--
CREATE TABLE public.categories (
"CategoryId" integer NOT NULL,
"CategoryName" character varying(100) NOT NULL,
"Description" text
);
ALTER TABLE public.categories OWNER TO wingtiptoys;
--
-- Name: orderdetails; Type: TABLE; Schema: public; Owner: wingtiptoys
--
CREATE TABLE public.orderdetails (
"OrderDetailId" integer NOT NULL,
"OrderId" integer NOT NULL,
"Username" text,
"ProductId" integer NOT NULL,
"Quantity" integer NOT NULL,
"UnitPrice" numeric(10,2)
);
ALTER TABLE public.orderdetails OWNER TO wingtiptoys;
--
-- Name: orderdetails_OrderDetailId_seq; Type: SEQUENCE; Schema: public; Owner: wingtiptoys
--
CREATE SEQUENCE public."orderdetails_OrderDetailId_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."orderdetails_OrderDetailId_seq" OWNER TO wingtiptoys;
--
-- Name: orderdetails_OrderDetailId_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: wingtiptoys
--
ALTER SEQUENCE public."orderdetails_OrderDetailId_seq" OWNED BY public.orderdetails."OrderDetailId";
--
-- Name: orders; Type: TABLE; Schema: public; Owner: wingtiptoys
--
CREATE TABLE public.orders (
"OrderId" integer NOT NULL,
"OrderDate" timestamp without time zone NOT NULL,
"Username" text,
"FirstName" character varying(160) NOT NULL,
"LastName" character varying(160) NOT NULL,
"Address" character varying(70) NOT NULL,
"City" character varying(40) NOT NULL,
"State" character varying(40) NOT NULL,
"PostalCode" character varying(10) NOT NULL,
"Country" character varying(40) NOT NULL,
"Phone" character varying(24),
"Email" text NOT NULL,
"Total" numeric(18,2) NOT NULL,
"PaymentTransactionId" text,
"HasBeenShipped" boolean NOT NULL
);
ALTER TABLE public.orders OWNER TO wingtiptoys;
--
-- Name: orders_OrderId_seq; Type: SEQUENCE; Schema: public; Owner: wingtiptoys
--
CREATE SEQUENCE public."orders_OrderId_seq"
AS integer
START WITH 1
INCREMENT BY 1
NO MINVALUE
NO MAXVALUE
CACHE 1;
ALTER TABLE public."orders_OrderId_seq" OWNER TO wingtiptoys;
--
-- Name: orders_OrderId_seq; Type: SEQUENCE OWNED BY; Schema: public; Owner: wingtiptoys
--
ALTER SEQUENCE public."orders_OrderId_seq" OWNED BY public.orders."OrderId";
--
-- Name: products; Type: TABLE; Schema: public; Owner: wingtiptoys
--
CREATE TABLE public.products (
"ProductId" integer NOT NULL,
"ProductName" character varying(100) NOT NULL,
"Description" character varying(1000) NOT NULL,
"ImagePath" text,
"UnitPrice" numeric(10,2),
"CategoryId" integer
);
ALTER TABLE public.products OWNER TO wingtiptoys;
--
-- Name: orderdetails OrderDetailId; Type: DEFAULT; Schema: public; Owner: wingtiptoys
--
ALTER TABLE ONLY public.orderdetails ALTER COLUMN "OrderDetailId" SET DEFAULT nextval('public."orderdetails_OrderDetailId_seq"'::regclass);
--
-- Name: orders OrderId; Type: DEFAULT; Schema: public; Owner: wingtiptoys
--
ALTER TABLE ONLY public.orders ALTER COLUMN "OrderId" SET DEFAULT nextval('public."orders_OrderId_seq"'::regclass);
--
-- Data for Name: cartitems; Type: TABLE DATA; Schema: public; Owner: wingtiptoys
--
COPY public.cartitems ("ItemId", "CartId", "Quantity", "DateCreated", "ProductId") FROM stdin;
\.
--
-- Data for Name: categories; Type: TABLE DATA; Schema: public; Owner: wingtiptoys
--
COPY public.categories ("CategoryId", "CategoryName", "Description") FROM stdin;
1 Cars \N
2 Planes \N
3 Trucks \N
4 Boats \N
5 Rockets \N
\.
--
-- Data for Name: orderdetails; Type: TABLE DATA; Schema: public; Owner: wingtiptoys
--
COPY public.orderdetails ("OrderDetailId", "OrderId", "Username", "ProductId", "Quantity", "UnitPrice") FROM stdin;
\.
--
-- Data for Name: orders; Type: TABLE DATA; Schema: public; Owner: wingtiptoys
--
COPY public.orders ("OrderId", "OrderDate", "Username", "FirstName", "LastName", "Address", "City", "State", "PostalCode", "Country", "Phone", "Email", "Total", "PaymentTransactionId", "HasBeenShipped") FROM stdin;
\.
--
-- Data for Name: products; Type: TABLE DATA; Schema: public; Owner: wingtiptoys
--
COPY public.products ("ProductId", "ProductName", "Description", "ImagePath", "UnitPrice", "CategoryId") FROM stdin;
1 Convertible Car This convertible car is fast! The engine is powered by a neutrino based battery (not included).Power it up and let it go! carconvert.png 22.50 1
2 Old-time Car There's nothing old about this toy car, except it's looks. Compatible with other old toy cars. carearly.png 15.95 1
3 Fast Car Yes this car is fast, but it also floats in water. carfast.png 32.99 1
4 Super Fast Car Use this super fast car to entertain guests. Lights and doors work! carfaster.png 8.95 1
5 Old Style Racer This old style racer can fly (with user assistance). Gravity controls flight duration.No batteries required. carracer.png 34.95 1
6 Ace Plane Authentic airplane toy. Features realistic color and details. planeace.png 95.00 2
7 Glider This fun glider is made from real balsa wood. Some assembly required. planeglider.png 4.95 2
8 Paper Plane This paper plane is like no other paper plane. Some folding required. planepaper.png 2.95 2
9 Propeller Plane Rubber band powered plane features two wheels. planeprop.png 32.95 2
10 Early Truck This toy truck has a real gas powered engine. Requires regular tune ups. truckearly.png 15.00 3
11 Fire Truck You will have endless fun with this one quarter sized fire truck. truckfire.png 26.00 3
12 Big Truck This fun toy truck can be used to tow other trucks that are not as big. truckbig.png 29.00 3
13 Big Ship Is it a boat or a ship. Let this floating vehicle decide by using its artifically intelligent computer brain! boatbig.png 95.00 4
14 Paper Boat Floating fun for all! This toy boat can be assembled in seconds. Floats for minutes!Some folding required. boatpaper.png 4.95 4
15 Sail Boat Put this fun toy sail boat in the water and let it go! boatsail.png 42.95 4
16 Rocket This fun rocket will travel up to a height of 200 feet. rocket.png 122.95 5
\.
--
-- Name: orderdetails_OrderDetailId_seq; Type: SEQUENCE SET; Schema: public; Owner: wingtiptoys
--
SELECT pg_catalog.setval('public."orderdetails_OrderDetailId_seq"', 1, false);
--
-- Name: orders_OrderId_seq; Type: SEQUENCE SET; Schema: public; Owner: wingtiptoys
--
SELECT pg_catalog.setval('public."orders_OrderId_seq"', 1, false);
--
-- Name: cartitems cartitems_pkey; Type: CONSTRAINT; Schema: public; Owner: wingtiptoys
--
ALTER TABLE ONLY public.cartitems
ADD CONSTRAINT cartitems_pkey PRIMARY KEY ("ItemId");
--
-- Name: categories categories_pkey; Type: CONSTRAINT; Schema: public; Owner: wingtiptoys
--
ALTER TABLE ONLY public.categories
ADD CONSTRAINT categories_pkey PRIMARY KEY ("CategoryId");
--
-- Name: orderdetails orderdetails_pkey; Type: CONSTRAINT; Schema: public; Owner: wingtiptoys
--
ALTER TABLE ONLY public.orderdetails
ADD CONSTRAINT orderdetails_pkey PRIMARY KEY ("OrderDetailId");
--
-- Name: orders orders_pkey; Type: CONSTRAINT; Schema: public; Owner: wingtiptoys
--
ALTER TABLE ONLY public.orders
ADD CONSTRAINT orders_pkey PRIMARY KEY ("OrderId");
--
-- Name: products products_pkey; Type: CONSTRAINT; Schema: public; Owner: wingtiptoys
--
ALTER TABLE ONLY public.products
ADD CONSTRAINT products_pkey PRIMARY KEY ("ProductId");
--
-- Name: cartitems CartItem_Product; Type: FK CONSTRAINT; Schema: public; Owner: wingtiptoys
--
ALTER TABLE ONLY public.cartitems
ADD CONSTRAINT "CartItem_Product" FOREIGN KEY ("ProductId") REFERENCES public.products("ProductId");
--
-- Name: orderdetails Order_OrderDetails; Type: FK CONSTRAINT; Schema: public; Owner: wingtiptoys
--
ALTER TABLE ONLY public.orderdetails
ADD CONSTRAINT "Order_OrderDetails" FOREIGN KEY ("OrderId") REFERENCES public.orders("OrderId") ON DELETE CASCADE;
--
-- Name: products Product_Category; Type: FK CONSTRAINT; Schema: public; Owner: wingtiptoys
--
ALTER TABLE ONLY public.products
ADD CONSTRAINT "Product_Category" FOREIGN KEY ("CategoryId") REFERENCES public.categories("CategoryId");
--
-- PostgreSQL database dump complete
--
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[Categories] (
[CategoryID] INT IDENTITY (1, 1) NOT NULL,
[CategoryName] NVARCHAR (100) NOT NULL,
[Description] NVARCHAR (MAX) NULL
);
GO
CREATE TABLE [dbo].[Products] (
[ProductID] INT IDENTITY (1, 1) NOT NULL,
[ProductName] NVARCHAR (100) NOT NULL,
[Description] NVARCHAR (MAX) NOT NULL,
[ImagePath] NVARCHAR (MAX) NULL,
[UnitPrice] FLOAT (53) NULL,
[CategoryID] INT NULL
);
GO
CREATE NONCLUSTERED INDEX [IX_CategoryID]
ON [dbo].[Products]([CategoryID] ASC);
GO
ALTER TABLE [dbo].[Products]
ADD CONSTRAINT [PK_dbo.Products] PRIMARY KEY CLUSTERED ([ProductID] ASC);
GO
ALTER TABLE [dbo].[Products]
ADD CONSTRAINT [FK_dbo.Products_dbo.Categories_CategoryID] FOREIGN KEY ([CategoryID]) REFERENCES [dbo].[Categories] ([CategoryID]);
GO
CREATE TABLE [dbo].[CartItems] (
[ItemId] NVARCHAR (128) NOT NULL,
[CartId] NVARCHAR (MAX) NULL,
[Quantity] INT NOT NULL,
[DateCreated] DATETIME NOT NULL,
[ProductId] INT NOT NULL
);
GO
CREATE NONCLUSTERED INDEX [IX_ProductId]
ON [dbo].[CartItems]([ProductId] ASC);
GO
ALTER TABLE [dbo].[CartItems]
ADD CONSTRAINT [PK_dbo.CartItems] PRIMARY KEY CLUSTERED ([ItemId] ASC);
GO
ALTER TABLE [dbo].[CartItems]
ADD CONSTRAINT [FK_dbo.CartItems_dbo.Products_ProductId] FOREIGN KEY ([ProductId]) REFERENCES [dbo].[Products] ([ProductID]) ON DELETE CASCADE;
GO
CREATE TABLE [dbo].[Orders] (
[OrderId] INT IDENTITY (1, 1) NOT NULL,
[OrderDate] DATETIME NOT NULL,
[Username] NVARCHAR (MAX) NULL,
[FirstName] NVARCHAR (160) NOT NULL,
[LastName] NVARCHAR (160) NOT NULL,
[Address] NVARCHAR (70) NOT NULL,
[City] NVARCHAR (40) NOT NULL,
[State] NVARCHAR (40) NOT NULL,
[PostalCode] NVARCHAR (10) NOT NULL,
[Country] NVARCHAR (40) NOT NULL,
[Phone] NVARCHAR (24) NULL,
[Email] NVARCHAR (MAX) NOT NULL,
[Total] DECIMAL (18, 2) NOT NULL,
[PaymentTransactionId] NVARCHAR (MAX) NULL,
[HasBeenShipped] BIT NOT NULL
);
GO
CREATE TABLE [dbo].[OrderDetails] (
[OrderDetailId] INT IDENTITY (1, 1) NOT NULL,
[OrderId] INT NOT NULL,
[Username] NVARCHAR (MAX) NULL,
[ProductId] INT NOT NULL,
[Quantity] INT NOT NULL,
[UnitPrice] FLOAT (53) NULL
);
GO
CREATE NONCLUSTERED INDEX [IX_OrderId]
ON [dbo].[OrderDetails]([OrderId] ASC);
GO
ALTER TABLE [dbo].[OrderDetails]
ADD CONSTRAINT [PK_dbo.OrderDetails] PRIMARY KEY CLUSTERED ([OrderDetailId] ASC);
GO
ALTER TABLE [dbo].[OrderDetails]
ADD CONSTRAINT [FK_dbo.OrderDetails_dbo.Orders_OrderId] FOREIGN KEY ([OrderId]) REFERENCES [dbo].[Orders] ([OrderId]) ON DELETE CASCADE;
GO
SET IDENTITY_INSERT [dbo].[Categories] ON
INSERT INTO [dbo].[Categories] ([CategoryID], [CategoryName], [Description]) VALUES (1, N'Cars', NULL)
INSERT INTO [dbo].[Categories] ([CategoryID], [CategoryName], [Description]) VALUES (2, N'Planes', NULL)
INSERT INTO [dbo].[Categories] ([CategoryID], [CategoryName], [Description]) VALUES (3, N'Trucks', NULL)
INSERT INTO [dbo].[Categories] ([CategoryID], [CategoryName], [Description]) VALUES (4, N'Boats', NULL)
INSERT INTO [dbo].[Categories] ([CategoryID], [CategoryName], [Description]) VALUES (5, N'Rockets', NULL)
SET IDENTITY_INSERT [dbo].[Categories] OFF
GO
SET IDENTITY_INSERT [dbo].[Products] ON
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (1, N'Convertible Car', N'This convertible car is fast! The engine is powered by a neutrino based battery (not included).Power it up and let it go!', N'carconvert.png', 22.5, 1)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (2, N'Old-time Car', N'There''s nothing old about this toy car, except it''s looks. Compatible with other old toy cars.', N'carearly.png', 15.95, 1)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (3, N'Fast Car', N'Yes this car is fast, but it also floats in water.', N'carfast.png', 32.99, 1)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (4, N'Super Fast Car', N'Use this super fast car to entertain guests. Lights and doors work!', N'carfaster.png', 8.95, 1)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (5, N'Old Style Racer', N'This old style racer can fly (with user assistance). Gravity controls flight duration.No batteries required.', N'carracer.png', 34.95, 1)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (6, N'Ace Plane', N'Authentic airplane toy. Features realistic color and details.', N'planeace.png', 95, 2)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (7, N'Glider', N'This fun glider is made from real balsa wood. Some assembly required.', N'planeglider.png', 4.95, 2)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (8, N'Paper Plane', N'This paper plane is like no other paper plane. Some folding required.', N'planepaper.png', 2.95, 2)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (9, N'Propeller Plane', N'Rubber band powered plane features two wheels.', N'planeprop.png', 32.95, 2)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (10, N'Early Truck', N'This toy truck has a real gas powered engine. Requires regular tune ups.', N'truckearly.png', 15, 3)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (11, N'Fire Truck', N'You will have endless fun with this one quarter sized fire truck.', N'truckfire.png', 26, 3)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (12, N'Big Truck', N'This fun toy truck can be used to tow other trucks that are not as big.', N'truckbig.png', 29, 3)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (13, N'Big Ship', N'Is it a boat or a ship. Let this floating vehicle decide by using its artifically intelligent computer brain!', N'boatbig.png', 95, 4)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (14, N'Paper Boat', N'Floating fun for all! This toy boat can be assembled in seconds. Floats for minutes!Some folding required.', N'boatpaper.png', 4.95, 4)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (15, N'Sail Boat', N'Put this fun toy sail boat in the water and let it go!', N'boatsail.png', 42.95, 4)
INSERT INTO [dbo].[Products] ([ProductID], [ProductName], [Description], [ImagePath], [UnitPrice], [CategoryID]) VALUES (16, N'Rocket', N'This fun rocket will travel up to a height of 200 feet.', N'rocket.png', 122.95, 5)
SET IDENTITY_INSERT [dbo].[Products] OFF
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment