Advertisement
ak02

database_pfa

May 15th, 2021
1,090
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
MySQL 5.48 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 à 14:30
  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 `client`
  68. --
  69.  
  70. CREATE TABLE `client` (
  71.   `num_client` int NOT NULL,
  72.   `nom` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  73.   `prenom` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  74.   `telephone` varchar(60) COLLATE utf8mb4_unicode_ci NOT NULL,
  75.   `email` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  76.   `adresse` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL,
  77.   `ville` varchar(200) COLLATE utf8mb4_unicode_ci NOT NULL
  78. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  79.  
  80. -- --------------------------------------------------------
  81.  
  82. --
  83. -- Structure de la table `facturation`
  84. --
  85.  
  86. CREATE TABLE `facturation` (
  87.   `num_facturation` int NOT NULL,
  88.   `id_poisson` int NOT NULL,
  89.   `qte_facturee` int NOT NULL
  90. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  91.  
  92. -- --------------------------------------------------------
  93.  
  94. --
  95. -- Structure de la table `facture`
  96. --
  97.  
  98. CREATE TABLE `facture` (
  99.   `num_fact` int NOT NULL,
  100.   `date` datetime NOT NULL
  101. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  102.  
  103. -- --------------------------------------------------------
  104.  
  105. --
  106. -- Structure de la table `poisson`
  107. --
  108.  
  109. CREATE TABLE `poisson` (
  110.   `id_poisson` int NOT NULL,
  111.   `prix` double NOT NULL
  112. ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
  113.  
  114. --
  115. -- Index pour les tables déchargées
  116. --
  117.  
  118. --
  119. -- Index pour la table `abonne`
  120. --
  121. ALTER TABLE `abonne`
  122.   ADD PRIMARY KEY (`num_abonne`);
  123.  
  124. --
  125. -- Index pour la table `bon_commande`
  126. --
  127. ALTER TABLE `bon_commande`
  128.   ADD PRIMARY KEY (`num_boncommande`);
  129.  
  130. --
  131. -- Index pour la table `bon_livraison`
  132. --
  133. ALTER TABLE `bon_livraison`
  134.   ADD PRIMARY KEY (`num_bonlivraison`);
  135.  
  136. --
  137. -- Index pour la table `client`
  138. --
  139. ALTER TABLE `client`
  140.   ADD PRIMARY KEY (`num_client`);
  141.  
  142. --
  143. -- Index pour la table `facturation`
  144. --
  145. ALTER TABLE `facturation`
  146.   ADD PRIMARY KEY (`num_facturation`,`id_poisson`),
  147.   ADD KEY `fk_poisson` (`id_poisson`);
  148.  
  149. --
  150. -- Index pour la table `facture`
  151. --
  152. ALTER TABLE `facture`
  153.   ADD PRIMARY KEY (`num_fact`);
  154.  
  155. --
  156. -- Index pour la table `poisson`
  157. --
  158. ALTER TABLE `poisson`
  159.   ADD PRIMARY KEY (`id_poisson`);
  160.  
  161. --
  162. -- AUTO_INCREMENT pour les tables déchargées
  163. --
  164.  
  165. --
  166. -- AUTO_INCREMENT pour la table `abonne`
  167. --
  168. ALTER TABLE `abonne`
  169.   MODIFY `num_abonne` int NOT NULL AUTO_INCREMENT;
  170.  
  171. --
  172. -- AUTO_INCREMENT pour la table `bon_commande`
  173. --
  174. ALTER TABLE `bon_commande`
  175.   MODIFY `num_boncommande` int NOT NULL AUTO_INCREMENT;
  176.  
  177. --
  178. -- AUTO_INCREMENT pour la table `bon_livraison`
  179. --
  180. ALTER TABLE `bon_livraison`
  181.   MODIFY `num_bonlivraison` int NOT NULL AUTO_INCREMENT;
  182.  
  183. --
  184. -- AUTO_INCREMENT pour la table `client`
  185. --
  186. ALTER TABLE `client`
  187.   MODIFY `num_client` int NOT NULL AUTO_INCREMENT;
  188.  
  189. --
  190. -- AUTO_INCREMENT pour la table `facture`
  191. --
  192. ALTER TABLE `facture`
  193.   MODIFY `num_fact` int NOT NULL AUTO_INCREMENT;
  194.  
  195. --
  196. -- AUTO_INCREMENT pour la table `poisson`
  197. --
  198. ALTER TABLE `poisson`
  199.   MODIFY `id_poisson` int NOT NULL AUTO_INCREMENT;
  200.  
  201. --
  202. -- Contraintes pour les tables déchargées
  203. --
  204.  
  205. --
  206. -- Contraintes pour la table `facturation`
  207. --
  208. ALTER TABLE `facturation`
  209.   ADD CONSTRAINT `fk_facturation` FOREIGN KEY (`num_facturation`) REFERENCES `facture` (`num_fact`) ON DELETE CASCADE ON UPDATE RESTRICT,
  210.   ADD CONSTRAINT `fk_poisson` FOREIGN KEY (`id_poisson`) REFERENCES `poisson` (`id_poisson`) ON DELETE CASCADE ON UPDATE RESTRICT;
  211. COMMIT;
  212.  
  213. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  214. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  215. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
  216.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement