Advertisement
Guest User

Untitled

a guest
Oct 19th, 2018
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.52 KB | None | 0 0
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.7.2
  3. -- https://www.phpmyadmin.net/
  4. --
  5. -- Hôte : localhost:8889
  6. -- Généré le : ven. 19 oct. 2018 à 09:45
  7. -- Version du serveur : 5.6.35
  8. -- Version de PHP : 7.1.6
  9.  
  10. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  11. SET time_zone = "+00:00";
  12.  
  13. --
  14. -- Base de données : `Caisse`
  15. --
  16.  
  17. -- --------------------------------------------------------
  18.  
  19. --
  20. -- Structure de la table `contenir`
  21. --
  22.  
  23.  
  24. CREATE TABLE `contenir` (
  25. `id` int(11) NOT NULL,
  26. `id_Produit` int(11) NOT NULL,
  27. `nombre` int(11) NOT NULL
  28. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  29.  
  30. -- --------------------------------------------------------
  31.  
  32. --
  33. -- Structure de la table `Panier`
  34. --
  35.  
  36. CREATE TABLE `Panier` (
  37. `id` int(11) NOT NULL,
  38. `date` date NOT NULL,
  39. `typeReglement` int(11) NOT NULL
  40. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  41.  
  42. -- --------------------------------------------------------
  43.  
  44. --
  45. -- Structure de la table `Produit`
  46. --
  47.  
  48. CREATE TABLE `Produit` (
  49. `id` int(11) NOT NULL,
  50. `prix` float NOT NULL,
  51. `nom` varchar(255) NOT NULL,
  52. `ref` varchar(255) DEFAULT NULL,
  53. `id_tva` int(11) NOT NULL
  54. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  55.  
  56. -- --------------------------------------------------------
  57.  
  58. --
  59. -- Structure de la table `tva`
  60. --
  61.  
  62. CREATE TABLE `tva` (
  63. `id` int(11) NOT NULL,
  64. `nom` varchar(255) NOT NULL,
  65. `taux` float NOT NULL
  66. ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
  67.  
  68. --
  69. -- Déchargement des données de la table `tva`
  70. --
  71.  
  72. INSERT INTO `tva` (`id`, `nom`, `taux`) VALUES
  73. (0, 'std', 20),
  74. (1, 'emp', 5.5),
  75. (2, 'spe', 14.6);
  76.  
  77. --
  78. -- Index pour les tables déchargées
  79. --
  80.  
  81. --
  82. -- Index pour la table `contenir`
  83. --
  84. ALTER TABLE `contenir`
  85. ADD PRIMARY KEY (`id`,`id_Produit`),
  86. ADD KEY `contenir_Produit0_FK` (`id_Produit`);
  87.  
  88. --
  89. -- Index pour la table `Panier`
  90. --
  91. ALTER TABLE `Panier`
  92. ADD PRIMARY KEY (`id`);
  93.  
  94. --
  95. -- Index pour la table `Produit`
  96. --
  97. ALTER TABLE `Produit`
  98. ADD PRIMARY KEY (`id`),
  99. ADD KEY `Produit_tva_FK` (`id_tva`);
  100.  
  101. --
  102. -- Index pour la table `tva`
  103. --
  104. ALTER TABLE `tva`
  105. ADD PRIMARY KEY (`id`);
  106.  
  107. --
  108. -- Contraintes pour les tables déchargées
  109. --
  110.  
  111. --
  112. -- Contraintes pour la table `contenir`
  113. --
  114. ALTER TABLE `contenir`
  115. ADD CONSTRAINT `contenir_Panier_FK` FOREIGN KEY (`id`) REFERENCES `Panier` (`id`),
  116. ADD CONSTRAINT `contenir_Produit0_FK` FOREIGN KEY (`id_Produit`) REFERENCES `Produit` (`id`);
  117.  
  118. --
  119. -- Contraintes pour la table `Produit`
  120. --
  121. ALTER TABLE `Produit`
  122. ADD CONSTRAINT `Produit_tva_FK` FOREIGN KEY (`id_tva`) REFERENCES `tva` (`id`);
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement