Advertisement
selebry

sadas

Jan 9th, 2023
151
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.50 KB | None | 0 0
  1. --1
  2. create function zero_shop_book()
  3. returns int
  4. as
  5. begin
  6. declare @c int
  7. select @c=count(shops.ID_SHOP)
  8. from sale.Sales sales, sale.Shops shops
  9. where sales.ID_SHOP=shops.ID_SHOP
  10. group by shops.ID_SHOP
  11. having count(sales.ID_SALE)=0
  12. return @c
  13. end
  14. go
  15. --2
  16. create function min_val(@a int, @b int, @c int)
  17. returns int
  18. as
  19. begin
  20. return
  21. case when @a < @b and @a < @c then
  22. @a
  23. else case when @b <@c then
  24. @b
  25. else
  26. @c
  27. end
  28. end
  29. end
  30. go
  31. --3
  32. create function count_sales_book()
  33.  
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement