Run Code
|
Code Wall
|
Users
|
Misc
|
Feedback
|
About
|
Login
|
Theme
|
Privacy
Mjk
Language:
Ada
Assembly
Bash
C#
C++ (gcc)
C++ (clang)
C++ (vc++)
C (gcc)
C (clang)
C (vc)
Client Side
Common Lisp
D
Elixir
Erlang
F#
Fortran
Go
Haskell
Java
Javascript
Kotlin
Lua
MySql
Node.js
Ocaml
Octave
Objective-C
Oracle
Pascal
Perl
Php
PostgreSQL
Prolog
Python
Python 3
R
Ruby
Scala
Scheme
Sql Server
Swift
Tcl
Visual Basic
Layout:
Vertical
Horizontal
--Sql Server 2014 Express Edition --Batches are separated by 'go' -- phpMyAdmin SQL Dump -- version 4.6.5.2 -- https://www.phpmyadmin.net/ -- -- Host: 127.0.0.1 -- Generation Time: Aug 24, 2017 at 09:43 AM -- Server version: 10.1.21-MariaDB -- PHP Version: 7.0.15 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET time_zone = "+00:00"; /*!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 */; /*!40101 SET NAMES utf8mb4 */; -- -- Database: `shopping cart` -- -- -------------------------------------------------------- -- -- Table structure for table `customer` -- CREATE TABLE `customer` ( `customer_id` int(77) NOT NULL, `customer_name` varchar(65) NOT NULL, `phone_no` varchar(500) NOT NULL, `email` varchar(87) NOT NULL, `address` varchar(97) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `customer` -- INSERT INTO `customer` (`customer_id`, `customer_name`, `phone_no`, `email`, `address`) VALUES (1, 'amna', '03456785345', 'amnarehman@gmail.com', '232 b block model town'), (2, 'maryam', '03457867543', 'maryamshabbir123@gmail.com', '345 h block defence'), (3, 'simran', '03452349876', 'simransaleem223@hotmail.com', 'maraghzar lahore'), (4, 'nooha', '03214536987', 'nohashafiq@ymail.com', '216 n block gulshan ravi'), (5, 'rida', '03456745345', 'ridaahmad@gmail.com', '234 c block '), (6, 'fatima', '03215609456', 'fatimakhalid123@hotmail.com', 'ichra lahore'), (7, 'ayesha', '03472837456', 'ayesha23@gmail.com', '234 n block sabzazar'), (8, 'amber', '03456723123', 'amberriaz@hotmail.com', '213 samanzar '), (9, 'laiba', '02347845634', 'laibaayub123@gmail.com', '213 b block chauburji'), (10, 'sidra', '02345698765', 'sidraarshad34@hotmail.com', 'saroba garden'); -- -------------------------------------------------------- -- -- Table structure for table `order detail` -- CREATE TABLE `order detail` ( `packing_date` date NOT NULL, `packing_cost` int(58) NOT NULL, `orderdetail_id` int(22) NOT NULL, `order_id` int(12) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `order detail` -- INSERT INTO `order detail` (`packing_date`, `packing_cost`, `orderdetail_id`, `order_id`) VALUES ('2017-08-02', 1000, 1, 1), ('2017-08-10', 1200, 2, 2), ('2017-08-03', 1100, 3, 3), ('2017-08-11', 1207, 4, 4), ('2017-08-09', 230, 5, 5), ('2017-08-16', 400, 6, 6), ('2017-08-26', 4556, 7, 7), ('2017-08-18', 8999, 8, 8), ('2017-08-08', 2500, 9, 9), ('2017-08-09', 1500, 10, 10); -- -------------------------------------------------------- -- -- Table structure for table `orders` -- CREATE TABLE `orders` ( `order_id` int(11) NOT NULL, `cart_id` int(111) NOT NULL, `order_status` varchar(22) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `orders` -- INSERT INTO `orders` (`order_id`, `cart_id`, `order_status`) VALUES (1, 1, 'ordered'), (2, 2, 'ordered'), (3, 3, 'ordered'), (4, 4, 'ordered'), (5, 5, 'ordered'), (6, 6, 'ordered'), (7, 7, 'ordered'), (8, 8, 'ordered'), (9, 9, 'ordered'), (10, 10, 'ordered'); -- -------------------------------------------------------- -- -- Table structure for table `payment` -- CREATE TABLE `payment` ( `payment_id` int(23) NOT NULL, `payment_cost` int(58) NOT NULL, `order_complete` varchar(87) NOT NULL, `order_id` int(44) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `payment` -- INSERT INTO `payment` (`payment_id`, `payment_cost`, `order_complete`, `order_id`) VALUES (1, 5600, 'completed', 1), (2, 4500, 'not completed', 2), (3, 6700, 'completed', 3), (4, 2300, 'in proccess', 4), (5, 3400, 'in proccess', 5), (6, 5500, 'completed', 6), (7, 4400, 'in proccess', 7), (8, 3400, 'inproccess', 8), (9, 2300, 'completed', 9), (10, 213, 'completed', 10); -- -------------------------------------------------------- -- -- Table structure for table `payment way` -- CREATE TABLE `payment way` ( `paymentway_id` int(23) NOT NULL, `method` varchar(57) NOT NULL, `payment_id` int(22) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `payment way` -- INSERT INTO `payment way` (`paymentway_id`, `method`, `payment_id`) VALUES (1, 'paypall', 1), (2, 'easy paisa', 2), (3, 'credit', 3), (4, 'cash', 4), (5, 'credit', 5), (6, 'paypall', 6), (7, 'cash', 7), (8, 'paypall', 8), (9, 'cash', 9), (10, 'easy paisa', 10); -- -------------------------------------------------------- -- -- Table structure for table `product` -- CREATE TABLE `product` ( `product_id` int(12) NOT NULL, `product_name` varchar(50) NOT NULL, `product_price` int(50) NOT NULL, `description` varchar(500) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `product` -- INSERT INTO `product` (`product_id`, `product_name`, `product_price`, `description`) VALUES (1, 'mobile', 2500, '8MP camera'), (2, 'camera', 10000, 'good quality'), (3, 'watch', 2000, 'big dice'), (4, 'handsfree', 300, 'best voice'), (5, 'bed', 30000, 'wood in best quality'), (6, 'laptop', 35000, 'cheap laptop'), (7, 'braccelet', 2500, 'precious'), (8, 'juicer', 1500, 'low price'), (9, 'microwave', 2000, 'good performance'), (10, 'rings', 300, 'unique'); -- -------------------------------------------------------- -- -- Table structure for table `product category` -- CREATE TABLE `product category` ( `category_id` int(55) NOT NULL, `category_name` varchar(55) NOT NULL, `product_id` int(55) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `product category` -- INSERT INTO `product category` (`category_id`, `category_name`, `product_id`) VALUES (1, 'electronics', 1), (2, 'electronics', 2), (3, 'electronics', 3), (4, 'electronics', 4), (5, 'furniture', 5), (6, 'electronics', 6), (7, 'jewellery', 7), (8, 'kitchen item', 8), (9, 'electronics', 9), (10, 'jewellery', 10); -- -------------------------------------------------------- -- -- Table structure for table `product stock` -- CREATE TABLE `product stock` ( `stock_id` int(56) NOT NULL, `product_id` int(57) NOT NULL, `stock_quantity` int(58) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `product stock` -- INSERT INTO `product stock` (`stock_id`, `product_id`, `stock_quantity`) VALUES (1, 1, 600), (2, 2, 800), (3, 4, 400), (4, 4, 500), (5, 5, 100), (6, 6, 50), (7, 7, 23), (8, 8, 460), (9, 9, 129), (10, 10, 60); -- -------------------------------------------------------- -- -- Table structure for table `shipping` -- CREATE TABLE `shipping` ( `shippind_id` int(54) NOT NULL, `shipping_cost` int(76) NOT NULL, `payment_id` int(54) NOT NULL, `deliver date` date NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `shipping` -- INSERT INTO `shipping` (`shippind_id`, `shipping_cost`, `payment_id`, `deliver date`) VALUES (1, 300, 1, '2017-08-01'), (2, 250, 2, '2017-08-02'), (3, 100, 3, '2017-08-30'), (4, 230, 4, '2017-08-09'), (5, 120, 5, '2017-08-10'), (6, 230, 6, '2017-08-11'), (7, 150, 7, '2017-08-31'), (8, 340, 8, '2017-08-15'), (9, 100, 9, '2017-08-22'), (10, 230, 10, '2017-08-02'); -- -------------------------------------------------------- -- -- Table structure for table `shopping cart` -- CREATE TABLE `shopping cart` ( `cart_id` int(55) NOT NULL, `item quantity` int(65) NOT NULL, `total cost` int(55) NOT NULL, `product_id` int(11) NOT NULL, `customer_id` int(34) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Dumping data for table `shopping cart` -- INSERT INTO `shopping cart` (`cart_id`, `item quantity`, `total cost`, `product_id`, `customer_id`) VALUES (1, 2, 50000, 1, 1), (2, 1, 8000, 2, 2), (3, 4, 40000, 3, 3), (4, 4, 3000, 4, 4), (5, 10, 1000, 5, 5), (6, 5, 5600, 6, 6), (7, 12, 34000, 7, 7), (8, 9, 2900, 8, 8), (9, 3, 2200, 9, 9), (10, 15, 30000, 10, 10); -- -- Indexes for dumped tables -- -- -- Indexes for table `customer` -- ALTER TABLE `customer` ADD PRIMARY KEY (`customer_id`), ADD UNIQUE KEY `email` (`email`); -- -- Indexes for table `order detail` -- ALTER TABLE `order detail` ADD PRIMARY KEY (`orderdetail_id`), ADD KEY `order_id` (`order_id`); -- -- Indexes for table `orders` -- ALTER TABLE `orders` ADD PRIMARY KEY (`order_id`), ADD KEY `cart_id` (`cart_id`); -- -- Indexes for table `payment` -- ALTER TABLE `payment` ADD PRIMARY KEY (`payment_id`), ADD KEY `payment_ibfk_1` (`order_id`); -- -- Indexes for table `payment way` -- ALTER TABLE `payment way` ADD PRIMARY KEY (`paymentway_id`), ADD KEY `payment_id` (`payment_id`); -- -- Indexes for table `product` -- ALTER TABLE `product` ADD PRIMARY KEY (`product_id`); -- -- Indexes for table `product category` -- ALTER TABLE `product category` ADD PRIMARY KEY (`category_id`), ADD KEY `product_id` (`product_id`); -- -- Indexes for table `product stock` -- ALTER TABLE `product stock` ADD PRIMARY KEY (`stock_id`), ADD KEY `product_id` (`product_id`); -- -- Indexes for table `shipping` -- ALTER TABLE `shipping` ADD PRIMARY KEY (`shippind_id`), ADD KEY `payment_id` (`payment_id`); -- -- Indexes for table `shopping cart` -- ALTER TABLE `shopping cart` ADD PRIMARY KEY (`cart_id`), ADD KEY `customer_id` (`customer_id`), ADD KEY `customer_id_2` (`customer_id`); -- -- AUTO_INCREMENT for dumped tables -- -- -- AUTO_INCREMENT for table `orders` -- ALTER TABLE `orders` MODIFY `order_id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `payment` -- ALTER TABLE `payment` MODIFY `payment_id` int(23) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `payment way` -- ALTER TABLE `payment way` MODIFY `paymentway_id` int(23) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `product stock` -- ALTER TABLE `product stock` MODIFY `stock_id` int(56) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- AUTO_INCREMENT for table `shipping` -- ALTER TABLE `shipping` MODIFY `shippind_id` int(54) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=11; -- -- Constraints for dumped tables -- -- -- Constraints for table `order detail` -- ALTER TABLE `order detail` ADD CONSTRAINT `order detail_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`order_id`); -- -- Constraints for table `orders` -- ALTER TABLE `orders` ADD CONSTRAINT `orders_ibfk_1` FOREIGN KEY (`cart_id`) REFERENCES `shopping cart` (`cart_id`); -- -- Constraints for table `payment` -- ALTER TABLE `payment` ADD CONSTRAINT `payment_ibfk_1` FOREIGN KEY (`order_id`) REFERENCES `orders` (`order_id`); -- -- Constraints for table `payment way` -- ALTER TABLE `payment way` ADD CONSTRAINT `payment way_ibfk_1` FOREIGN KEY (`payment_id`) REFERENCES `payment` (`payment_id`); -- -- Constraints for table `product category` -- ALTER TABLE `product category` ADD CONSTRAINT `product category_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `product` (`product_id`); -- -- Constraints for table `product stock` -- ALTER TABLE `product stock` ADD CONSTRAINT `product stock_ibfk_1` FOREIGN KEY (`product_id`) REFERENCES `product` (`product_id`); -- -- Constraints for table `shipping` -- ALTER TABLE `shipping` ADD CONSTRAINT `shipping_ibfk_1` FOREIGN KEY (`payment_id`) REFERENCES `payment` (`payment_id`); -- -- Constraints for table `shopping cart` -- ALTER TABLE `shopping cart` ADD CONSTRAINT `shopping cart_ibfk_1` FOREIGN KEY (`customer_id`) REFERENCES `customer` (`customer_id`); /*!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 */;
View schema
Tiempo de servicio absoluto: 0,17 seg, tiempo de servicio absoluto: 0,18 seg.
fork mode
|
history
|
discussion
Error(s), warning(s):
Sintaxis incorrecta cerca de '='.