Actividad 1 de unidad 5

340 views

Published on

Published in: Technology, Business
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
340
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
2
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Actividad 1 de unidad 5

  1. 1. *VISTAS CREATE VIEW ganaderia_propietario WITH ENCRYPTION AS SELECT RTRIM(nom_ganaderia) +'('+RTRIM(color_enseña)+')'AS ganederia_propietario FROMGanaderia
  2. 2. *TRIGGER CREATE TRIGGER ganaderia_propietario1 ON Ganaderia FOR INSERT,UPDATE AS UPDATE Ganaderia SET propietario=Upper(propietario) WHERE Ganaderia.id_ganaderia=8001;
  3. 3. *PROCEDIMIENTOSALMACENADO CREATE PROCEDURE contador_torero AS DECLARE @contador INTEGER SELECT @contador=COUNT(*) FROMTorero WHERE NOTapoderadoIS NULL; RETURN @contador;
  4. 4. *TRANSACCIONES BEGIN TRANSACTION INSERT INTOAforo(id_aforo,id_zona) VALUES (2001,401); SAVETRANSACTION empezar_precio; INSERT INTOZona (id_zona,zona,id_distancia) VALUES (401,'sol',301); IF @@ERROR <>0 ROLLBACK TRANSACTION empezar_precio; INSERT INTODistancia(id_distancia,precio) VALUES (310,300); IF @@ERROR <>0 ROLLBACK TRANSACTION empezar_precio; INSERT INTODistancia(id_distancia,precio) VALUES (310,500); COMMIT TRANSACTION

×