SHARE
TWEET

Untitled

a guest Sep 16th, 2019 73 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. Zad1
  2.  
  3. SELECT * FROM company WHERE Name like 'p%'
  4.  
  5. Zad2
  6.  
  7. SELECT * FROM company
  8. WHERE CityId = 1
  9. AND PostCode like '5%';
  10.  
  11. Zad3
  12.  
  13. Pierwsze sposob:
  14.  
  15. SELECT * FROM company
  16. WHERE YEAR(StartDate)=2000
  17.  
  18. Drugi sposob:
  19.  
  20. SELECT * FROM company
  21. WHERE StartDate >='2000-01-01'
  22. AND StartDate <= '2000-12-31'
  23.  
  24. Zad4
  25.  
  26. SELECT NAME, AnnualIncome,
  27. AnnualIncome/12 As "Przychod miesieczny"
  28. FROM company WHERE Active=1 AND EmployeeCount >= 1000
  29.  
  30. Zad5
  31.  
  32. Od najmiejszego do najwiekszego:
  33.  
  34. SELECT NAME, AnnualIncome/12
  35. FROM company
  36. order by AnnualIncome
  37. limit 3
  38.  
  39. Od najwiekszego do najmniejszego:
  40.  
  41. SELECT NAME, AnnualIncome/12
  42. FROM company
  43. order by AnnualIncome desc
  44. limit 3
  45.  
  46. Zad6
  47.  
  48. SELECT NAME FROM company
  49. WHERE AnnualIncome/12 > 10000
  50.  
  51. Zad7
  52.  
  53. To zle:
  54.  
  55. SELECT * FROM company
  56. WHERE PostCode IN ('54-621','78-695','63-896')
  57.  
  58. To zle x2:
  59.  
  60. SELECT NAME, PostCode, Street, Number
  61. FROM company
  62. WHERE PostCode IN ('54-621','78-695','63-896')
  63.  
  64. To dobrze:
  65.  
  66. SELECT
  67. Name, PostCode,
  68. concat(Street, " ",Number) As adres
  69. FROM company
  70. WHERE PostCode IN ('54-621','78-695','63-896')
  71.  
  72. Zad8
  73.  
  74. Jutro
  75.  
  76. Zad9
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top