Advertisement
ak02

pfa

May 15th, 2021
1,254
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 6.94 KB | None | 0 0
  1. -- phpMyAdmin SQL Dump
  2. -- version 5.1.0
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Hôte : localhost
  6. -- Généré le : sam. 15 mai 2021 à 19:52
  7. -- Version du serveur :  8.0.25
  8. -- Version de PHP : 8.0.3
  9.  
  10. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  11. START TRANSACTION;
  12. SET time_zone = "+00:00";
  13.  
  14.  
  15. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  16. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  17. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  18. /*!40101 SET NAMES utf8mb4 */;
  19.  
  20. --
  21. -- Base de données : `pfa`
  22. --
  23.  
  24. -- --------------------------------------------------------
  25.  
  26. --
  27. -- Structure de la table `abonne`
  28. --
  29.  
  30. CREATE TABLE `abonne` (
  31.   `num_abonne` int NOT NULL,
  32.   `nom` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  33.   `prenom` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  34.   `naissance` datetime NOT NULL,
  35.   `email` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  36.   `pays` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  37.   `ville` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  38.   `login` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  39.   `pass` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL
  40. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  41.  
  42. -- --------------------------------------------------------
  43.  
  44. --
  45. -- Structure de la table `bon_commande`
  46. --
  47.  
  48. CREATE TABLE `bon_commande` (
  49.   `num_boncommande` int NOT NULL,
  50.   `date_boncommande` datetime NOT NULL
  51. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  52.  
  53. -- --------------------------------------------------------
  54.  
  55. --
  56. -- Structure de la table `bon_livraison`
  57. --
  58.  
  59. CREATE TABLE `bon_livraison` (
  60.   `num_bonlivraison` int NOT NULL,
  61.   `date_bonlivraison` datetime NOT NULL
  62. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  63.  
  64. -- --------------------------------------------------------
  65.  
  66. --
  67. -- Structure de la table `categorie`
  68. --
  69.  
  70. CREATE TABLE `categorie` (
  71.   `id` int NOT NULL,
  72.   `nom_categorie` varchar(200) CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci NOT NULL,
  73.   `slug` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL
  74. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  75.  
  76. -- --------------------------------------------------------
  77.  
  78. --
  79. -- Structure de la table `categorie_poisson`
  80. --
  81.  
  82. CREATE TABLE `categorie_poisson` (
  83.   `id_poisson` int NOT NULL,
  84.   `id_categorie` int NOT NULL
  85. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  86.  
  87. -- --------------------------------------------------------
  88.  
  89. --
  90. -- Structure de la table `client`
  91. --
  92.  
  93. CREATE TABLE `client` (
  94.   `num_client` int NOT NULL,
  95.   `nom` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  96.   `prenom` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  97.   `telephone` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  98.   `email` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  99.   `adresse` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  100.   `ville` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL
  101. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  102.  
  103. -- --------------------------------------------------------
  104.  
  105. --
  106. -- Structure de la table `facturation`
  107. --
  108.  
  109. CREATE TABLE `facturation` (
  110.   `num_facturation` int NOT NULL,
  111.   `id_poisson` int NOT NULL,
  112.   `qte_facturee` int NOT NULL
  113. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  114.  
  115. -- --------------------------------------------------------
  116.  
  117. --
  118. -- Structure de la table `facture`
  119. --
  120.  
  121. CREATE TABLE `facture` (
  122.   `num_fact` int NOT NULL,
  123.   `date` datetime NOT NULL
  124. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  125.  
  126. -- --------------------------------------------------------
  127.  
  128. --
  129. -- Structure de la table `poisson`
  130. --
  131.  
  132. CREATE TABLE `poisson` (
  133.   `id_poisson` int NOT NULL,
  134.   `nom_poisson` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  135.   `prix` double NOT NULL
  136. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  137.  
  138. --
  139. -- Index pour les tables déchargées
  140. --
  141.  
  142. --
  143. -- Index pour la table `abonne`
  144. --
  145. ALTER TABLE `abonne`
  146.   ADD PRIMARY KEY (`num_abonne`);
  147.  
  148. --
  149. -- Index pour la table `bon_commande`
  150. --
  151. ALTER TABLE `bon_commande`
  152.   ADD PRIMARY KEY (`num_boncommande`);
  153.  
  154. --
  155. -- Index pour la table `bon_livraison`
  156. --
  157. ALTER TABLE `bon_livraison`
  158.   ADD PRIMARY KEY (`num_bonlivraison`);
  159.  
  160. --
  161. -- Index pour la table `categorie`
  162. --
  163. ALTER TABLE `categorie`
  164.   ADD PRIMARY KEY (`id`);
  165.  
  166. --
  167. -- Index pour la table `categorie_poisson`
  168. --
  169. ALTER TABLE `categorie_poisson`
  170.   ADD PRIMARY KEY (`id_poisson`,`id_categorie`),
  171.   ADD KEY `fk_categorie` (`id_categorie`);
  172.  
  173. --
  174. -- Index pour la table `client`
  175. --
  176. ALTER TABLE `client`
  177.   ADD PRIMARY KEY (`num_client`);
  178.  
  179. --
  180. -- Index pour la table `facturation`
  181. --
  182. ALTER TABLE `facturation`
  183.   ADD PRIMARY KEY (`num_facturation`,`id_poisson`),
  184.   ADD KEY `fk_poisson` (`id_poisson`);
  185.  
  186. --
  187. -- Index pour la table `facture`
  188. --
  189. ALTER TABLE `facture`
  190.   ADD PRIMARY KEY (`num_fact`);
  191.  
  192. --
  193. -- Index pour la table `poisson`
  194. --
  195. ALTER TABLE `poisson`
  196.   ADD PRIMARY KEY (`id_poisson`);
  197.  
  198. --
  199. -- AUTO_INCREMENT pour les tables déchargées
  200. --
  201.  
  202. --
  203. -- AUTO_INCREMENT pour la table `abonne`
  204. --
  205. ALTER TABLE `abonne`
  206.   MODIFY `num_abonne` int NOT NULL AUTO_INCREMENT;
  207.  
  208. --
  209. -- AUTO_INCREMENT pour la table `bon_commande`
  210. --
  211. ALTER TABLE `bon_commande`
  212.   MODIFY `num_boncommande` int NOT NULL AUTO_INCREMENT;
  213.  
  214. --
  215. -- AUTO_INCREMENT pour la table `bon_livraison`
  216. --
  217. ALTER TABLE `bon_livraison`
  218.   MODIFY `num_bonlivraison` int NOT NULL AUTO_INCREMENT;
  219.  
  220. --
  221. -- AUTO_INCREMENT pour la table `categorie`
  222. --
  223. ALTER TABLE `categorie`
  224.   MODIFY `id` int NOT NULL AUTO_INCREMENT;
  225.  
  226. --
  227. -- AUTO_INCREMENT pour la table `client`
  228. --
  229. ALTER TABLE `client`
  230.   MODIFY `num_client` int NOT NULL AUTO_INCREMENT;
  231.  
  232. --
  233. -- AUTO_INCREMENT pour la table `facture`
  234. --
  235. ALTER TABLE `facture`
  236.   MODIFY `num_fact` int NOT NULL AUTO_INCREMENT;
  237.  
  238. --
  239. -- AUTO_INCREMENT pour la table `poisson`
  240. --
  241. ALTER TABLE `poisson`
  242.   MODIFY `id_poisson` int NOT NULL AUTO_INCREMENT;
  243.  
  244. --
  245. -- Contraintes pour les tables déchargées
  246. --
  247.  
  248. --
  249. -- Contraintes pour la table `categorie_poisson`
  250. --
  251. ALTER TABLE `categorie_poisson`
  252.   ADD CONSTRAINT `fk_categorie` FOREIGN KEY (`id_categorie`) REFERENCES `categorie` (`id`) ON DELETE CASCADE ON UPDATE RESTRICT,
  253.   ADD CONSTRAINT `fk_poisson_cat` FOREIGN KEY (`id_poisson`) REFERENCES `poisson` (`id_poisson`) ON DELETE CASCADE ON UPDATE RESTRICT;
  254.  
  255. --
  256. -- Contraintes pour la table `facturation`
  257. --
  258. ALTER TABLE `facturation`
  259.   ADD CONSTRAINT `fk_facturation` FOREIGN KEY (`num_facturation`) REFERENCES `facture` (`num_fact`) ON DELETE CASCADE ON UPDATE RESTRICT,
  260.   ADD CONSTRAINT `fk_poisson` FOREIGN KEY (`id_poisson`) REFERENCES `poisson` (`id_poisson`) ON DELETE CASCADE ON UPDATE RESTRICT;
  261. COMMIT;
  262.  
  263. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  264. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  265. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  266.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement