-- Mazouz Abdelkarim -- -- phpMyAdmin SQL Dump -- version 4.7.9 -- https://www.phpmyadmin.net/ -- -- Host: mysql-karimovic.alwaysdata.net -- Generation Time: Nov 29, 2019 at 09:07 PM -- Server version: 10.3.17-MariaDB -- PHP Version: 7.2.9 SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"; SET AUTOCOMMIT = 0; START TRANSACTION; 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: `karimovic_gtr2020` -- CREATE DATABASE IF NOT EXISTS `karimovic_gtr2020` DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci; USE `karimovic_gtr2020`; -- -------------------------------------------------------- -- -- Table structure for table `client` -- CREATE TABLE `client` ( `codecl` varchar(4) NOT NULL, `Nom` varchar(20) NOT NULL, `adresse` varchar(40) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `commande` -- CREATE TABLE `commande` ( `numc` int(3) NOT NULL, `datec` date NOT NULL, `codecl` varchar(4) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `detail` -- CREATE TABLE `detail` ( `nump` int(2) NOT NULL, `numc` int(3) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -------------------------------------------------------- -- -- Table structure for table `produit` -- CREATE TABLE `produit` ( `nump` int(2) NOT NULL, `lebelle` int(20) NOT NULL, `prixp` int(6) NOT NULL, `quadispo` int(3) NOT NULL ) ENGINE=InnoDB DEFAULT CHARSET=latin1; -- -- Indexes for dumped tables -- -- -- Indexes for table `client` -- ALTER TABLE `client` ADD PRIMARY KEY (`codecl`); -- -- Indexes for table `commande` -- ALTER TABLE `commande` ADD PRIMARY KEY (`numc`), ADD KEY `codecl` (`codecl`); -- -- Indexes for table `detail` -- ALTER TABLE `detail` ADD KEY `numc` (`numc`), ADD KEY `nump` (`nump`); -- -- Indexes for table `produit` -- ALTER TABLE `produit` ADD PRIMARY KEY (`nump`); -- -- Constraints for dumped tables -- -- -- Constraints for table `commande` -- ALTER TABLE `commande` ADD CONSTRAINT `commande_ibfk_1` FOREIGN KEY (`codecl`) REFERENCES `client` (`codecl`); -- -- Constraints for table `detail` -- ALTER TABLE `detail` ADD CONSTRAINT `detail_ibfk_1` FOREIGN KEY (`numc`) REFERENCES `commande` (`numc`), ADD CONSTRAINT `detail_ibfk_2` FOREIGN KEY (`nump`) REFERENCES `produit` (`nump`); COMMIT; /*!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 */;