1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43
|
--
-- Structure de la table `categorie`
--
CREATE TABLE IF NOT EXISTS `categorie` (
`id_categorie` tinyint(4) NOT NULL AUTO_INCREMENT,
`logo_categ` varchar(30) NULL,
`nom_categorie` varchar(50) NOT NULL ,
`intro_categorie` text NULL,
CONSTRAINT PK_CATEGORIE PRIMARY KEY (`id_categorie`)
) ENGINE = innodb;
--
-- Structure de la table `sscategorie`
--
CREATE TABLE IF NOT EXISTS `sscategorie` (
`id_sscategorie` tinyint(5) NOT NULL AUTO_INCREMENT,
`nom_sscategorie` varchar(25) NOT NULL,
`categorie_id` tinyint(4) NOT NULL,
CONSTRAINT PK_SSCATEGORIE PRIMARY KEY(id_sscategorie),
CONSTRAINT FK_SSCATEGORIE_CATEGORIE FOREIGN KEY (categorie_id) REFERENCES categorie(id_categorie)
) ENGINE = innodb;
--
-- Structure de la table `article`
--
CREATE TABLE IF NOT EXISTS `article` (
`id_article` tinyint(5) NOT NULL AUTO_INCREMENT,
`reference` varchar(10) NOT NULL,
`nom_article` varchar(50) NOT NULL,
`prix_article` decimal(5,2) NOT NULL default '0.00',
`definition_article` text NOT NULL,
`photo_article` varchar(50) NULL,
`sscategorie_id` tinyint(5) NOT NULL,
CONSTRAINT PK_ARTICLE PRIMARY KEY (`reference`),
CONSTRAINT FK_ARTICLE_SSCATEGORIE FOREIGN KEY (id_article) REFERENCES sscategorie(id_sscategorie)
) ENGINE = innodb; |
Partager