SHARE
TWEET

ma page internet ( sql )

a guest May 19th, 2019 61 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. -- --------------------------------------------------------
  2.  
  3. --
  4. -- Structure de la table `type`
  5. --
  6.  
  7.  
  8. CREATE TABLE TYPE
  9. (
  10.   TypeCode INT(11),
  11.   Nom VARCHAR(11) NOT NULL,
  12.   PRIMARY KEY (TypeCode)
  13. )
  14.  
  15. ENGINE=InnoDB;
  16.  
  17.  
  18.  
  19.  
  20. CREATE TABLE categorie
  21. (
  22.   CodeCategorie INT(5),
  23.   Nom VARCHAR(50) NOT NULL,
  24.   TypeCode INT(50) NOT NULL,
  25.   PRIMARY KEY (CodeCategorie),
  26.   FOREIGN KEY (TypeCode) REFERENCES TYPE(TypeCode)
  27. )
  28.  
  29. ENGINE=InnoDB;
  30.  
  31. -- --------------------------------------------------------
  32.  
  33. --
  34. -- Structure de la table `produit`
  35. --
  36.  
  37. CREATE TABLE produit
  38. (
  39.   REF INT(11),
  40.   Nom VARCHAR(50) NOT NULL,
  41.   Marque VARCHAR(50) NOT NULL,
  42.   Prix DECIMAL(6,2) NOT NULL,
  43.   Description VARCHAR(250) NOT NULL,
  44.   Garantie CHAR(5) NOT NULL,
  45.   CodeCategorie INT(5) NOT NULL,
  46.   PRIMARY KEY (REF),
  47.   FOREIGN KEY (CodeCategorie) REFERENCES categorie(CodeCategorie)
  48. )
  49.  
  50. ENGINE=InnoDB;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top