Advertisement
Guest User

Untitled

a guest
Jun 17th, 2019
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.84 KB | None | 0 0
  1. create table ejecutivo(
  2. id integer primary key not null,
  3. nombre_completo text not null
  4. );
  5.  
  6. create table aseguradora (
  7. id integer primary key not null,
  8. nombre text not null
  9. );
  10. create table agente (
  11. clave text primary key not null,
  12. id_aseguradora integer references aseguradora on update cascade,
  13. nombre text not null
  14. );
  15. create table cliente_asegurado(
  16. id integer primary key not null,
  17. nombre text not null,
  18. apellido_paterno text not null,
  19. apellido_materno text not null , --juntar?
  20. genero boolean, --Las aseguradoras lo piden ?
  21. año_nacimiento text, --No existe formato date en sqlite
  22. RFC text, --posible id? not sure if nullable
  23. direccion text,
  24. numero_ext text, --Text porque a veces ponen 11-A
  25. colonia text,
  26. delegacion text,
  27. cp integer not null, --Las aseguradoras lo piden.
  28. ciudad text,
  29. telefono particular text,
  30. telefono_oficina text,
  31. celular text,
  32. correo_oficina text,
  33. correo_personal text,
  34. documentos text
  35. );
  36. create table marca (
  37. id_marca integer not null,
  38. nombre text,
  39. company text
  40. );
  41.  
  42. create table tipo_vehiculo (
  43. id_tipo_vechiulo integer primary key not null,
  44. nombre text not null,
  45. descripcion text
  46. --Autos,Camion de hasta 3.5 toneladas, remolque y moto
  47. );
  48. create table modelo(
  49. id_modelo integer primary key not null,
  50. id_tipo_vehiculo references tipo_vehiculo on update cascade,
  51. id_marca integer references marca on update cascade,
  52. modelo_year integer not null,
  53. descripcion text,
  54. motor text
  55. );
  56.  
  57. create table vehiculo(
  58. clave_vehiculo integer primary key not null,
  59. id_asegurado integer references asegurado on update cascade,
  60. id_modelo integer references modelo on update cascade,
  61. placas text, --not nullable?
  62. serie text,
  63. beneficiario_preferente text,
  64. descripcion text
  65. );
  66.  
  67. create table tipo_extra (
  68. id integer primary key not null,
  69. nombre text --adaptacion, conversion, equipo_especial
  70. );
  71.  
  72. create table extras(
  73. id_extras integer primary key not null,
  74. clave_vehiculo integer references vehiculo on update cascade,
  75. id_tipo_extra integer references tipo_extra on update cascade,
  76. descripcion text,
  77. suma_asegurada_adaptacion integer,
  78. beneficiario_preferente text
  79. );
  80.  
  81. create table cobertura(
  82. id_tipo_cobertura integer primary key not null,
  83. cobertura text,
  84. descripcion text
  85. );
  86. create table poliza_individual (
  87. numero_de_poliza integer primary key not null, --posible conexion con administración
  88. clave_agente text not null references agente on update cascade,
  89. id_ejecutivo integer references ejecutivo on update cascade,
  90. id_aseguradora integer references aseguradora on update cascade,
  91. id_cliente_asegurado integer references cliente_asegurado on update cascade,
  92. id_tipo_cobertura integer not null references tipo_cobertura on update cascade,
  93. clave_vehiculo integer not null references vehiculo on update cascade,
  94. renovacion boolean not null,
  95. caratula text,
  96. inicio_vigencia text, --No hay formato fecha pero se guardara yyyy-mm-dd
  97. fin_vigencia text,
  98. forma_de_pago text,
  99. status text,
  100. derecho de polizas text,
  101. recargo_fraccionario real,
  102. iva real,
  103. descripcion_poliza text,
  104. observaciones text,
  105. documentos text,
  106. pago_total real,
  107. comision_total real
  108. );
  109.  
  110. create table pagos(
  111. id_pago integer primary key not null,
  112. numero_poliza integer references poliza on update cascade,
  113. prima_neta real,
  114. comision real,
  115. prima_total real,
  116. forma_de_pago text,
  117. iva real,
  118. fecha_de_pago text,
  119. fecha_aplicacion_pago_aseguradora text,
  120. mes_de_pago_comision text
  121. );
  122.  
  123. create table cancelacion(
  124. id_cancelacion integer primary key not null,
  125. numero_poliza integer references poliza on update cascade,
  126. fecha_cancelacion text,
  127. importe_devolucion real,
  128. motivo text
  129. );
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement