G2A Many GEOs
SHARE
TWEET

Untitled

a guest Apr 9th, 2020 125 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. 1create database ClubTenis;
  2. 2.   
  3. 3use ClubTenis;
  4. 4.   
  5. 5create table Pistas(
  6. 6.  IdPista Varchar(20) Primary key not null,
  7. 7.  Descripcion Double,
  8. 8.  Grada Bool,
  9. 9.  Homologada Bool
  10. 10. )engine =InnoDB;
  11. 11.  
  12. 12. create table Socios(
  13. 13. NIF_S Varchar(20) Primary key not null,
  14. 14. NombreS Varchar(20),
  15. 15. ApellidosS Varchar(50),
  16. 16. DireccionS Varchar(50),
  17. 17. TelefonoS int,
  18. 18. CuentaCS Varchar(40),
  19. 19. Accionista Bool
  20. 20. )engine =InnoDB;
  21. 21.  
  22. 22. create table Profes(
  23. 23. NIF_P Varchar(20) Primary key not null,
  24. 24. NumFed Varchar(30),
  25. 25. NombreP Varchar(20),
  26. 26. ApellidosP Varchar(50),
  27. 27. DireccionP Varchar(50),
  28. 28. TelefonoP int
  29. 29. )engine =InnoDB;
  30. 30.  
  31. 31. create table Curso(
  32. 32. IdCurso Varchar(20) Primary key not null,
  33. 33. NombreC Varchar(50),
  34. 34. MaxAlumnos int,
  35. 35. NIF_P Varchar(20),
  36. 36. Foreign key(NIF_P) references Profes(NIF_P) on Update Cascade on Delete
  37. 37. Cascade
  38. 38. )engine =InnoDB;
  39. 39.  
  40. 40. create table Reservas(
  41. 41. IdPista Varchar(20) not null,
  42. 42. FechaRe Date not null,
  43. 43. Hora_ent Time not null,
  44. 44. Hora_sal Time,
  45. 45. Pagado Bool,
  46. 46. Luz Bool,
  47. 47. Foreign key(IdPista) references Pistas(IdPista) on Update Cascade on Delete
  48. 48. Cascade,
  49. 49. Primary Key (IdPista,FechaRe,Hora_ent)
  50. 50. )engine =InnoDB;
  51. 51.  
  52. 52. create table Horario(
  53. 53. IdCurso Varchar(20) not null,
  54. 54. Dia Date not null,
  55. 55. Hora_Inicio Time,
  56. 56. Hora_Fin Time,
  57. 57. Foreign key(IdCurso) references Curso(IdCurso) on Update Cascade on Delete
  58. 58. Cascade,
  59. 59. Primary Key (IdCurso,Dia)
  60. 60. )engine =InnoDB;
  61. 61.  
  62. 62. create table Recibos(
  63. 63. IdCurso Varchar(20) not null,
  64. 64. NIF_S Varchar(20) not null,
  65. 65. FechaRe Date not null,
  66. 66. Pagado Bool,
  67. 67. Cuota Double,
  68. 68. Foreign key(IdCurso) references Curso(IdCurso) on Update Cascade on Delete
  69. 69. Cascade,
  70. 70. Foreign key(NIF_S) references Socios(NIF_S) on Update Cascade on Delete
  71. 71. Cascade,
  72. 72. Primary Key (IdCurso, NIF_S,FechaRe)
  73. 73. )engine =InnoDB;
  74. 74.  
  75. 75. create table Juega(
  76. 76. NIF_S Varchar(20) not null,
  77. 77. IdPista Varchar(20) not null,
  78. 78. FechaRe Date not null,
  79. 79. Hora_ent Time not null,
  80. 80. Foreign key(NIF_S) references Socios(NIF_S) on Update Cascade on Delete
  81. 81. Cascade,
  82. 82. Foreign key(IdPista) references Pistas(IdPista) on Update Cascade on Delete
  83. 83. Cascade,
  84. 84. Foreign key(IdPista,FechaRe,Hora_ent) references
  85. 85. Reservas(IdPista,FechaRe,Hora_ent) on Update Cascade on Delete Cascade,
  86. 86. Primary Key(NIF_S,IdPista,FechaRe,Hora_ent)
  87. 87. )engine =InnoDB;
RAW Paste Data
Ledger Nano X - The secure hardware wallet
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