-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy path06_db_inmobiliaria_DML_UPDATES.sql
More file actions
685 lines (306 loc) · 14.8 KB
/
06_db_inmobiliaria_DML_UPDATES.sql
File metadata and controls
685 lines (306 loc) · 14.8 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
/* ----------------------------
* ------ INMOBILIARIA---------
* ----------------------------
*
*
* ========= DML UPDATES =============
*/
-- Eliminamos los Registros Actualizados de la Tabla
delete from logs_updates;
-- Alteramos la secuencia autoincrementable del id
alter sequence id_sec_logs_upd restart with 1;
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ===============================
-- ======= TABLA OFICINAS ========
-- ===============================
select listado_oficinas();
select descripcion_oficinas();
-- ---------- TODOS LOS CAMPOS ---------------
-- Actualizamos todos los campos
select actualizar_registro_oficinas(1, 'Torre San Vicente'
, 'Paraguay 770', '+54911735345','inmobiliariaDuckson@gmail.com');
select listado_oficinas();
select listado_logs_updates();
-- --------- CAMPO NRO_TELEFONO --------------
-- Actualizamos el Numero con sentencia
update oficinas set nro_telefono='+5491152794991' where id = 1;
-- Actualizamos los Nros con funcion
select actualizar_nro_tel_oficinas(1,'0111152794690');
select actualizar_nro_tel_oficinas(3,'+541156541844');
select listado_oficinas();
select listado_logs_updates();
-- Depurar Numeros Telefonicos
select depurar_nro_tel_oficinas();
-- --------- CAMPO DIRECCION --------------
-- Depurar Direcciones Automatico con funcion
select depurar_dir_oficinas();
select listado_oficinas();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ========================================
-- ======= TABLA OFICINAS_DETALLES ========
-- ========================================
-- --------- CAMPO LOCALIDAD --------------
select listado_oficinas_detalles();
select descripcion_oficinas_detalles();
-- Cambio de Localidad por funcion
select actualizar_loc_oficinas_detalles(1,'Tribunales');
select listado_oficinas_detalles();
select listado_logs_updates();
-- --------- CAMPO TIPO_OFICINA --------------
select listado_oficinas_detalles();
select descripcion_oficinas_detalles();
select actualizar_tipo_of_oficinas_detalles(3, 'PEQUEÑA');
select listado_logs_updates();
-- --------- CAMPO SUPERFICIE_TOTAL --------------
select listado_oficinas_detalles();
select descripcion_oficinas_detalles();
select actualizar_sup_total_oficinas_detalles(1 , 150);
select listado_logs_updates();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- =============================================
-- ======= TABLA SERVICIOS_OFICINAS ===========
-- =============================================
-- --------- CAMPOS DESCRIPCION_SERVICIOS ---------------
-- Depuracion general de descripcion_servicios
select depurar_descripcion_servicios_oficinas();
select listado_servicios_oficinas();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ===================================
-- ======= TABLA EMPLEADOS ===========
-- ===================================
-- --------- CAMPO NOMBRE Y CAMPO APELLIDO ---------------
select listado_empleados();
select descripcion_empleados();
select depurar_nomb_apell_empleados();
select listado_logs_updates();
-- ---------------------------------------------------------------------------
-- -------- CAMPO CUIL -------------
-- actualización cuil de empleados
select actualizar_cuil_empleados(10,'63-489671-5');
select actualizar_cuil_empleados(3,'373647671564');
select listado_empleados();
select listado_logs_updates();
-- --------- CAMPO DIRECCION ------------
-- Depuración Gral direccion de Empleados
select depurar_direccion_empleados();
select listado_empleados();
-- ---------- CAMPO NRO_TELEFONO_PRINCIPAL Y CAMPO NRO TELEFONO_SECUNDARIO ----------------
-- Depuración gral de ambos campos
select depurar_nro_telefonos_empleados();
select listado_empleados();
-- ----------- CAMPO SALARIO_ANUAL -------------
select depurar_salario_anual_empleados();
select listado_empleados();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ==================================
-- ======= TABLA CLIENTES ===========
-- ==================================
select listado_clientes();
select descripcion_clientes();
-- ----------- CAMPO NOMBRE Y CAMPO APELLIDO -------------
select depurar_nombres_apellidos_clientes();
select listado_clientes();
-- -------- CAMPO NRO_TELEFONO_PRINCIPAL Y CAMPO NRO TELEFONO_SECUNDARIO ------------
select depurar_nro_telefonos_clientes();
select listado_clientes();
-- -------- CAMPO DIRECCION ------------
select depurar_direccion_clientes();
select listado_clientes();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ================================================
-- ======= TABLA PROPIETARIOS_INMUEBLES ===========
-- ================================================
select listado_propietarios_inmuebles();
select descripcion_propietarios_inmuebles();
-- ----------- CAMPO NOMBRE Y CAMPO APELLIDO -------------
select depurar_nombres_apellidos_propietarios_inmuebles();
select listado_propietarios_inmuebles();
-- -------- CAMPO NRO_TELEFONO_PRINCIPAL Y CAMPO NRO TELEFONO_SECUNDARIO ------------
select depurar_nro_telefonos_propietarios_inmuebles();
select listado_propietarios_inmuebles();
-- -------- CAMPO DIRECCION ------------
select depurar_direccion_propietarios_inmuebles();
select * from propietarios_inmuebles;
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ================================================
-- ======= TABLA INMUEBLES DESCRIPCIONES ==========
-- ================================================
-- ----------- CAMPO SUPERFICIE_TOTAL Y CAMPO SUPERFICIE_CUBIERTA --------------------------
select actualizar_superficie_total_cubierta_inmuebles_descripciones(1 , 278.0 , 195.34);
select listado_inmuebles_descripciones();
select listado_logs_updates();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ================================================
-- ======= TABLA INMUEBLES MEDIDAS ================
-- ================================================
-- ----------- CAMPO DORMITORIO --------------------------
select depurar_dormitorio_inmuebles_medidas();
select listado_inmuebles_medidas();
-- ----------- CAMPO SANITARIO --------------------------
select depurar_sanitario_inmuebles_medidas();
select listado_inmuebles_medidas();
-- --------- CAMPOS PATIO_JARDIN, COCHERA, BALCON ---------------
-- Depuracion general de los campos
select depurar_patio_jardin_cochera_balcon_inmuebles_medidas();
select listado_inmuebles_medidas();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ===================================
-- ======= TABLA INMUEBLES ===========
-- ===================================
-- --------- CAMPOS DESCRIPCION, TIPO ---------------
select depurar_descripcion_tipo_inmuebles();
select listado_inmuebles();
-- --------- CAMPOS DIRECCION, UBICACION ---------------
-- Depuracion general de direccion
select depurar_direccion_ubicacion_inmuebles();
select listado_inmuebles();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ===================================
-- ======= TABLA CITAS_INMUEBLES =====
-- ===================================
-- --------- CAMPOS DESCRIPCION_CITA ---------------
-- Depuracion general de descripcion_cita
select depurar_descripcion_cita_citas_inmuebles();
select listado_citas_inmuebles();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- =============================================
-- ======= TABLA INSPECCIONES_INMUEBLES ========
-- =============================================
-- --------- CAMPO DESCRIPCION_INSPECCION ---------------
-- Depuracion general de descripcion_inspeccion
select depurar_descripcion_inspeccion_inspecciones_inmuebles();
select listado_inspecciones_inmuebles();
-- --------- CAMPOS EMPRESA, DIRECCION ---------------
-- Depuracion general de los campos
select depurar_empresa_direccion_inspecciones_inmuebles();
select listado_inspecciones_inmuebles();
-- --------- CAMPO NUMERO_TELEFONO ---------------
-- Depuracion general de los campos
select depurar_nro_tel_inspecciones_inmuebles();
select listado_inspecciones_inmuebles();
-- --------- CAMPO COSTO ---------------
-- Depuracion general del campo costo
select depurar_costo_inspecciones_inmuebles();
select listado_inspecciones_inmuebles();
-- --------- CAMPO FECHA Y CAMPO HORA ---------------
-- Modificacion del campo fecha y campo hora
select actualizar_fecha_hora_inspecciones_inmuebles(1,'2021-02-13','08:00:00');
select listado_inspecciones_inmuebles();
select listado_logs_updates();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- =============================================
-- ======= TABLA INMUEBLES_MARKETING ===========
-- =============================================
-- --------- CAMPO TIPO_ANUNCIO_PRINCIPAL Y CAMPO TIPO_ANUNCIO_SECUNDARIO ---------------
-- Modificacion del campo tipo_anuncio_principal y campo tipo_anuncio_secundario
select depurar_tipo_anuncio_principal_secundario_inmuebles_marketing();
select listado_inmuebles_marketing();
-- --------- CAMPO DESCRIPCION_ANUNCIO ---------------
-- Modificacion del campo descripcion_anuncio
select depurar_descripcion_anuncio_inmuebles_marketing();
select listado_inmuebles_marketing();
-- --------- CAMPO INVERSION_TOTAL ---------------
-- Modificacion del campo inversion_total
select depurar_inversion_total_inmuebles_marketing();
select listado_inmuebles_marketing();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- =========================================
-- ======= TABLA ADMINISTRADORES ===========
-- =========================================
-- --------- CAMPO TIPO_INMUEBLES ---------------
-- Modificacion del campo tipo_inmuebles
select depurar_tipo_inmuebles_administradores();
select listado_administradores();
-- --------- CAMPO CERTIFICACIONES ---------------
-- Modificacion del campo certificaciones
select depurar_certificaciones_administradores();
select listado_administradores();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ==================================
-- ======= TABLA GERENTES ===========
-- ==================================
-- --------- CAMPO TITULO ---------------
-- Depuracion general del campo titulo
select depurar_titulo_gerentes();
select listado_gerentes();
-- --------- CAMPO BENEFICIOS ---------------
-- Depuracion general
select depurar_beneficios_gerentes();
select listado_gerentes();
-- --------- CAMPO RETRIBUCION_SALARIAL_ANUAL ---------------
-- Depuracion general
select depurar_retribucion_salarial_anual_gerentes();
select listado_gerentes();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ====================================
-- ======= TABLA VENDEDORES ===========
-- ====================================
-- --------- CAMPO CANTIDAD_VENTAS ---------------
-- Modificacion cantidad_ventas
select actualizar_cantidad_ventas_vendedores(1, 1);
select listado_vendedores();
select listado_logs_updates();
-- --------- CAMPO BONIFICACION_VENTAS ---------------
-- Depuracion general
select depurar_bonificacion_ventas_vendedores();
select listado_vendedores();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- =====================================
-- ======= TABLA COMPRADORES ===========
-- =====================================
-- --------- CAMPO DESCUENTO_CLIENTE_USD Y CAMPO BENEFICIOS_COMPRAS---------------
-- Depuracion general
select depurar_descuento_cliente_usd_beneficios_compras_compradores();
select listado_compradores();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ================================
-- ======= TABLA VENTAS ===========
-- ================================
-- --------- CAMPO FECHA_VENTA Y CAMPO HORA_VENTA ---------------
-- Modificación campo fecha_venta y campo hora_venta
select actualizar_fecha_hora_venta_ventas(1, '2020-12-22', '09:00:00');
select listado_ventas();
select listado_logs_updates();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ================================
-- ======= TABLA FACTURAS =========
-- ================================
-- --------- CAMPO PRECIO_TOTAL_VENTA_USD ---------------
-- Depuracion general
select depurar_precio_total_venta_usd_facturas();
select listado_facturas();
-- ---------------------------------------------------------------------------
-- ---------------------------------------------------------------------------
-- ===========================================
-- ======= TABLA FACTURAS_DETALLES ===========
-- ===========================================
-- --------- CAMPO DESCRIPCION_FACTURA Y CAMPO DESCRIPCION_PAGO ---------------
-- Depuracion general
select depurar_descripcion_factura_pago_facturas_detalles();
select listado_facturas_detalles();
-- --------- CAMPO VALOR_INMUEBLE_USD---------------
-- Depuracion general
select depurar_valor_inmueble_usd_facturas_detalles();
select listado_facturas_detalles();
-- --------- CAMPO COSTO_ASOCIADO_USD Y CAMPO IMPUESTOS_ASOCIADOS_USD---------------
-- Depuracion general
select depurar_costo_impuestos_asociados_usd_facturas_detalles();
select listado_facturas_detalles();