Facebook
From jha, 4 Years ago, written in Plain Text.
Embed
Download Paste or View Raw
Hits: 257
  1. 1. Zalogować się na serwer MySQL
  2.  
  3. cd c:\xampp\mysql\bin            i      ENTER
  4.  
  5. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  6.                                 2. Wpisać wykorzystująć klawaiturę:
  7.  
  8. mysql -h localhost -u root -p   i      ENTER
  9.  
  10. Podaj hasło    => zakceptować tylko ENTEREM
  11.  
  12.  
  13. 2. Utworzyć  i pokazać założoną bazę  -   podaj_nazwisko
  14.  
  15. CREATE DATABASE podaj_swoje_nazwisko;
  16.  
  17. USE podaj_swoje_nazwisko;
  18. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  19.  
  20. 3.Utworzyć tabelę podaj_nazwisko1
  21.  
  22. CREATE TABLE KOWALSKI(
  23. id int(3) AUTO_INCREMENT PRIMARY KEY,
  24. imie varchar(30),
  25. nazwisko varchar(30),
  26. miejscowosc varchar(30),
  27. telefon varchar(20),
  28. email varchar(20)
  29. ) ENGINE=InnoDB  DEFAULT CHARSET=latin2;
  30. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  31.  
  32. 4. Pokaż  założoną tabelę
  33.  
  34. DESCRIBE podaj_nazwisko1;
  35.  
  36. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  37.  
  38.  
  39. 5.  WSTAWIĆ REKORDY  DO UTWORZONEJ TABELI - Skopiować i wkleić do KONSOLI:
  40.  
  41.  
  42. INSERT INTO SZUPER5(id,imie,nazwisko,miejscowosc,telefon,email)
  43. VALUES('','Piotr', 'Kowalski', 'Warszawa', '075 145 345 344', '[email protected]'),
  44. ('','Andrzej', 'Romaniuk', 'Wrocław', '075 144 335 333', '[email protected]'),('','Piotr', 'Kamiński', 'Poznań', '075 255 355 444', '[email protected]');
  45.  
  46. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  47.  
  48. 6. Pokazać zawartość  tabeli po wstawieniu rekordów
  49.  
  50.                                         SELECT * FROM modyfikacja1;
  51.  
  52. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  53.  
  54.  
  55. 7. WSTAWIĆ  DRUGSĄ TABELĘ
  56.  
  57.  
  58. CREATE TABLE KOWALSKI2(
  59. id int PRIMARY  KEY AUTO_INCREMENT NOT NULL,
  60. nazwisko varchar(40) NOT NULL,
  61. imie varchar(40) NOT NULL,
  62. etat varchar(20) NOT NULL,
  63. dzial int NOT NULL,
  64. pracuje_od date NOT NULL,
  65. placa_podst int NOT NULL,
  66. placa_dodat int NOT NULL,
  67. premia int NOT NULL) ENGINE=InnoDB  DEFAULT CHARSET=latin2;
  68.  
  69. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  70.  
  71. 8. WSTAWIĆ REKORDY  DO UTWORZONEJ TABELI - Skopiować i wkleić do KONSOLI:
  72.  
  73.  
  74. INSERT INTO  (id, nazwisko,imie, etat, dzial, pracuje_od, placa_podst, placa_dodat, premia)
  75. VALUES ('','Kowalski', 'Jan', 'dyrektor', 20, '1987-03-12',4000, 1200,400),
  76. ('','Dalicka','Janina','sekretarka', 40, '2012-05-15',2500, 0,150 ),
  77. ('','Rajski','Tomasz', 'dyrektor', 20, '2014-04-21',4000, 1000,350 ),
  78. ('','Madeja','Adrian', 'asystent', 30, '2005-08-18',3000, 800,150 ),
  79. ('','Dajcz','Lech', 'laborant', 50, '2015-06-28',2500, 100,100 ),
  80. ('','Warski','Kamil','dyrektor', 20, '2012-04-19',4000, 900,200 ),
  81. ('','Paluszkiewicz', 'Stanisław', 'profesor', 10, '2008-04-15',5000, 1200,400 ),
  82. ('','Szpak', 'Alelsander', 'laborant', 50, '2015-08-18',2500, 400,100 ),
  83. ('','Milkski','Adam', 'asystent', 30, '2013-04-25',3000, 500, 180 ),
  84. ('','Garbarski', 'Michał', 'stażysta', 60, '2018-10-19',2100, 300,180 ),
  85. ('','Rusnak', 'Anna',  'dyrektor',  20, '2012-05-22', 4000, 400, 300 ),
  86. ('','Kolski', 'Sebastian', 'stażysta', 60, '2017-01-22',2500, 300, 180 );
  87.  
  88.  
  89. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  90.  
  91. 9. Pokazać zawartość  tabeli po wstawieniu rekordów
  92.  
  93.                                         SELECT * FROM modyfikacja1;
  94.  
  95.  
  96. xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
  97.  
  98. Setting environment for using XAMPP for Windows.
  99. sala207@S207-01 c:\xampp
  100. # mysql -h localhost -u root -p
  101. Enter password:
  102. Welcome to the MariaDB monitor.  Commands end with ; or \g.
  103. Your MariaDB connection id is 5
  104. Server version: 10.1.19-MariaDB mariadb.org binary distribution
  105.  
  106. Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
  107.  
  108. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  109.  
  110. MariaDB [(none)]> CREATE DATABASE SZUPER;
  111. ERROR 1007 (HY000): Can't create database 'szuper'; database exists
  112. MariaDB [(none)]> CREATE DATABASE SZUPER5;
  113. Query OK, 1 row affected (0.00 sec)
  114.  
  115. MariaDB [(none)]> USE SZUPER5;
  116. Database changed
  117. MariaDB [SZUPER5]> CREATE TABLE SZUPER5(
  118.     -> id int(3) AUTO_INCREMENT PRIMARY KEY,
  119.     -> imie varchar(30),
  120.     -> nazwisko varchar(30),
  121.     -> miejscowosc varchar(30),
  122.     -> telefon varchar(20),
  123.     -> email varchar(20)
  124.     -> ) ENGINE=InnoDB  DEFAULT CHARSET=latin2;
  125. Query OK, 0 rows affected (0.01 sec)
  126.  
  127. MariaDB [SZUPER5]> SELECT * FROM SZUPER5;
  128. Empty set (0.00 sec)
  129.  
  130. MariaDB [SZUPER5]> SHOW TABLES ;
  131. +-------------------+
  132. | Tables_in_szuper5 |
  133. +-------------------+
  134. | szuper5           |
  135. +-------------------+
  136. 1 row in set (0.00 sec)
  137.  
  138. MariaDB [SZUPER5]> INSERT INTO SZUPER5(id,imie,nazwisko,miejscowosc,telefon,email)
  139.     -> VALUES('','Piotr', 'Kowalski', 'Warszawa', '075 145 345 344', '[email protected]'),
  140.     -> ('','Andrzej', 'Romaniuk', 'Wrocław', '075 144 335 333', '[email protected]'),('','Piotr', 'Kamiński', 'Poznań', '075 255 355 444', '[email protected]');
  141. Query OK, 3 rows affected, 3 warnings (0.01 sec)
  142. Records: 3  Duplicates: 0  Warnings: 3
  143.  
  144. MariaDB [SZUPER5]>
  145. MariaDB [SZUPER5]> SHOW TABLES ;
  146. +-------------------+
  147. | Tables_in_szuper5 |
  148. +-------------------+
  149. | szuper5           |
  150. +-------------------+
  151. 1 row in set (0.00 sec)
  152.  
  153. MariaDB [SZUPER5]> SELECT * FROM SZUPER5;
  154. +----+---------+----------+-------------+-----------------+----------------------+
  155. | id | imie    | nazwisko | miejscowosc | telefon         | email                |
  156. +----+---------+----------+-------------+-----------------+----------------------+
  157. |  1 | Piotr   | Kowalski | Warszawa    | 075 145 345 344 | [email protected] |
  158. |  2 | Andrzej | Romaniuk | Wrocław     | 075 144 335 333 | [email protected] |
  159. |  3 | Piotr   | Kamiński | Poznań      | 075 255 355 444 | [email protected] |
  160. +----+---------+----------+-------------+-----------------+----------------------+
  161. 3 rows in set (0.00 sec)
  162.  
  163. MariaDB [SZUPER5]> SELECT imie,nazwisko  FROM SZUPER5;
  164. +---------+----------+
  165. | imie    | nazwisko |
  166. +---------+----------+
  167. | Piotr   | Kowalski |
  168. | Andrzej | Romaniuk |
  169. | Piotr   | Kamiński |
  170. +---------+----------+
  171. 3 rows in set (0.00 sec)
  172.  
  173. MariaDB [SZUPER5]> CREATE TABLE SZUPER6 (
  174.     -> id int PRIMARY  KEY AUTO_INCREMENT NOT NULL,
  175.     -> nazwisko varchar(40) NOT NULL,
  176.     -> imie varchar(40) NOT NULL,
  177.     -> etat varchar(20) NOT NULL,
  178.     -> dzial int NOT NULL,
  179.     -> pracuje_od date NOT NULL,
  180.     -> placa_podst int NOT NULL,
  181.     -> placa_dodat int NOT NULL,
  182.     -> premia int NOT NULL) ENGINE=InnoDB  DEFAULT CHARSET=latin2;
  183. Query OK, 0 rows affected (0.01 sec)
  184.  
  185. MariaDB [SZUPER5]> INSERT INTO SZUPER6 (id, nazwisko,imie, etat, dzial, pracuje_od, placa_podst, placa_dodat, premia)
  186.     -> VALUES ('','Kowalski', 'Jan', 'dyrektor', 20, '1987-03-12',4000, 1200,400),
  187.     -> ('','Dalicka','Janina','sekretarka', 40, '2012-05-15',2500, 0,150 ),
  188.     -> ('','Rajski','Tomasz', 'dyrektor', 20, '2014-04-21',4000, 1000,350 ),
  189.     -> ('','Madeja','Adrian', 'asystent', 30, '2005-08-18',3000, 800,150 ),
  190.     -> ('','Dajcz','Lech', 'laborant', 50, '2015-06-28',2500, 100,100 ),
  191.     -> ('','Warski','Kamil','dyrektor', 20, '2012-04-19',4000, 900,200 ),
  192.     -> ('','Paluszkiewicz', 'Stanisław', 'profesor', 10, '2008-04-15',5000, 1200,400 ),
  193.     -> ('','Szpak', 'Alelsander', 'laborant', 50, '2015-08-18',2500, 400,100 ),
  194.     -> ('','Milkski','Adam', 'asystent', 30, '2013-04-25',3000, 500, 180 ),
  195.     -> ('','Garbarski', 'Michał', 'stażysta', 60, '2018-10-19',2100, 300,180 ),
  196.     -> ('','Rusnak', 'Anna',  'dyrektor',  20, '2012-05-22', 4000, 400, 300 ),
  197.     -> ('','Kolski', 'Sebastian', 'stażysta', 60, '2017-01-22',2500, 300, 180 );
  198. Query OK, 12 rows affected, 12 warnings (0.00 sec)
  199. Records: 12  Duplicates: 0  Warnings: 12
  200.  
  201. MariaDB [SZUPER5]> SELECT *FROM SZUPER6;
  202. +----+---------------+------------+------------+-------+------------+-------------+-------------+--------+
  203. | id | nazwisko      | imie       | etat       | dzial | pracuje_od | placa_podst | placa_dodat | premia |
  204. +----+---------------+------------+------------+-------+------------+-------------+-------------+--------+
  205. |  1 | Kowalski      | Jan        | dyrektor   |    20 | 1987-03-12 |        4000 |        1200 |    400 |
  206. |  2 | Dalicka       | Janina     | sekretarka |    40 | 2012-05-15 |        2500 |           0 |    150 |
  207. |  3 | Rajski        | Tomasz     | dyrektor   |    20 | 2014-04-21 |        4000 |        1000 |    350 |
  208. |  4 | Madeja        | Adrian     | asystent   |    30 | 2005-08-18 |        3000 |         800 |    150 |
  209. |  5 | Dajcz         | Lech       | laborant   |    50 | 2015-06-28 |        2500 |         100 |    100 |
  210. |  6 | Warski        | Kamil      | dyrektor   |    20 | 2012-04-19 |        4000 |         900 |    200 |
  211. |  7 | Paluszkiewicz | Stanisław  | profesor   |    10 | 2008-04-15 |        5000 |        1200 |    400 |
  212. |  8 | Szpak         | Alelsander | laborant   |    50 | 2015-08-18 |        2500 |         400 |    100 |
  213. |  9 | Milkski       | Adam       | asystent   |    30 | 2013-04-25 |        3000 |         500 |    180 |
  214. | 10 | Garbarski     | Michał     | stażysta   |    60 | 2018-10-19 |        2100 |         300 |    180 |
  215. | 11 | Rusnak        | Anna       | dyrektor   |    20 | 2012-05-22 |        4000 |         400 |    300 |
  216. | 12 | Kolski        | Sebastian  | stażysta   |    60 | 2017-01-22 |        2500 |         300 |    180 |
  217. +----+---------------+------------+------------+-------+------------+-------------+-------------+--------+
  218. 12 rows in set (0.00 sec)
  219.  
  220. MariaDB [SZUPER5]> SELECT imie,etat,dzial FROM SZUPER6;
  221. +------------+------------+-------+
  222. | imie       | etat       | dzial |
  223. +------------+------------+-------+
  224. | Jan        | dyrektor   |    20 |
  225. | Janina     | sekretarka |    40 |
  226. | Tomasz     | dyrektor   |    20 |
  227. | Adrian     | asystent   |    30 |
  228. | Lech       | laborant   |    50 |
  229. | Kamil      | dyrektor   |    20 |
  230. | Stanisław  | profesor   |    10 |
  231. | Alelsander | laborant   |    50 |
  232. | Adam       | asystent   |    30 |
  233. | Michał     | stażysta   |    60 |
  234. | Anna       | dyrektor   |    20 |
  235. | Sebastian  | stażysta   |    60 |
  236. +------------+------------+-------+
  237. 12 rows in set (0.00 sec)
  238.  
  239. MariaDB [SZUPER5]> DESCRIPE SZUPER5;
  240. 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 'DESCRIPE SZUPER5' at line 1
  241. MariaDB [SZUPER5]> DESCRIBE SZUPER5;
  242. +-------------+-------------+------+-----+---------+----------------+
  243. | Field       | Type        | Null | Key | Default | Extra          |
  244. +-------------+-------------+------+-----+---------+----------------+
  245. | id          | int(3)      | NO   | PRI | NULL    | auto_increment |
  246. | imie        | varchar(30) | YES  |     | NULL    |                |
  247. | nazwisko    | varchar(30) | YES  |     | NULL    |                |
  248. | miejscowosc | varchar(30) | YES  |     | NULL    |                |
  249. | telefon     | varchar(20) | YES  |     | NULL    |                |
  250. | email       | varchar(20) | YES  |     | NULL    |                |
  251. +-------------+-------------+------+-----+---------+----------------+
  252. 6 rows in set (0.00 sec)
  253.  
  254. MariaDB [SZUPER5]> DESCRIBE SZUPER6;
  255. +-------------+-------------+------+-----+---------+----------------+
  256. | Field       | Type        | Null | Key | Default | Extra          |
  257. +-------------+-------------+------+-----+---------+----------------+
  258. | id          | int(11)     | NO   | PRI | NULL    | auto_increment |
  259. | nazwisko    | varchar(40) | NO   |     | NULL    |                |
  260. | imie        | varchar(40) | NO   |     | NULL    |                |
  261. | etat        | varchar(20) | NO   |     | NULL    |                |
  262. | dzial       | int(11)     | NO   |     | NULL    |                |
  263. | pracuje_od  | date        | NO   |     | NULL    |                |
  264. | placa_podst | int(11)     | NO   |     | NULL    |                |
  265. | placa_dodat | int(11)     | NO   |     | NULL    |                |
  266. | premia      | int(11)     | NO   |     | NULL    |                |
  267. +-------------+-------------+------+-----+---------+----------------+
  268. 9 rows in set (0.00 sec)
  269.  
  270. MariaDB [SZUPER5]> CREATE TABLE SZUPER7 AS (SELECT * FROM SZUPER6 WHERE 1 = 0);
  271. Query OK, 0 rows affected (0.01 sec)
  272. Records: 0  Duplicates: 0  Warnings: 0
  273.  
  274. MariaDB [SZUPER5]> SHOW TABLES ;
  275. +-------------------+
  276. | Tables_in_szuper5 |
  277. +-------------------+
  278. | szuper5           |
  279. | szuper6           |
  280. | szuper7           |
  281. +-------------------+
  282. 3 rows in set (0.00 sec)
  283.  
  284. MariaDB [SZUPER5]> SHOW TABLE SZUPER7;
  285. 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 'SZUPER7' at line 1
  286. MariaDB [SZUPER5]> SELECT *FROM SZUPER7;
  287. Empty set (0.00 sec)
  288.  
  289. MariaDB [SZUPER5]> DESCRIBE SZUPER7;
  290. +-------------+-------------+------+-----+---------+-------+
  291. | Field       | Type        | Null | Key | Default | Extra |
  292. +-------------+-------------+------+-----+---------+-------+
  293. | id          | int(11)     | NO   |     | 0       |       |
  294. | nazwisko    | varchar(40) | NO   |     | NULL    |       |
  295. | imie        | varchar(40) | NO   |     | NULL    |       |
  296. | etat        | varchar(20) | NO   |     | NULL    |       |
  297. | dzial       | int(11)     | NO   |     | NULL    |       |
  298. | pracuje_od  | date        | NO   |     | NULL    |       |
  299. | placa_podst | int(11)     | NO   |     | NULL    |       |
  300. | placa_dodat | int(11)     | NO   |     | NULL    |       |
  301. | premia      | int(11)     | NO   |     | NULL    |       |
  302. +-------------+-------------+------+-----+---------+-------+
  303. 9 rows in set (0.00 sec)
  304.  
  305. MariaDB [SZUPER5]> SELECT *FROM SZUPER;
  306. ERROR 1146 (42S02): Table 'szuper5.szuper' doesn't exist
  307. MariaDB [SZUPER5]> SELECT *FROM SZUPER2;
  308. ERROR 1146 (42S02): Table 'szuper5.szuper2' doesn't exist
  309. MariaDB [SZUPER5]> SELECT *FROM SZUPER5;
  310. +----+---------+----------+-------------+-----------------+----------------------+
  311. | id | imie    | nazwisko | miejscowosc | telefon         | email                |
  312. +----+---------+----------+-------------+-----------------+----------------------+
  313. |  1 | Piotr   | Kowalski | Warszawa    | 075 145 345 344 | [email protected] |
  314. |  2 | Andrzej | Romaniuk | Wrocław     | 075 144 335 333 | [email protected] |
  315. |  3 | Piotr   | Kamiński | Poznań      | 075 255 355 444 | [email protected] |
  316. +----+---------+----------+-------------+-----------------+----------------------+
  317. 3 rows in set (0.00 sec)
  318.  
  319. MariaDB [SZUPER5]> INSERT INTO SZUPER6;
  320. 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
  321. MariaDB [SZUPER5]> INSERT IN TO SZUPER6;
  322. 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 'IN TO SZUPER6' at line 1
  323. MariaDB [SZUPER5]> INSERT INTO SZUPER6 (id, imie);
  324. 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
  325. MariaDB [SZUPER5]> INSERT INTO SZUPER6
  326.     -> (id,imie,nazwisko,miejscowosc,telefon)
  327.     -> VALUES
  328.     -> ('','JAN','KOWALSKI','JELENIA GORA', '123456789');
  329. ERROR 1054 (42S22): Unknown column 'miejscowosc' in 'field list'
  330. MariaDB [SZUPER5]> INSERT INTO SZUPER5
  331.     -> (id,imie,nazwisko,miejscowosc,telefon)
  332.     -> VALUES
  333.     -> (id,imie,nazwisko,miejscowosc,telefon)
  334.     -> `
  335.     `> ;
  336.     `> Bye
  337.  
  338. sala207@S207-01 c:\xampp
  339. # mysql -h localhost -u root -p
  340. Enter password: *
  341. ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
  342.  
  343. sala207@S207-01 c:\xampp
  344. # mysql -h localhost -u root -p
  345. Enter password:
  346. Welcome to the MariaDB monitor.  Commands end with ; or \g.
  347. Your MariaDB connection id is 7
  348. Server version: 10.1.19-MariaDB mariadb.org binary distribution
  349.  
  350. Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
  351.  
  352. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
  353.  
  354. MariaDB [(none)]> INSERT INTO SZUPER5
  355.     -> (id,imie,nazwisko,miejscowosc,telefon)
  356.     -> VALUES
  357.     -> (id,imie,nazwisko,miejscowosc,telefon)
  358.     -> ;
  359. ERROR 1046 (3D000): No database selected
  360. MariaDB [(none)]> USE SZUPER5;
  361. Database changed
  362. MariaDB [SZUPER5]> INSERT INTO SZUPER5
  363.     -> (id,imie,nazwisko,miejscowosc,telefon)
  364.     -> VALUES
  365.     -> ('','JAN','KOWALSKI','JELENIA GORA', '123456789');
  366. Query OK, 1 row affected, 1 warning (0.00 sec)
  367.  
  368. MariaDB [SZUPER5]> SELECT * from SZUPER5;
  369. +----+---------+----------+--------------+-----------------+----------------------+
  370. | id | imie    | nazwisko | miejscowosc  | telefon         | email                |
  371. +----+---------+----------+--------------+-----------------+----------------------+
  372. |  1 | Piotr   | Kowalski | Warszawa     | 075 145 345 344 | [email protected] |
  373. |  2 | Andrzej | Romaniuk | Wrocław      | 075 144 335 333 | [email protected] |
  374. |  3 | Piotr   | Kamiński | Poznań       | 075 255 355 444 | [email protected] |
  375. |  4 | JAN     | KOWALSKI | JELENIA GORA | 123456789       | NULL                 |
  376. +----+---------+----------+--------------+-----------------+----------------------+
  377. 4 rows in set (0.00 sec)
  378.  
  379. MariaDB [SZUPER5]> SELECT INTO SZUPER5 SET id='2', imie='Jan', nazwisko = 'Skiba', telefon='123456789',miejscowosc='Karpacz';
  380. 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 'INTO SZUPER5 SET id='2', imie='Jan', nazwisko = 'Skiba', telefon='123456789',mie' at line 1
  381. MariaDB [SZUPER5]> SELECT INTO SZUPER5 SET id='2', imie='Jan', nazwisko = 'Trzydziesci', telefon='123456789',miejscowosc='Karpacz';
  382. 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 'INTO SZUPER5 SET id='2', imie='Jan', nazwisko = 'Trzydziesci', telefon='12345678' at line 1
  383. MariaDB [SZUPER5]> SELECT INTO SZUPER5 SET id='2', imie='Jan', nazwisko = 'Trzydziesci', telefon='123456789',miejscowosc='Karpacz';
  384. 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 'INTO SZUPER5 SET id='2', imie='Jan', nazwisko = 'Trzydziesci', telefon='12345678' at line 1
  385. MariaDB [SZUPER5]> INSERT INTO SZUPER5 SET id='2', imie='Jan', nazwisko = 'Trzydziesci', telefon='123456789',miejscowosc='Karpacz';
  386. ERROR 1062 (23000): Duplicate entry '2' for key 'PRIMARY'
  387. MariaDB [SZUPER5]> SELECT INTO SZUPER5 SET id='12', imie='Jan', nazwisko = 'Skiba', telefon='123456789',miejscowosc='Karpacz';
  388. 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 'INTO SZUPER5 SET id='12', imie='Jan', nazwisko = 'Skiba', telefon='123456789',mi' at line 1
  389. MariaDB [SZUPER5]> SELECT INTO SZUPER5 SET id='12', imie='Jan', nazwisko = 'Skiba', telefon='123456789',miejscowosc='Karpacz';
  390. 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 'INTO SZUPER5 SET id='12', imie='Jan', nazwisko = 'Skiba', telefon='123456789',mi' at line 1
  391. MariaDB [SZUPER5]> INSERT INTO SZUPER5 SET id='2', imie='Jan', nazwisko = 'Trzydziesci', telefon='123456789',miejscowosc='Karpacz';
  392. ERROR 1062 (23000): Duplicate entry '2' for key 'PRIMARY'
  393. MariaDB [SZUPER5]> INSERT INTO SZUPER5 SET id='12', imie='Jan', nazwisko = 'Trzydziesci', telefon='123456789',miejscowosc='Karpacz';
  394. Query OK, 1 row affected (0.00 sec)
  395.  
  396. MariaDB [SZUPER5]> SELECT * from SZUPER5;
  397. +----+---------+-------------+--------------+-----------------+----------------------+
  398. | id | imie    | nazwisko    | miejscowosc  | telefon         | email                |
  399. +----+---------+-------------+--------------+-----------------+----------------------+
  400. |  1 | Piotr   | Kowalski    | Warszawa     | 075 145 345 344 | [email protected] |
  401. |  2 | Andrzej | Romaniuk    | Wrocław      | 075 144 335 333 | [email protected] |
  402. |  3 | Piotr   | Kamiński    | Poznań       | 075 255 355 444 | [email protected] |
  403. |  4 | JAN     | KOWALSKI    | JELENIA GORA | 123456789       | NULL                 |
  404. | 12 | Jan     | Trzydziesci | Karpacz      | 123456789       | NULL                 |
  405. +----+---------+-------------+--------------+-----------------+----------------------+
  406. 5 rows in set (0.00 sec)
  407.  
  408. MariaDB [SZUPER5]> INSERT INTO SZUPER5 (NAZWA,DATA) VALUES (MAREK, DZISIAJ),(10,20);
  409. ERROR 1054 (42S22): Unknown column 'MAREK' in 'field list'
  410. MariaDB [SZUPER5]> INSERT INTO SZUPER5 (NAZWA,DATA) VALUES (nazwisko, telefon),(10,20);
  411. ERROR 1054 (42S22): Unknown column 'NAZWA' in 'field list'
  412. MariaDB [SZUPER5]> INSERT INTO SZUPER5 (telefon,email) VALUES (nazwisko, telefon),(10,20);
  413. Query OK, 2 rows affected (0.00 sec)
  414. Records: 2  Duplicates: 0  Warnings: 0
  415.  
  416. MariaDB [SZUPER5]> SELECT * from SZUPER5;
  417. +----+---------+-------------+--------------+-----------------+----------------------+
  418. | id | imie    | nazwisko    | miejscowosc  | telefon         | email                |
  419. +----+---------+-------------+--------------+-----------------+----------------------+
  420. |  1 | Piotr   | Kowalski    | Warszawa     | 075 145 345 344 | [email protected] |
  421. |  2 | Andrzej | Romaniuk    | Wrocław      | 075 144 335 333 | [email protected] |
  422. |  3 | Piotr   | Kamiński    | Poznań       | 075 255 355 444 | [email protected] |
  423. |  4 | JAN     | KOWALSKI    | JELENIA GORA | 123456789       | NULL                 |
  424. | 12 | Jan     | Trzydziesci | Karpacz      | 123456789       | NULL                 |
  425. | 13 | NULL    | NULL        | NULL         | NULL            | NULL                 |
  426. | 14 | NULL    | NULL        | NULL         | 10              | 20                   |
  427. +----+---------+-------------+--------------+-----------------+----------------------+
  428. 7 rows in set (0.00 sec)
  429.  
  430. MariaDB [SZUPER5]> INSERT INTO SZUPER5 (miejscowosc,telefon) VALUES (nazwisko, telefon),(10,20);
  431. Query OK, 2 rows affected (0.00 sec)
  432. Records: 2  Duplicates: 0  Warnings: 0
  433.  
  434. MariaDB [SZUPER5]> SELECT * from SZUPER5;
  435. +----+---------+-------------+--------------+-----------------+----------------------+
  436. | id | imie    | nazwisko    | miejscowosc  | telefon         | email                |
  437. +----+---------+-------------+--------------+-----------------+----------------------+
  438. |  1 | Piotr   | Kowalski    | Warszawa     | 075 145 345 344 | [email protected] |
  439. |  2 | Andrzej | Romaniuk    | Wrocław      | 075 144 335 333 | [email protected] |
  440. |  3 | Piotr   | Kamiński    | Poznań       | 075 255 355 444 | [email protected] |
  441. |  4 | JAN     | KOWALSKI    | JELENIA GORA | 123456789       | NULL                 |
  442. | 12 | Jan     | Trzydziesci | Karpacz      | 123456789       | NULL                 |
  443. | 13 | NULL    | NULL        | NULL         | NULL            | NULL                 |
  444. | 14 | NULL    | NULL        | NULL         | 10              | 20                   |
  445. | 15 | NULL    | NULL        | NULL         | NULL            | NULL                 |
  446. | 16 | NULL    | NULL        | 10           | 20              | NULL                 |
  447. +----+---------+-------------+--------------+-----------------+----------------------+
  448. 9 rows in set (0.00 sec)
  449.  
  450. MariaDB [SZUPER5]> INSERT INTO SZUPER5 (telefon,email) VALUES (karpacz, 123456789),(krakow,123456720);
  451. ERROR 1054 (42S22): Unknown column 'karpacz' in 'field list'
  452. MariaDB [SZUPER5]> SELECT * from SZUPER5;
  453. +----+---------+-------------+--------------+-----------------+----------------------+
  454. | id | imie    | nazwisko    | miejscowosc  | telefon         | email                |
  455. +----+---------+-------------+--------------+-----------------+----------------------+
  456. |  1 | Piotr   | Kowalski    | Warszawa     | 075 145 345 344 | [email protected] |
  457. |  2 | Andrzej | Romaniuk    | Wrocław      | 075 144 335 333 | [email protected] |
  458. |  3 | Piotr   | Kamiński    | Poznań       | 075 255 355 444 | [email protected] |
  459. |  4 | JAN     | KOWALSKI    | JELENIA GORA | 123456789       | NULL                 |
  460. | 12 | Jan     | Trzydziesci | Karpacz      | 123456789       | NULL                 |
  461. | 13 | NULL    | NULL        | NULL         | NULL            | NULL                 |
  462. | 14 | NULL    | NULL        | NULL         | 10              | 20                   |
  463. | 15 | NULL    | NULL        | NULL         | NULL            | NULL                 |
  464. | 16 | NULL    | NULL        | 10           | 20              | NULL                 |
  465. +----+---------+-------------+--------------+-----------------+----------------------+
  466. 9 rows in set (0.00 sec)
  467.  
  468. MariaDB [SZUPER5]> INSERT INTO SZUPER5 (miejscowosc,telefon) VALUES (karpacz, 123456789),(karpacz,123456720);
  469. ERROR 1054 (42S22): Unknown column 'karpacz' in 'field list'
  470. MariaDB [SZUPER5]> INSERT INTO SZUPER5 (miejscowosc,telefon) VALUES (karpacz, 123456789),(karpacz,123456720);
  471. ERROR 1054 (42S22): Unknown column 'karpacz' in 'field list'
  472. MariaDB [SZUPER5]> INSERT INTO SZUPER5 (miejscowosc,telefon) VALUES ('karpacz', 123456789),('karpacz',123456720);
  473. Query OK, 2 rows affected (0.00 sec)
  474. Records: 2  Duplicates: 0  Warnings: 0
  475.  
  476. MariaDB [SZUPER5]> SELECT * from SZUPER5;
  477. +----+---------+-------------+--------------+-----------------+----------------------+
  478. | id | imie    | nazwisko    | miejscowosc  | telefon         | email                |
  479. +----+---------+-------------+--------------+-----------------+----------------------+
  480. |  1 | Piotr   | Kowalski    | Warszawa     | 075 145 345 344 | [email protected] |
  481. |  2 | Andrzej | Romaniuk    | Wrocław      | 075 144 335 333 | [email protected] |
  482. |  3 | Piotr   | Kamiński    | Poznań       | 075 255 355 444 | [email protected] |
  483. |  4 | JAN     | KOWALSKI    | JELENIA GORA | 123456789       | NULL                 |
  484. | 12 | Jan     | Trzydziesci | Karpacz      | 123456789       | NULL                 |
  485. | 13 | NULL    | NULL        | NULL         | NULL            | NULL                 |
  486. | 14 | NULL    | NULL        | NULL         | 10              | 20                   |
  487. | 15 | NULL    | NULL        | NULL         | NULL            | NULL                 |
  488. | 16 | NULL    | NULL        | 10           | 20              | NULL                 |
  489. | 17 | NULL    | NULL        | karpacz      | 123456789       | NULL                 |
  490. | 18 | NULL    | NULL        | karpacz      | 123456720       | NULL                 |
  491. +----+---------+-------------+--------------+-----------------+----------------------+
  492. 11 rows in set (0.00 sec)
  493.  
  494. MariaDB [SZUPER5]>
  495.  
  496.  
  497.  
  498.