Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 2 to server version: 5.0.20a-nt
Type 'help;' or '\h' for help. Type '\c' to clear the buffer.
mysql> use 4tf;
Database changed
mysql> select imie, nazwisko from dane_4tf order by data_ur limit 1;
+-------+----------+
| imie | nazwisko |
+-------+----------+
| Kamil | Łaski |
+-------+----------+
1 row in set (0.05 sec)
mysql> show table dane_4tf;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to
ear 'dane_4tf' at line 1
mysql> show dane_4tf;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to
ear 'dane_4tf' at line 1
mysql> select * from dane_4tf;
+----+-----------+---------------+-------------+----------------+------------+----------------+--------+
| ID | imie | nazwisko | ulica | miasto | data_ur | miejsce_pracy | pensja |
+----+-----------+---------------+-------------+----------------+------------+----------------+--------+
| 1 | Kamil | Łaski | Stasiówka | Łomazy | 1990-02-02 | Biała Podlaska | 10000 |
| 2 | Justyna | Siemiątkowska | Warszawska | Biała Podlaska | 1992-04-03 | Warszawa | 9000 |
| 3 | Łukasz | Szymczuk | Nowa | Rososz | 1992-01-01 | Kielce | 8000 |
| 4 | Rafał | Stobiecki | Warszawska | Biała Podlaska | 1992-01-03 | Szczecin | 7000 |
| 5 | Paweł | Koprianiuk | słoneczna | Rososz | 1992-07-07 | Parczew | 6000 |
| 6 | Grzegorz | Mackiewicz | Brzeska | Biała Podlaska | 1993-01-06 | Lublin | 5000 |
| 7 | Marcin | Dżyg | Janowska | Biała Podlaska | 1994-09-12 | Toruń | 4000 |
| 8 | Sebastian | Lewkowicz | Lipowa | Biała Podlaska | 1994-03-21 | Kraków | 3000 |
| 9 | Grzegorz | Sidoruk | Narutowicza | Warszawa | 1993-02-22 | Gdynia | 2000 |
+----+-----------+---------------+-------------+----------------+------------+----------------+--------+
9 rows in set (0.00 sec)
mysql> select imie, nazwisko from dane_4tf order by data_ur limit 1;
+-------+----------+
| imie | nazwisko |
+-------+----------+
| Kamil | Łaski |
+-------+----------+
1 row in set (0.00 sec)
mysql> select imie, nazwisko, data_ur from dane_4tf order by data_ur limit 1;
+-------+----------+------------+
| imie | nazwisko | data_ur |
+-------+----------+------------+
| Kamil | Łaski | 1990-02-02 |
+-------+----------+------------+
1 row in set (0.00 sec)
mysql> select now();
+---------------------+
| now() |
+---------------------+
| 2013-09-25 12:54:41 |
+---------------------+
1 row in set (0.00 sec)
mysql> select date(now());
+-------------+
| date(now()) |
+-------------+
| 2013-09-25 |
+-------------+
1 row in set (0.00 sec)
mysql> select year(data_ur) from dane_4tf;
+---------------+
| year(data_ur) |
+---------------+
| 1990 |
| 1992 |
| 1992 |
| 1992 |
| 1992 |
| 1993 |
| 1994 |
| 1994 |
| 1993 |
+---------------+
9 rows in set (0.00 sec)
mysql> select * from dane_4tf where year(data_ur)>1994;
Empty set (0.00 sec)
mysql> select * from dane_4tf where year(data_ur)==1994;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to
ear '==1994' at line 1
mysql> select * from dane_4tf where year(data_ur)=1994;
+----+-----------+-----------+----------+----------------+------------+---------------+--------+
| ID | imie | nazwisko | ulica | miasto | data_ur | miejsce_pracy | pensja |
+----+-----------+-----------+----------+----------------+------------+---------------+--------+
| 7 | Marcin | Dżyg | Janowska | Biała Podlaska | 1994-09-12 | Toruń | 4000 |
| 8 | Sebastian | Lewkowicz | Lipowa | Biała Podlaska | 1994-03-21 | Kraków | 3000 |
+----+-----------+-----------+----------+----------------+------------+---------------+--------+
2 rows in set (0.00 sec)
mysql> select * from dane_4tf where month(data_ur) beetwen 06 and 09;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to
ear 'beetwen 06 and 09' at line 1
mysql> select * from dane_4tf where month(data_ur) beetwen '06' and '09';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to
ear 'beetwen '06' and '09'' at line 1
mysql> select * from dane_4tf where month(data_ur) beetwen 6 and 9;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to
ear 'beetwen 6 and 9' at line 1
mysql> select * from dane_4tf where month(data_ur) between 6 and 9;
+----+--------+------------+-----------+----------------+------------+---------------+--------+
| ID | imie | nazwisko | ulica | miasto | data_ur | miejsce_pracy | pensja |
+----+--------+------------+-----------+----------------+------------+---------------+--------+
| 5 | Paweł | Koprianiuk | słoneczna | Rososz | 1992-07-07 | Parczew | 6000 |
| 7 | Marcin | Dżyg | Janowska | Biała Podlaska | 1994-09-12 | Toruń | 4000 |
+----+--------+------------+-----------+----------------+------------+---------------+--------+
2 rows in set (0.01 sec)
mysql> select imie, nazwisko, pensja*12 as pensja_roczna;
ERROR 1054 (42S22): Unknown column 'imie' in 'field list'
mysql> select imie, nazwisko, pensja*12 as pensja_roczna from dane_4tf;;
+-----------+---------------+---------------+
| imie | nazwisko | pensja_roczna |
+-----------+---------------+---------------+
| Kamil | Łaski | 120000 |
| Justyna | Siemiątkowska | 108000 |
| Łukasz | Szymczuk | 96000 |
| Rafał | Stobiecki | 84000 |
| Paweł | Koprianiuk | 72000 |
| Grzegorz | Mackiewicz | 60000 |
| Marcin | Dżyg | 48000 |
| Sebastian | Lewkowicz | 36000 |
| Grzegorz | Sidoruk | 24000 |
+-----------+---------------+---------------+
9 rows in set (0.00 sec)
ERROR:
No query specified
mysql> select * from dane_4tf;
+----+-----------+---------------+-------------+----------------+------------+----------------+--------+
| ID | imie | nazwisko | ulica | miasto | data_ur | miejsce_pracy | pensja |
+----+-----------+---------------+-------------+----------------+------------+----------------+--------+
| 1 | Kamil | Łaski | Stasiówka | Łomazy | 1990-02-02 | Biała Podlaska | 10000 |
| 2 | Justyna | Siemiątkowska | Warszawska | Biała Podlaska | 1992-04-03 | Warszawa | 9000 |
| 3 | Łukasz | Szymczuk | Nowa | Rososz | 1992-01-01 | Kielce | 8000 |
| 4 | Rafał | Stobiecki | Warszawska | Biała Podlaska | 1992-01-03 | Szczecin | 7000 |
| 5 | Paweł | Koprianiuk | słoneczna | Rososz | 1992-07-07 | Parczew | 6000 |
| 6 | Grzegorz | Mackiewicz | Brzeska | Biała Podlaska | 1993-01-06 | Lublin | 5000 |
| 7 | Marcin | Dżyg | Janowska | Biała Podlaska | 1994-09-12 | Toruń | 4000 |
| 8 | Sebastian | Lewkowicz | Lipowa | Biała Podlaska | 1994-03-21 | Kraków | 3000 |
| 9 | Grzegorz | Sidoruk | Narutowicza | Warszawa | 1993-02-22 | Gdynia | 2000 |
+----+-----------+---------------+-------------+----------------+------------+----------------+--------+
9 rows in set (0.00 sec)
mysql> select imie, nazwisko, pensja*12 as pensja_roczna from dane_4tf;;
+-----------+---------------+---------------+
| imie | nazwisko | pensja_roczna |
+-----------+---------------+---------------+
| Kamil | Łaski | 120000 |
| Justyna | Siemiątkowska | 108000 |
| Łukasz | Szymczuk | 96000 |
| Rafał | Stobiecki | 84000 |
| Paweł | Koprianiuk | 72000 |
| Grzegorz | Mackiewicz | 60000 |
| Marcin | Dżyg | 48000 |
| Sebastian | Lewkowicz | 36000 |
| Grzegorz | Sidoruk | 24000 |
+-----------+---------------+---------------+
9 rows in set (0.00 sec)
ERROR:
No query specified
mysql> select imie, nazwisko, pensja*12 as pensja_roczna from dane_4tf order by pensja limit 1;
+-------+----------+---------------+
| imie | nazwisko | pensja_roczna |
+-------+----------+---------------+
| Kamil | Łaski | 120000 |
+-------+----------+---------------+
1 row in set (0.00 sec)
mysql> select imie, nazwisko, data_ur, year(now) - year(data_ur) as wiek from dane_4tf where (year(now))-year(data_ur)>18;
ERROR 1054 (42S22): Unknown column 'now' in 'field list'
mysql> select imie, nazwisko, data_ur, year(now)-year(data_ur) as wiek from dane_4tf where (year(now))-year(data_ur)>18;
ERROR 1054 (42S22): Unknown column 'now' in 'field list'
mysql> select imie, nazwisko, data_ur, year(now())-year(data_ur) as wiek from dane_4tf where (year(now))-year(data_ur)>18;
ERROR 1054 (42S22): Unknown column 'now' in 'where clause'
mysql> select imie, nazwisko, data_ur, year(now())-year(data_ur) as wiek from dane_4tf where (year(now()))-year(data_ur)>18;
+-----------+---------------+------------+------+
| imie | nazwisko | data_ur | wiek |
+-----------+---------------+------------+------+
| Kamil | Łaski | 1990-02-02 | 23 |
| Justyna | Siemiątkowska | 1992-04-03 | 21 |
| Łukasz | Szymczuk | 1992-01-01 | 21 |
| Rafał | Stobiecki | 1992-01-03 | 21 |
| Paweł | Koprianiuk | 1992-07-07 | 21 |
| Grzegorz | Mackiewicz | 1993-01-06 | 20 |
| Marcin | Dżyg | 1994-09-12 | 19 |
| Sebastian | Lewkowicz | 1994-03-21 | 19 |
| Grzegorz | Sidoruk | 1993-02-22 | 20 |
+-----------+---------------+------------+------+
9 rows in set (0.00 sec)
mysql> select imie, nazwisko, pensja*0,23*12 as podatek_roczny from dane_4tf order by pensja;
+-----------+---------------+----------+----------------+
| imie | nazwisko | pensja*0 | podatek_roczny |
+-----------+---------------+----------+----------------+
| Kamil | Łaski | 0 | 276 |
| Grzegorz | Sidoruk | 0 | 276 |
| Sebastian | Lewkowicz | 0 | 276 |
| Marcin | Dżyg | 0 | 276 |
| Grzegorz | Mackiewicz | 0 | 276 |
| Paweł | Koprianiuk | 0 | 276 |
| Rafał | Stobiecki | 0 | 276 |
| Łukasz | Szymczuk | 0 | 276 |
| Justyna | Siemiątkowska | 0 | 276 |
+-----------+---------------+----------+----------------+
9 rows in set (0.00 sec)
mysql> select imie, nazwisko, pensja*0.23*12 as podatek_roczny from dane_4tf order by pensja;
+-----------+---------------+----------------+
| imie | nazwisko | podatek_roczny |
+-----------+---------------+----------------+
| Kamil | Łaski | 27600 |
| Grzegorz | Sidoruk | 5520 |
| Sebastian | Lewkowicz | 8280 |
| Marcin | Dżyg | 11040 |
| Grzegorz | Mackiewicz | 13800 |
| Paweł | Koprianiuk | 16560 |
| Rafał | Stobiecki | 19320 |
| Łukasz | Szymczuk | 22080 |
| Justyna | Siemiątkowska | 24840 |
+-----------+---------------+----------------+
9 rows in set (0.00 sec)
mysql> select imie, nazwisko, pensja*0.23*12 as podatek_roczny from dane_4tf order by podatek_roczny;
+-----------+---------------+----------------+
| imie | nazwisko | podatek_roczny |
+-----------+---------------+----------------+
| Grzegorz | Sidoruk | 5520 |
| Sebastian | Lewkowicz | 8280 |
| Marcin | Dżyg | 11040 |
| Grzegorz | Mackiewicz | 13800 |
| Paweł | Koprianiuk | 16560 |
| Rafał | Stobiecki | 19320 |
| Łukasz | Szymczuk | 22080 |
| Justyna | Siemiątkowska | 24840 |
| Kamil | Łaski | 27600 |
+-----------+---------------+----------------+
9 rows in set (0.00 sec)
mysql>
Wyszukiwarka
Podobne podstrony:
plan zajec 13 (25 09) dzienne rok1 sem1Wykład 2 25 09 201125 03 201325 10 2013 Gruca PodstWF Irok Wstęp Jak 03 09 2013[1] 2(1)16 09 2013 zadFIZYKOTERAPIA 25 09 2011rKonspekt NGCC (24 25 10 2013)Literaturoznawstwo (25 03 2013)więcej podobnych podstron