PageRenderTime 27ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/Base de donnee/ecommerce.sql

https://gitlab.com/thoussem/Tunisie-Shop
SQL | 147 lines | 81 code | 24 blank | 42 comment | 0 complexity | 12d5e2a2d2191b57c5e0428ea54d5b4c MD5 | raw file
  1. -- phpMyAdmin SQL Dump
  2. -- version 4.1.14
  3. -- http://www.phpmyadmin.net
  4. --
  5. -- Client : 127.0.0.1
  6. -- Généré le : Mer 20 Mai 2015 à 02:07
  7. -- Version du serveur : 5.6.17
  8. -- Version de PHP : 5.5.12
  9. SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";
  10. SET time_zone = "+00:00";
  11. /*!40101 SET @OLD_CHARACTER_SET_CLIENT=@@CHARACTER_SET_CLIENT */;
  12. /*!40101 SET @OLD_CHARACTER_SET_RESULTS=@@CHARACTER_SET_RESULTS */;
  13. /*!40101 SET @OLD_COLLATION_CONNECTION=@@COLLATION_CONNECTION */;
  14. /*!40101 SET NAMES utf8 */;
  15. --
  16. -- Base de données : `ecommerce`
  17. --
  18. -- --------------------------------------------------------
  19. --
  20. -- Structure de la table `articles`
  21. --
  22. CREATE TABLE IF NOT EXISTS `articles` (
  23. `id` int(11) NOT NULL AUTO_INCREMENT,
  24. `nom` varchar(90) NOT NULL,
  25. `prix` decimal(10,0) NOT NULL,
  26. `srcimg` varchar(300) NOT NULL,
  27. `description` varchar(300) NOT NULL,
  28. `vedette` tinyint(1) NOT NULL,
  29. `type` varchar(4) NOT NULL,
  30. `idcateg` int(11) NOT NULL,
  31. PRIMARY KEY (`id`)
  32. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=16 ;
  33. --
  34. -- Contenu de la table `articles`
  35. --
  36. INSERT INTO `articles` (`id`, `nom`, `prix`, `srcimg`, `description`, `vedette`, `type`, `idcateg`) VALUES
  37. (1, 'Radiohead Pocket', '99', '197762_mrp_in_l1.jpg', '', 1, 'h', 0),
  38. (2, 'Cafe Racer Jacket', '389', '340809_mrp_in_l.jpg', '', 1, 'h', 0),
  39. (3, 'Rough Sunset Jacket', '123', '196623_mrp_in_l.jpg', '', 1, '', 0),
  40. (4, 'Red Garage', '83', '340332_mrp_in_l.jpg', '', 1, '', 0),
  41. (5, 'Shirt With Attributes', '56', '328390_mrp_in_l.jpg', '', 1, '', 0),
  42. (6, 'Simple Kinky Shirt', '98', '194809_mrp_in_l.jpg', '', 1, '', 0),
  43. (7, 'Blues Denim', '10', '340333_mrp_in_l.jpg', '', 0, '', 0),
  44. (8, 'Cafe Racer Jacket', '300', '340809_mrp_in_l.jpg', '', 0, '', 0),
  45. (9, 'Leather Sling Track', '112', '311772_mrp_in_l.jpg', '', 0, '', 0),
  46. (10, 'Mahogany Footprint', '79', '328427_mrp_e1_l.jpg', '', 0, '', 0),
  47. (11, 'Moscot Crowbar', '259', '343841_mrp_in_l.jpg', '', 0, '', 0),
  48. (12, 'Radiohead Pocket', '99', '197762_mrp_in_l1.jpg', '', 0, '', 0),
  49. (13, 'Red Garage', '83', '340332_mrp_in_l.jpg', '', 0, '', 0),
  50. (14, 'Ripped Jeans', '169', '341243_mrp_in_l.jpg', '', 0, '', 0),
  51. (15, '196623_mrp_in_l.jpg', '123', 'Rough Sunset Jacket', '', 0, '', 0);
  52. -- --------------------------------------------------------
  53. --
  54. -- Structure de la table `categorie`
  55. --
  56. CREATE TABLE IF NOT EXISTS `categorie` (
  57. `id` int(11) NOT NULL AUTO_INCREMENT,
  58. `libelle` varchar(11) NOT NULL,
  59. `idarticle` int(11) NOT NULL,
  60. PRIMARY KEY (`id`),
  61. KEY `fk_arti` (`idarticle`)
  62. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=1 ;
  63. -- --------------------------------------------------------
  64. --
  65. -- Structure de la table `couleurs`
  66. --
  67. CREATE TABLE IF NOT EXISTS `couleurs` (
  68. `idarticle` int(11) NOT NULL,
  69. `couleur` varchar(30) NOT NULL,
  70. `imgcouleur` varchar(60) NOT NULL,
  71. PRIMARY KEY (`idarticle`,`couleur`)
  72. ) ENGINE=InnoDB DEFAULT CHARSET=latin1;
  73. -- --------------------------------------------------------
  74. --
  75. -- Structure de la table `utilisateurs`
  76. --
  77. CREATE TABLE IF NOT EXISTS `utilisateurs` (
  78. `id` int(6) NOT NULL AUTO_INCREMENT,
  79. `username` varchar(30) NOT NULL,
  80. `nom` varchar(30) NOT NULL DEFAULT '',
  81. `prenom` varchar(30) DEFAULT NULL,
  82. `titre` varchar(30) NOT NULL,
  83. `email` varchar(50) NOT NULL,
  84. `password` varchar(30) NOT NULL,
  85. `tel` int(8) NOT NULL,
  86. `ville` varchar(20) NOT NULL,
  87. `codpost` int(6) NOT NULL,
  88. `codtel` int(3) NOT NULL,
  89. `adresse1` varchar(70) NOT NULL,
  90. `adresse2` varchar(60) NOT NULL,
  91. PRIMARY KEY (`id`),
  92. UNIQUE KEY `id` (`id`),
  93. UNIQUE KEY `email` (`email`),
  94. UNIQUE KEY `email_2` (`email`),
  95. UNIQUE KEY `username` (`username`),
  96. UNIQUE KEY `email_3` (`email`),
  97. UNIQUE KEY `email_4` (`email`),
  98. UNIQUE KEY `email_5` (`email`),
  99. UNIQUE KEY `email_6` (`email`),
  100. UNIQUE KEY `email_7` (`email`),
  101. FULLTEXT KEY `password` (`password`)
  102. ) ENGINE=InnoDB DEFAULT CHARSET=latin1 AUTO_INCREMENT=38 ;
  103. --
  104. -- Contenu de la table `utilisateurs`
  105. --
  106. INSERT INTO `utilisateurs` (`id`, `username`, `nom`, `prenom`, `titre`, `email`, `password`, `tel`, `ville`, `codpost`, `codtel`, `adresse1`, `adresse2`) VALUES
  107. (37, 't.houssem', 'Trabelsi', 'Houssem', 'mr', 't.houssemg@gmail.com', '123456', 0, '', 0, 0, '', '');
  108. --
  109. -- Contraintes pour les tables exportées
  110. --
  111. --
  112. -- Contraintes pour la table `categorie`
  113. --
  114. ALTER TABLE `categorie`
  115. ADD CONSTRAINT `fk_arti` FOREIGN KEY (`idarticle`) REFERENCES `articles` (`id`);
  116. --
  117. -- Contraintes pour la table `couleurs`
  118. --
  119. ALTER TABLE `couleurs`
  120. ADD CONSTRAINT `fk_col_article` FOREIGN KEY (`idarticle`) REFERENCES `articles` (`id`);
  121. /*!40101 SET CHARACTER_SET_CLIENT=@OLD_CHARACTER_SET_CLIENT */;
  122. /*!40101 SET CHARACTER_SET_RESULTS=@OLD_CHARACTER_SET_RESULTS */;
  123. /*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;