daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 60 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. CREATE TABLE Medico
  2. (
  3.     idMed INT AUTO_INCREMENT,
  4.     nome VARCHAR(30) NOT NULL,
  5.     cognome VARCHAR(30) NOT NULL,
  6.     telefono VARCHAR(30) NOT NULL,
  7.     PRIMARY KEY (idMed)
  8. )   ENGINE=INNODB;
  9.  
  10. INSERT INTO Medico
  11. (nome, cognome, telefono)
  12. VALUE
  13. ('Davide','Di Giovanni','3737143554'),
  14. ('Alessio','Cardu','3737143555');
  15. -------------------------------------------------------------
  16. CREATE TABLE TipoApp
  17. (
  18.     idTapp INT AUTO_INCREMENT,
  19.     descr VARCHAR(200) NOT NULL,
  20.     PRIMARY KEY (idTapp)
  21. )   ENGINE=INNODB;
  22.  
  23. -------------------------------------------------------------
  24. CREATE TABLE Paziente
  25. (
  26.     idPaz INT AUTO_INCREMENT,
  27.     nome VARCHAR(30) NOT NULL,
  28.     cognome VARCHAR(30) NOT NULL,
  29.     telefono VARCHAR(30) NOT NULL,
  30.     PRIMARY KEY (idPaz)
  31. )   ENGINE=INNODB;
  32.  
  33. INSERT INTO Paziente
  34. (nome, cognome, telefono)
  35. VALUE
  36. ('Lil','Pump','3477143551'),
  37. ('SkiMask','TheSlumpGod','3847643955'),
  38. ('Sfera','Ebbasta','3867653951'),
  39. ('Nitro','Wilson','3647874952'),
  40. ('Tony','Effe','7777777777'),
  41. ('Lazza','Zzala','3375839284'),
  42. ('Lil','Uzi','339857847'),
  43. ('Capo','Plaza','334657893');
  44. -------------------------------------------------------------
  45. CREATE TABLE Studio
  46. (
  47.     idStu INT AUTO_INCREMENT,
  48.     nome VARCHAR(30) NOT NULL,
  49.     PRIMARY KEY (idStu)
  50. )   ENGINE=INNODB;
  51.  
  52. INSERT INTO Studio
  53. (nome)
  54. VALUE
  55. ('Giallo'),
  56. ('Blu'),
  57. ('Viola'),
  58. ('Verde'),
  59. ('Rosso');
  60. -------------------------------------------------------------
  61. CREATE TABLE Ora
  62. (
  63.     idOra INT AUTO_INCREMENT,
  64.     ora TIME NOT NULL,
  65.     PRIMARY KEY (idOra)
  66. )   ENGINE=INNODB;
  67. -------------------------------------------------------------
  68. CREATE TABLE Appuntamento(
  69. codice_appuntamento int auto_increment,
  70. note varchar(100) NOT NULL,
  71. testo varchar(50) NOT NULL,
  72. data_app date NOT NULL,
  73. fk_cod_app int NOT NULL,
  74. fk_tipo int NOT NULL,
  75. fk_ora int NOT NULL,
  76. fk_stu int NOT NULL,
  77. fk_paz int NOT NULL,
  78. fk_med int NOT NULL,
  79. dow date NOT NULL,
  80. PRIMARY KEY (codice_appuntamento),
  81. FOREIGN KEY (fk_tipo) REFERENCES TipoApp(idTapp),
  82. FOREIGN KEY (fk_ora) REFERENCES Ora(idOra),
  83. FOREIGN KEY (fk_cod_app) REFERENCES Appuntamento(codice_appuntamento),
  84. FOREIGN KEY (fk_stu) REFERENCES Studio(idStu),
  85. FOREIGN KEY (fk_paz) REFERENCES Paziente(idPaz),
  86. FOREIGN KEY (fk_med) REFERENCES Medico(idMed)
  87. )ENGINE=INNODB;
  88.  
  89. INSERT INTO Appuntamento
  90. ()
  91. VALUE
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