Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Setting environment for using XAMPP for Windows.
- uczen@X7-13 c:\xampp
- # mysql -u root
- Welcome to the MariaDB monitor. Commands end with ; or \g.
- Your MariaDB connection id is 2
- Server version: 10.1.13-MariaDB mariadb.org binary distribution
- Copyright (c) 2000, 2016, Oracle, MariaDB Corporation Ab and others.
- Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
- MariaDB [(none)]> show databases;
- +--------------------+
- | Database |
- +--------------------+
- | 3i_finanse |
- | finanse_3a |
- | information_schema |
- | mysql |
- | performance_schema |
- | phpmyadmin |
- | sklepik |
- | tesco |
- | test |
- | werka4a |
- +--------------------+
- 10 rows in set (0.03 sec)
- MariaDB [(none)]> use finanse_3a;
- Database changed
- MariaDB [finanse_3a]> select Klient_id,Nazwa_klienta from klienci;
- +-----------+------------------+
- | Klient_id | Nazwa_klienta |
- +-----------+------------------+
- | 1 | ACME Industries |
- | 2 | Winesburg Press |
- | 3 | ABC Noun |
- | 4 | Galt on the Hill |
- | 5 | The Enterprises |
- | 6 | Something Clever |
- | 7 | Another Client |
- | 8 | Nepotism Inc. |
- +-----------+------------------+
- 8 rows in set (0.00 sec)
- MariaDB [finanse_3a]> select wartosc_wydatku *12 from wydatki where wydatki_id =1;
- ERROR 1054 (42S22): Unknown column 'wydatki_id' in 'where clause'
- MariaDB [finanse_3a]> select Wartosc_wydatku *12 from wydatki where wydatki_id =1;
- ERROR 1054 (42S22): Unknown column 'wydatki_id' in 'where clause'
- MariaDB [finanse_3a]> select Wartosc_wydatku *12 from wydatki where Wydatek_id =1;
- +---------------------+
- | Wartosc_wydatku *12 |
- +---------------------+
- | 239.88 |
- +---------------------+
- 1 row in set (0.00 sec)
- MariaDB [finanse_3a]> select Wartosc_wydatku *12 as cena from wydatki where Wydatek_id =1;
- +--------+
- | cena |
- +--------+
- | 239.88 |
- +--------+
- 1 row in set (0.00 sec)
- MariaDB [finanse_3a]> select disint klient_id
- -> ;
- ERROR 1054 (42S22): Unknown column 'disint' in 'field list'
- MariaDB [finanse_3a]> ;
- ERROR: No query specified
- MariaDB [finanse_3a]> ;
- ERROR: No query specified
- MariaDB [finanse_3a]> ;
- ERROR: No query specified
- MariaDB [finanse_3a]> ;
- ERROR: No query specified
- MariaDB [finanse_3a]>
- MariaDB [finanse_3a]> ;
- ERROR: No query specified
- MariaDB [finanse_3a]> ;
- ERROR: No query specified
- MariaDB [finanse_3a]> select distinct klient_id from faktury where klient_id <4;
- +-----------+
- | klient_id |
- +-----------+
- | 3 |
- | 2 |
- | 1 |
- +-----------+
- 3 rows in set (0.01 sec)
- MariaDB [finanse_3a]> select klient_id , data_faktury from faktury order by data_faktury desc;
- +-----------+--------------+
- | klient_id | data_faktury |
- +-----------+--------------+
- | 3 | 2004-11-20 |
- | 3 | 2004-07-20 |
- | 1 | 2004-01-02 |
- | 8 | 2003-10-24 |
- | 2 | 2003-07-20 |
- | 2 | 2003-07-18 |
- | 3 | 2003-04-08 |
- | 4 | 2002-12-24 |
- | 3 | 2002-07-20 |
- | 4 | 2002-04-24 |
- | 4 | 2002-04-24 |
- | 3 | 2002-04-24 |
- | 2 | 2002-04-22 |
- | 1 | 2002-04-10 |
- | 7 | 2001-07-27 |
- | 5 | 2001-07-03 |
- +-----------+--------------+
- 16 rows in set (0.00 sec)
- MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%";
- +-----------+-----------------+
- | klient_id | Nazwa_klienta |
- +-----------+-----------------+
- | 1 | ACME Industries |
- | 3 | ABC Noun |
- | 7 | Another Client |
- +-----------+-----------------+
- 3 rows in set (0.00 sec)
- MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%" and ulica_klienta is null;
- Empty set (0.00 sec)
- MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%" and ulica_klienta like;
- 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
- MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%" and ulica_klienta like " ";
- Empty set (0.00 sec)
- MariaDB [finanse_3a]> select * from klienci;
- +-----------+------------------+-------------------+----------------+--------------+----------------------+-----------------+-------------------+--------------------------+
- | klient_id | nazwa_klienta | ulica_klienta | miasto_klienta | stan_klienta | kod_pocztowy_klienta | telefon_klienta | osoba_kontaktowa | email_kontaktowy |
- +-----------+------------------+-------------------+----------------+--------------+----------------------+-----------------+-------------------+--------------------------+
- | 1 | ACME Industries | 100 Main Street | Anytown | NY | 11111 | (800)555-1234 | Jane Doe | doe@acme.com |
- | 2 | Winesburg Press | | Garbee | LA | 12345 | | Sherwood Anderson | |
- | 3 | ABC Noun | | Berlin | | 0 | | Clarissa Joens | clarisa@winesburg.de |
- | 4 | Galt on the Hill | 1000 tutle Drive | Brazilia | IL | 60000 | | John Smit | |
- | 5 | The Enterprises | 500 Main Street | Anytown | NY | 55555 | (800)555-1923 | John Doe | Jonny_D@enterprisees.com |
- | 6 | Something Clever | 13 Downing Street | London | L | 16777215 | (788)676-987 | Deryl Zero | Zero_0@clever.uk |
- | 7 | Another Client | | Garbee | LA | 12346 | | Art Vander Lay | avi@client.com |
- | 8 | Nepotism Inc. | 23 Martin Strasse | Manheim | SZ | 3232322 | (66)4784-8909 | James Blond | jblond@neopotism.de |
- +-----------+------------------+-------------------+----------------+--------------+----------------------+-----------------+-------------------+--------------------------+
- 8 rows in set (0.00 sec)
- MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%" and ulica_klienta like "%";
- +-----------+-----------------+
- | klient_id | Nazwa_klienta |
- +-----------+-----------------+
- | 1 | ACME Industries |
- | 3 | ABC Noun |
- | 7 | Another Client |
- +-----------+-----------------+
- 3 rows in set (0.00 sec)
- MariaDB [finanse_3a]> select klient_id,Nazwa_klienta from klienci where Nazwa_klienta like "a%" and ulica_klienta like "";
- +-----------+----------------+
- | klient_id | Nazwa_klienta |
- +-----------+----------------+
- | 3 | ABC Noun |
- | 7 | Another Client |
- +-----------+----------------+
- 2 rows in set (0.00 sec)
- MariaDB [finanse_3a]>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement