Preciomenor money output as select preciomayor

  • No School
  • AA 1
  • 4

This preview shows page 3 - 4 out of 4 pages.

@PrecioMenor money OUTPUT AS SELECT @PrecioMayor = MAX(p.unitPrice), @PrecioMenor = MIN(p.unitPrice) FROM Products AS p INNER JOIN categories AS c ON p.CategoryID = c.CategoryID WHERE c.CategoryName LIKE @CategoriaName + '%' ---Probar DECLARE @p money DECLARE @q money exec pa_Producs_PrecioMayor_PrecioMenor 'Confections', @p OUTPUT, @q OUTPUT SELECT @p, @q SELECT @p AS PRECIO_MAYOR , @q AS PRECIO_MENOR --Ejercicio 2 --Realizar un procedimiento que permita eliminar el cliente (Customers) según su identificación (CustomerID). Si existe el cliente en la tabla ORDERS devuelve 1 (No se puede eliminar) caso contrario devuelve 0 (Se eliminó). CREATE PROCEDURE pa_Clientes_Eliminar @CustomerID varchar(50) AS
Image of page 3

Subscribe to view the full document.

4 DECLARE @r int IF EXISTS (SELECT * FROM orders WHERE CustomerID = @CustomerID ) RETURN 1 ELSE DELETE FROM Customers WHERE CustomerID = @CustomerID RETURN 0 RETURN @r DECLARE @r int execute @r = pa_Clientes_Eliminar 'PEDRO' SELECT @r AS Valor_de_retorno DECLARE @r int execute @r = pa_Clientes_Eliminar 'LILAS' SELECT @r AS Valor_de_retorno
Image of page 4
  • Fall '19

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern

Ask Expert Tutors You can ask 0 bonus questions You can ask 0 questions (0 expire soon) You can ask 0 questions (will expire )
Answers in as fast as 15 minutes