Advertisement
Guest User

Untitled

a guest
Jan 14th, 2019
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 7.17 KB | None | 0 0
  1. Setting environment for using XAMPP for Windows.
  2. uczen@X7-13 c:\xampp
  3. # mysql -u root
  4. Welcome to the MariaDB monitor. Commands end with ; or \g.
  5. Your MariaDB connection id is 2
  6. Server version: 10.1.13-MariaDB mariadb.org binary distribution
  7.  
  8. Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
  9.  
  10. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  11.  
  12. MariaDB [(none)]> show databases;
  13. +--------------------+
  14. | Database |
  15. +--------------------+
  16. | 3i_finanse |
  17. | finanse_3a |
  18. | information_schema |
  19. | mysql |
  20. | performance_schema |
  21. | phpmyadmin |
  22. | sklepik |
  23. | tesco |
  24. | test |
  25. | werka4a |
  26. +--------------------+
  27. 10 rows in set (0.03 sec)
  28.  
  29. MariaDB [(none)]> use finanse_3a;
  30. Database changed
  31. MariaDB [finanse_3a]> select Klient_id,Nazwa_klienta from klienci;
  32. +-----------+------------------+
  33. | Klient_id | Nazwa_klienta |
  34. +-----------+------------------+
  35. | 1 | ACME Industries |
  36. | 2 | Winesburg Press |
  37. | 3 | ABC Noun |
  38. | 4 | Galt on the Hill |
  39. | 5 | The Enterprises |
  40. | 6 | Something Clever |
  41. | 7 | Another Client |
  42. | 8 | Nepotism Inc. |
  43. +-----------+------------------+
  44. 8 rows in set (0.00 sec)
  45.  
  46. MariaDB [finanse_3a]> select wartosc_wydatku *12 from wydatki where wydatki_id =1;
  47. ERROR 1054 (42S22): Unknown column 'wydatki_id' in 'where clause'
  48. MariaDB [finanse_3a]> select Wartosc_wydatku *12 from wydatki where wydatki_id =1;
  49. ERROR 1054 (42S22): Unknown column 'wydatki_id' in 'where clause'
  50. MariaDB [finanse_3a]> select Wartosc_wydatku *12 from wydatki where Wydatek_id =1;
  51. +---------------------+
  52. | Wartosc_wydatku *12 |
  53. +---------------------+
  54. | 239.88 |
  55. +---------------------+
  56. 1 row in set (0.00 sec)
  57.  
  58. MariaDB [finanse_3a]> select Wartosc_wydatku *12 as cena from wydatki where Wydatek_id =1;
  59. +--------+
  60. | cena |
  61. +--------+
  62. | 239.88 |
  63. +--------+
  64. 1 row in set (0.00 sec)
  65.  
  66. MariaDB [finanse_3a]> select disint klient_id
  67. -> ;
  68. ERROR 1054 (42S22): Unknown column 'disint' in 'field list'
  69. MariaDB [finanse_3a]> ;
  70. ERROR: No query specified
  71.  
  72. MariaDB [finanse_3a]> ;
  73. ERROR: No query specified
  74.  
  75. MariaDB [finanse_3a]> ;
  76. ERROR: No query specified
  77.  
  78. MariaDB [finanse_3a]> ;
  79. ERROR: No query specified
  80.  
  81. MariaDB [finanse_3a]>
  82. MariaDB [finanse_3a]> ;
  83. ERROR: No query specified
  84.  
  85. MariaDB [finanse_3a]> ;
  86. ERROR: No query specified
  87.  
  88. MariaDB [finanse_3a]> select distinct klient_id from faktury where klient_id <4;
  89. +-----------+
  90. | klient_id |
  91. +-----------+
  92. | 3 |
  93. | 2 |
  94. | 1 |
  95. +-----------+
  96. 3 rows in set (0.01 sec)
  97.  
  98. MariaDB [finanse_3a]> select klient_id , data_faktury from faktury order by data_faktury desc;
  99. +-----------+--------------+
  100. | klient_id | data_faktury |
  101. +-----------+--------------+
  102. | 3 | 2004-11-20 |
  103. | 3 | 2004-07-20 |
  104. | 1 | 2004-01-02 |
  105. | 8 | 2003-10-24 |
  106. | 2 | 2003-07-20 |
  107. | 2 | 2003-07-18 |
  108. | 3 | 2003-04-08 |
  109. | 4 | 2002-12-24 |
  110. | 3 | 2002-07-20 |
  111. | 4 | 2002-04-24 |
  112. | 4 | 2002-04-24 |
  113. | 3 | 2002-04-24 |
  114. | 2 | 2002-04-22 |
  115. | 1 | 2002-04-10 |
  116. | 7 | 2001-07-27 |
  117. | 5 | 2001-07-03 |
  118. +-----------+--------------+
  119. 16 rows in set (0.00 sec)
  120.  
  121. MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%";
  122. +-----------+-----------------+
  123. | klient_id | Nazwa_klienta |
  124. +-----------+-----------------+
  125. | 1 | ACME Industries |
  126. | 3 | ABC Noun |
  127. | 7 | Another Client |
  128. +-----------+-----------------+
  129. 3 rows in set (0.00 sec)
  130.  
  131. MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%" and ulica_klienta is null;
  132. Empty set (0.00 sec)
  133.  
  134. MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%" and ulica_klienta like;
  135. ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '' at line 1
  136. MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%" and ulica_klienta like " ";
  137. Empty set (0.00 sec)
  138.  
  139. MariaDB [finanse_3a]> select * from klienci;
  140. +-----------+------------------+-------------------+----------------+--------------+----------------------+-----------------+-------------------+--------------------------+
  141. | klient_id | nazwa_klienta | ulica_klienta | miasto_klienta | stan_klienta | kod_pocztowy_klienta | telefon_klienta | osoba_kontaktowa | email_kontaktowy |
  142. +-----------+------------------+-------------------+----------------+--------------+----------------------+-----------------+-------------------+--------------------------+
  143. | 1 | ACME Industries | 100 Main Street | Anytown | NY | 11111 | (800)555-1234 | Jane Doe | doe@acme.com |
  144. | 2 | Winesburg Press | | Garbee | LA | 12345 | | Sherwood Anderson | |
  145. | 3 | ABC Noun | | Berlin | | 0 | | Clarissa Joens | clarisa@winesburg.de |
  146. | 4 | Galt on the Hill | 1000 tutle Drive | Brazilia | IL | 60000 | | John Smit | |
  147. | 5 | The Enterprises | 500 Main Street | Anytown | NY | 55555 | (800)555-1923 | John Doe | Jonny_D@enterprisees.com |
  148. | 6 | Something Clever | 13 Downing Street | London | L | 16777215 | (788)676-987 | Deryl Zero | Zero_0@clever.uk |
  149. | 7 | Another Client | | Garbee | LA | 12346 | | Art Vander Lay | avi@client.com |
  150. | 8 | Nepotism Inc. | 23 Martin Strasse | Manheim | SZ | 3232322 | (66)4784-8909 | James Blond | jblond@neopotism.de |
  151. +-----------+------------------+-------------------+----------------+--------------+----------------------+-----------------+-------------------+--------------------------+
  152. 8 rows in set (0.00 sec)
  153.  
  154. MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%" and ulica_klienta like "%";
  155. +-----------+-----------------+
  156. | klient_id | Nazwa_klienta |
  157. +-----------+-----------------+
  158. | 1 | ACME Industries |
  159. | 3 | ABC Noun |
  160. | 7 | Another Client |
  161. +-----------+-----------------+
  162. 3 rows in set (0.00 sec)
  163.  
  164. MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%" and ulica_klienta like "";
  165. +-----------+----------------+
  166. | klient_id | Nazwa_klienta |
  167. +-----------+----------------+
  168. | 3 | ABC Noun |
  169. | 7 | Another Client |
  170. +-----------+----------------+
  171. 2 rows in set (0.00 sec)
  172.  
  173. MariaDB [finanse_3a]>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement