Advertisement
Guest User

DZEJKUB

a guest
May 26th, 2015
216
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.56 KB | None | 0 0
  1. Zadanie 1
  2. declare @a int
  3. select @a=COUNT(*)
  4. from Produkty
  5. if @a>500
  6. print 'wiecej niz 500'
  7.  
  8. Zadanie 2
  9. use Magazyn;
  10. declare @z int
  11. declare @x int
  12. select @z=COUNT(Kolor) from Produkty
  13. where Kolor='Niebieski'
  14. select @x=count(Kolor) from Produkty
  15. where Kolor='Czarny'
  16. if @z>@x
  17. print 'niebieskich jest wiecej niz czarnych'
  18. else
  19. print 'czarnych jest wiecej niz niebieskich'
  20.  
  21. Zadanie 3
  22. use Magazyn;
  23. declare @c int
  24. declare @i int
  25. set @i=0
  26. select @c=COUNT(*) from Produkty
  27. while @i<@c
  28. begin
  29. set @i=@i+1
  30. print 'Produkt'
  31. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement