Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
mrgzmerch
-- phpMyAdmin SQL Dump -- version 3.3.9 -- http://www.phpmyadmin.net -- -- Host: localhost -- Generation Time: Jun 28, 2019 at 04:12 PM -- Server version: 5.5.8 -- PHP Version: 5.3.5 SET SQL_MODE="NO_AUTO_VALUE_ON_ZERO"; /*!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 utf8 */; -- -- Database: `mrgzmerch` -- -- -------------------------------------------------------- -- -- Table structure for table `clientes` -- CREATE TABLE IF NOT EXISTS `clientes` ( `Username` varchar(45) NOT NULL, `Email` varchar(45) NOT NULL, `NomeCliente` varchar(80) NOT NULL, `Password` varchar(80) NOT NULL, `RuaCliente` varchar(45) DEFAULT NULL, `TelefoneCliente` int(9) DEFAULT NULL, `CodPostal` varchar(45) NOT NULL, `Contribuinte` int(9) DEFAULT NULL, `Sexo` varchar(1) NOT NULL, PRIMARY KEY (`Username`), UNIQUE KEY `Email` (`Email`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `clientes` -- INSERT INTO `clientes` (`Username`, `Email`, `NomeCliente`, `Password`, `RuaCliente`, `TelefoneCliente`, `CodPostal`, `Contribuinte`, `Sexo`) VALUES ('morgas', 'bro_nq06@outlook.pt', 'Diogo Morgado', 'morgas061124', 'Rua EU', 938103738, '1170-392', 267494963, 'M'), ('xico', 'xicomanga@gmail.com', 'Francisco', '321', 'Rua LVC', 999888777, '1111222', 963258741, 'M'); -- -------------------------------------------------------- -- -- Table structure for table `compras` -- CREATE TABLE IF NOT EXISTS `compras` ( `CodCompra` int(11) NOT NULL AUTO_INCREMENT, `DataDeCompra` date NOT NULL, `TotalCompra` int(11) NOT NULL, `Username` varchar(45) NOT NULL, PRIMARY KEY (`CodCompra`), KEY `Username_idx` (`Username`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=27 ; -- -- Dumping data for table `compras` -- INSERT INTO `compras` (`CodCompra`, `DataDeCompra`, `TotalCompra`, `Username`) VALUES (1, '2019-02-04', 35, 'morgas'), (2, '2019-02-05', 30, 'morgas'), (3, '2019-02-09', 35, 'morgas'), (4, '2019-02-09', 35, 'morgas'), (5, '2019-02-09', 35, 'morgas'), (6, '2019-02-12', 35, 'morgas'), (7, '2019-06-18', 20, 'morgas'), (8, '2019-06-18', 35, 'morgas'), (9, '2019-06-18', 35, 'morgas'), (10, '2019-06-18', 45, 'morgas'), (11, '2019-06-18', 35, 'morgas'), (12, '2019-06-20', 35, 'morgas'), (13, '2019-06-23', 50, 'morgas'), (14, '2019-06-24', 35, 'morgas'), (15, '2019-06-26', 35, 'morgas'), (16, '2019-06-26', 35, 'morgas'), (17, '2019-06-26', 35, 'morgas'), (18, '2019-06-26', 35, 'morgas'), (19, '2019-06-26', 35, 'morgas'), (20, '2019-06-26', 35, 'morgas'), (21, '2019-06-26', 35, 'morgas'), (22, '2019-06-26', 35, 'morgas'), (23, '2019-06-26', 35, 'morgas'), (24, '2019-06-26', 45, 'morgas'), (25, '2019-06-26', 35, 'morgas'), (26, '2019-06-26', 35, 'morgas'); -- -------------------------------------------------------- -- -- Table structure for table `comprasprodutos` -- CREATE TABLE IF NOT EXISTS `comprasprodutos` ( `CodProduto` int(11) NOT NULL, `CodCompra` int(11) NOT NULL, `Quantidade` int(11) NOT NULL, PRIMARY KEY (`CodProduto`,`CodCompra`), KEY `CodCompra` (`CodCompra`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `comprasprodutos` -- -- -------------------------------------------------------- -- -- Table structure for table `produtos` -- CREATE TABLE IF NOT EXISTS `produtos` ( `CodProduto` int(11) NOT NULL AUTO_INCREMENT, `Tamanho` varchar(3) DEFAULT NULL, `PrecoUnitario` int(11) DEFAULT NULL, `Cor` varchar(45) DEFAULT NULL, `Descricao` varchar(45) DEFAULT NULL, `CodTipoProduto` int(11) NOT NULL, `Imagens` varchar(256) DEFAULT NULL, `Stock` int(11) NOT NULL, PRIMARY KEY (`CodProduto`), KEY `fk_Produtos_TipoProdutos1_idx` (`CodTipoProduto`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=19 ; -- -- Dumping data for table `produtos` -- INSERT INTO `produtos` (`CodProduto`, `Tamanho`, `PrecoUnitario`, `Cor`, `Descricao`, `CodTipoProduto`, `Imagens`, `Stock`) VALUES (1, 'S', 35, 'Branca', 'T-Shirt', 2, 'DONEfrontmock1.png', -4), (2, 'XL', 45, 'Branco', 'T-Shirt', 2, 'DONEfrontmock2.png', 99), (3, 'S', 20, 'Verde', 'Sweatshirt', 2, 'DONEfrontmock3.png', 99), (4, 'XXL', 50, 'Branco', 'Sweatshirt', 1, 'sweatfrontmock1-1.png', 99), (5, 'S', 30, 'IOPUH', 'T-Shirt', 2, 'DONE2frontmock1.png', 100), (6, 'XXS', 100000, 'Branco', 'T-Shirt', 2, 'DONE2frontmock2.png', 100), (7, 'S', 45, 'Branco', 'T-Shirt', 2, 'DONE2frontmock3.png', 100), (8, 's', 234, 'wdawdad', 'T-Shirt', 2, 'DONE3frontmock1.png', 0), (9, 'd', 213, 'adwad', 'awaw', 2, 'DONE3frontmock2.png', 0), (10, 'a', 123, 'axa', 'dawdaw', 2, 'DONE3frontmock3.png', 0), (11, 'awa', 12312, 'awdawd', 'awdawd', 1, 'sweatfrontmock1-2.png', 0), (12, 'sa', 123, 'asda', 'awdawd', 1, 'sweatfrontmock1-3.png', 0), (13, 'AS', 21, 'AS', 'DWADA', 1, 'sweatfrontmock2-1.png', 0), (14, 'awd', 213, 'awdaw', 'awdaw', 1, 'sweatfrontmock2-2.png', 0), (15, 'awd', 1312, 'awdad', 'awdawdw', 1, 'sweatfrontmock2-3.png', 0), (16, 'awd', 123, 'awdaw', 'dawdawdaw', 1, 'sweatfrontmock3-1.png', 0), (17, 'awd', 2131, 'dawdaw', 'adawd', 1, 'sweatfrontmock3-2.png', 0), (18, 'daw', 213123, 'awda', 'wdawda', 1, 'sweatfrontmock3-3.png', 0); -- -------------------------------------------------------- -- -- Table structure for table `tipoprodutos` -- CREATE TABLE IF NOT EXISTS `tipoprodutos` ( `CodTipoProduto` int(11) NOT NULL, `Descricao` varchar(45) DEFAULT NULL, PRIMARY KEY (`CodTipoProduto`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8; -- -- Dumping data for table `tipoprodutos` -- INSERT INTO `tipoprodutos` (`CodTipoProduto`, `Descricao`) VALUES (1, 'Sweatshirt'), (2, 'T-Shirt'); -- -- Constraints for dumped tables -- -- -- Constraints for table `compras` -- ALTER TABLE `compras` ADD CONSTRAINT `Username` FOREIGN KEY (`Username`) REFERENCES `clientes` (`Username`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `comprasprodutos` -- ALTER TABLE `comprasprodutos` ADD CONSTRAINT `CodCompra` FOREIGN KEY (`CodCompra`) REFERENCES `compras` (`CodCompra`) ON DELETE NO ACTION ON UPDATE NO ACTION, ADD CONSTRAINT `CodProduto` FOREIGN KEY (`CodProduto`) REFERENCES `produtos` (`CodProduto`) ON DELETE NO ACTION ON UPDATE NO ACTION; -- -- Constraints for table `produtos` -- ALTER TABLE `produtos` ADD CONSTRAINT `fk_Produtos_TipoProdutos1` FOREIGN KEY (`CodTipoProduto`) REFERENCES `tipoprodutos` (`CodTipoProduto`) ON DELETE NO ACTION ON UPDATE NO ACTION;
run
|
edit
|
history
|
help
0
Srinivas
ITM_14210069
ruthresh
Srinivas
par
list with indented categories
PBD
Dynamic Pivot
NewQuery
daily score