SHARE
TWEET

Untitled

a guest Jan 24th, 2020 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE CLIENT(code INT AUTO_INCREMENT,
  2. nom VARCHAR(50),
  3. prenom VARCHAR(50),
  4. adresse VARCHAR(50),
  5. ville VARCHAR(50),
  6. pays VARCHAR(50),
  7. PRIMARY KEY(code));
  8.  
  9. CREATE TABLE ModeEnvoie(code INT AUTO_INCREMENT,
  10. libelle VARCHAR(50),
  11. tarif VARCHAR(50),
  12. PRIMARY KEY(code));
  13.  
  14. CREATE TABLE Pays(code INT AUTO_INCREMENT,
  15. nom VARCHAR(50),
  16. tarif int,
  17. PRIMARY KEY(code));
  18.  
  19. CREATE TABLE Employes(code INT AUTO_INCREMENT,
  20. nom VARCHAR(50),
  21. prenom VARCHAR(50),
  22. PRIMARY KEY(code));
  23.  
  24. CREATE TABLE TypeEmballage(code INT AUTO_INCREMENT,
  25. libelle VARCHAR(50),
  26. tarif int,
  27. PRIMARY KEY(code));
  28.  
  29. CREATE TABLE Ville(code INT AUTO_INCREMENT,
  30. nom VARCHAR(50),
  31. codePays int,
  32. PRIMARY KEY(code),
  33. CONSTRAINT FK_codePays FOREIGN KEY (codePays) REFERENCES Pays(code));
  34.  
  35. CREATE TABLE Vol(numero VARCHAR(50),
  36. codeVilleDepart int,
  37. codeVilleArrivee int,
  38. CONSTRAINT FK_codeVilleDepart FOREIGN KEY (codeVilleDepart) REFERENCES Pays(code),
  39. CONSTRAINT FK_codeVilleArrivee FOREIGN KEY (codeVilleArrivee) REFERENCES Pays(code),
  40. PRIMARY KEY(numero));
  41.  
  42. CREATE TABLE produit(numero VARCHAR(50),
  43. destinataire VARCHAR(50),
  44. dateEnregistrement VARCHAR(50),
  45. codeTypeEmballage int,
  46. codeModeEnvoie int,
  47. codeClient int,
  48. codeVille int,
  49. codeEmployes int,
  50. CONSTRAINT FK_codeTypeEmballage FOREIGN KEY (codeTypeEmballage) REFERENCES TypeEmballage(code),
  51. CONSTRAINT FK_codeModeEnvoie FOREIGN KEY (codeModeEnvoie) REFERENCES ModeEnvoie(code),
  52. CONSTRAINT FK_codeClient FOREIGN KEY (codeClient) REFERENCES Client(code),
  53. CONSTRAINT FK_codeVille FOREIGN KEY (codeVille) REFERENCES Ville(code),
  54. CONSTRAINT FK_codeEmployes FOREIGN KEY (codeEmployes) REFERENCES Employes(code),
  55. PRIMARY KEY(numero));
  56.  
  57. CREATE TABLE Livraison(numero VARCHAR(50),
  58. dateRdv Date,
  59. datePassage Date,
  60. nomRéceptionneur VARCHAR(50),
  61. etat VARCHAR(50),
  62. codeVilleDepart int,
  63. codeVilleArrivee int,
  64. CONSTRAINT FK_codeVilleDepart FOREIGN KEY (codeVilleDepart) REFERENCES Pays(code),
  65. CONSTRAINT FK_codeVilleArrivee FOREIGN KEY (codeVilleArrivee) REFERENCES Pays(code),
  66. PRIMARY KEY(numero));
  67.  
  68. CREATE TABLE charger(dateChargement date,
  69. CODEVOL int,
  70. CODEEMPLOYES int,
  71. NUMEROPRODUITS int,
  72. PRIMARY KEY (CODEVOL, CODEEMPLOYES, NUMEROPRODUITS),
  73. CONSTRAINT FK_CODEVOL FOREIGN KEY (CODEVOL) REFERENCES vol(code),
  74. CONSTRAINT FK_CODEEMPLOYES FOREIGN KEY (CODEEMPLOYES) REFERENCES employes(code),
  75. CONSTRAINT FK_NUMEROPRODUITS FOREIGN KEY (NUMEROPRODUITS) REFERENCES produits(numero));
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