Mécanique
Chronologie : Mécanique. Recherche parmi 300 000+ dissertationsPar Ibra Tall • 14 Mars 2019 • Chronologie • 503 Mots (3 Pages) • 475 Vues
CREATE DATABASE `dbannonce` /*!40100 DEFAULT CHARACTER SET latin1 */;
DROP TABLE IF EXISTS `dbannonce`.`categorie_user`;
CREATE TABLE `dbannonce`.`categorie_user` (
`IdCat` int(10) unsigned NOT NULL,
`Categorie` varchar(45) NOT NULL,
PRIMARY KEY (`IdCat`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
Insert Into dbannonce.categorie_user values(1,'Administrateur');
Insert Into dbannonce.categorie_user values(2,'Utilisateur');
DROP TABLE IF EXISTS `dbannonce`.`user`;
CREATE TABLE `dbannonce`.`user` (
`IdUser` int(10) unsigned NOT NULL auto_increment,
`IdCat` int(10) unsigned NOT NULL,
`Nom` varchar(45) NOT NULL,
`Prenom` varchar(45) NOT NULL,
`NumTel` varchar(45) NOT NULL,
`Adresse` varchar(45) NOT NULL,
`Email` varchar(45) NOT NULL,
`Ville` varchar(45) NOT NULL,
`Region` varchar(45) NOT NULL,
`Pays` varchar(45) NOT NULL,
`Sexe` varchar(45) NOT NULL,
`UserName` varchar(45) NOT NULL,
`Password` varchar(45) NOT NULL,
PRIMARY KEY (`IdUser`),
KEY `FK_user_1` (`IdCat`),
CONSTRAINT `FK_user_1` FOREIGN KEY (`IdCat`) REFERENCES `categorie_user` (`IdCat`)
) ENGINE=InnoDB AUTO_INCREMENT=13 DEFAULT CHARSET=latin1;
Insert Into dbannonce.user (IdCat,Nom,Prenom,NumTel,Adresse,Email,Ville,Region,Pays,Sexe,UserName,Password) values (1,'DAHMANI','Tarik','0676608454','Lot Ennajd', 'tarik.dahmani87@gmail.com','Khenifra','Meknes-Tafilalet','Maroc','Homme','admin','admin');
DROP TABLE IF EXISTS `dbannonce`.`annonce`;
CREATE TABLE `dbannonce`.`annonce` (
`IdAnnonce` int(10) unsigned NOT NULL auto_increment,
`IdUser` int(10) unsigned NOT NULL,
`TitreAnnonce` varchar(45) NOT NULL,
`DateAnnonce` varchar(45) NOT NULL,
PRIMARY KEY (`IdAnnonce`),
KEY `FK_annonce_1` (`IdUser`),
CONSTRAINT `FK_annonce_1` FOREIGN KEY (`IdUser`) REFERENCES `user` (`IdUser`)
) ENGINE=InnoDB AUTO_INCREMENT=68 DEFAULT CHARSET=latin1;
DROP TABLE IF EXISTS `dbannonce`.`autres`;
CREATE TABLE `dbannonce`.`autres` (
`IdAutres` int(10) unsigned NOT NULL auto_increment,
`TypeA` varchar(45) NOT NULL,
`IdAnnonce` int(10) unsigned NOT NULL,
`TxtA` varchar(500) NOT NULL,
PRIMARY KEY USING BTREE (`IdAutres`),
KEY `FK_autres_1` (`IdAnnonce`),
...