фцужэнгшүзкъ\
йыбөахролдп
ячёсмитьвю
=№-"₮:._,%?ещ
+1234567890ЕЩ
ФЦУЖЭНГШҮЗКЪ
ЙЫБӨАХРОЛДП
ЯЧЁСМИТЬВЮ
+1234567890ЕЩ
Tuesday, September 30, 2014
Friday, September 26, 2014
22
,'1000');
Query OK, 1 row affected, 1 warning (0.03 sec)
mysql> insert into baraa values('EB1101', 'us butsal', '25000','China','0.5','75
0');
Query OK, 1 row affected, 1 warning (0.02 sec)
mysql> create table baraa1(code int(8), name char(50), price int(50),country cha
r(20), height float (20), number int (100));
Query OK, 0 rows affected (0.11 sec)
mysql> create table baraanuud(code char(8), name char(50), price int(50),country
char(20), height float (20), number int (100));
Query OK, 0 rows affected (0.10 sec)
mysql> insert into baraanuud values('EB1010', 'Zuragt', '1500000','Yapon','5','1
00');
Query OK, 1 row affected (0.03 sec)
mysql> insert into baraanuud values('EB1101', 'Toos sorogch', '350000','China','
0.5','1000');
Query OK, 1 row affected (0.01 sec)
mysql> insert into baraanuud values('EB1101', 'us butsalgagch', '25000','China',
'0.5','750');
Query OK, 1 row affected (0.03 sec)
mysql> insert into baraanuud values('EB1212', 'us butsalgagch', '25000','China',
'0.5','750');
Query OK, 1 row affected (0.02 sec)
mysql> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5','10
');
'> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5','10
');';
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 use near '5','1
0');
insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5',' at line
1
'> ';
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 use near '';
'' at line 1
mysql> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5','10
');
'> ';
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 use near '5','1
0');
'' at line 1
mysql> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand','5','1
0');
Query OK, 1 row affected (0.01 sec)
mysql> insert into baraanuud values('PC1123', 'Acer PC', '500000','Korea','5','1
0');
Query OK, 1 row affected (0.01 sec)
mysql> insert into baraanuud values('LP1010', 'Macbook Pro', '1500000','U.S.A','
2','10');
Query OK, 1 row affected (0.03 sec)
mysql> insert into baraanuud values('LP1211', 'Acer laptop', '1300000','Korea','
1','10');
Query OK, 1 row affected (0.02 sec)
mysql> select * from baraanuud;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| EB1212 | us butsalgagch | 25000 | China | 0.5 | 750 |
| PC1212 | HP PC | 450000 | Tailand | 5 | 10 |
| PC1123 | Acer PC | 500000 | Korea | 5 | 10 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
| LP1211 | Acer laptop | 1300000 | Korea | 1 | 10 |
+--------+----------------+---------+---------+--------+--------+
8 rows in set (0.12 sec)
mysql> select * from baraanuud where CODE like 'EB%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| EB1212 | us butsalgagch | 25000 | China | 0.5 | 750 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.04 sec)
mysql> select * from baraanuud where CODE like '%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.00 sec)
mysql> select * from baraanuud where CODE like '10%' order by CODE asc;
Empty set (0.00 sec)
mysql> select * from baraanuud where CODE like 'EB%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
+--------+----------------+---------+---------+--------+--------+
3 rows in set (0.00 sec)
mysql> select * from baraanuud where price>'1000000';
+--------+-------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
| LP1211 | Acer laptop | 1300000 | Korea | 1 | 10 |
+--------+-------------+---------+---------+--------+--------+
3 rows in set (0.02 sec)
mysql> select * from baraanuud where COUNTRY like 'korea'order by COUNTRY asc;
+--------+-------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| PC1123 | Acer PC | 500000 | Korea | 5 | 10 |
| LP1211 | Acer laptop | 1300000 | Korea | 1 | 10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)
mysql> select sum (height) from baraanuud;
ERROR 1305 (42000): FUNCTION baraa.sum does not exist
mysql> select sum(height) from baraanuud;
+-------------+
| sum(height) |
+-------------+
| 19.5 |
+-------------+
1 row in set (0.17 sec)
mysql> select * from baraanuud where CODE like '%10' order by CODE asc;
+--------+-------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)
mysql> select sum(price) from baraanuud;
+------------+
| sum(price) |
+------------+
| 5650000 |
+------------+
1 row in set (0.02 sec)
mysql> select avg(price) from baraanuud;
+-------------+
| avg(price) |
+-------------+
| 706250.0000 |
+-------------+
1 row in set (0.00 sec)
mysql> select min(price) from baraanuud;
+------------+
| min(price) |
+------------+
| 25000 |
+------------+
1 row in set (0.00 sec)
mysql> select * from baraanuud where price<'1000000';
+--------+----------------+--------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+--------+---------+--------+--------+
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| EB1212 | us butsalgagch | 25000 | China | 0.5 | 750 |
| PC1212 | HP PC | 450000 | Tailand | 5 | 10 |
| PC1123 | Acer PC | 500000 | Korea | 5 | 10 |
+--------+----------------+--------+---------+--------+--------+
5 rows in set (0.00 sec)
mysql> select * from baraanuud where price 3500000x100'';
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 use near '35000
00x100''' at line 1
mysql> select * from baraanuud where price'1000000*10';
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 use near ''1000
000*10'' at line 1
mysql> select * from baraanuud where price='1000000*10';
Empty set, 8 warnings (0.00 sec)
mysql> select * from baraanuud price='1000000*10';
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 use near '='100
0000*10'' at line 1
mysql> select price*number from baraanuud;
+--------------+
| price*number |
+--------------+
| 150000000 |
| 350000000 |
| 18750000 |
| 18750000 |
| 4500000 |
| 5000000 |
| 15000000 |
| 13000000 |
+--------------+
8 rows in set (0.04 sec)
mysql>
mysql> select name.zuragt price*number from baraanuud;
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 use near '*numb
er from baraanuud' at line 1
mysql> select (price*number) from baraanuud where name like 'zuragt';
+----------------+
| (price*number) |
+----------------+
| 150000000 |
+----------------+
1 row in set (0.01 sec)
mysql> select (height*number) from baraanuud where name like 'zuragt';
+-----------------+
| (height*number) |
+-----------------+
| 500 |
+-----------------+
1 row in set (0.00 sec)
mysql> select (height*number) and (price*number) from baraanuud where name like
'zuragt';
+------------------------------------+
| (height*number) and (price*number) |
+------------------------------------+
| 1 |
+------------------------------------+
1 row in set (0.01 sec)
mysql> select (height*number),(price*number) from baraanuud where name like 'zur
agt';
+-----------------+----------------+
| (height*number) | (price*number) |
+-----------------+----------------+
| 500 | 150000000 |
+-----------------+----------------+
1 row in set (0.00 sec)
mysql> select * from baraanuud where CODE like 'EB%10' order by CODE asc;
+--------+--------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+--------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
+--------+--------+---------+---------+--------+--------+
1 row in set (0.00 sec)
mysql> select * from baraanuud where CODE like '%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.00 sec)
mysql> select * from baraanuud where CODE like '%10' order by CODE asc;
+--------+-------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)
mysql> select * from baraanuud where CODE like '%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.00 sec)
mysql> select * from baraanuud where CODE like '' order by CODE asc;
Query OK, 1 row affected, 1 warning (0.03 sec)
mysql> insert into baraa values('EB1101', 'us butsal', '25000','China','0.5','75
0');
Query OK, 1 row affected, 1 warning (0.02 sec)
mysql> create table baraa1(code int(8), name char(50), price int(50),country cha
r(20), height float (20), number int (100));
Query OK, 0 rows affected (0.11 sec)
mysql> create table baraanuud(code char(8), name char(50), price int(50),country
char(20), height float (20), number int (100));
Query OK, 0 rows affected (0.10 sec)
mysql> insert into baraanuud values('EB1010', 'Zuragt', '1500000','Yapon','5','1
00');
Query OK, 1 row affected (0.03 sec)
mysql> insert into baraanuud values('EB1101', 'Toos sorogch', '350000','China','
0.5','1000');
Query OK, 1 row affected (0.01 sec)
mysql> insert into baraanuud values('EB1101', 'us butsalgagch', '25000','China',
'0.5','750');
Query OK, 1 row affected (0.03 sec)
mysql> insert into baraanuud values('EB1212', 'us butsalgagch', '25000','China',
'0.5','750');
Query OK, 1 row affected (0.02 sec)
mysql> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5','10
');
'> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5','10
');';
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 use near '5','1
0');
insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5',' at line
1
'> ';
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 use near '';
'' at line 1
mysql> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand,'5','10
');
'> ';
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 use near '5','1
0');
'' at line 1
mysql> insert into baraanuud values('PC1212', 'HP PC', '450000','Tailand','5','1
0');
Query OK, 1 row affected (0.01 sec)
mysql> insert into baraanuud values('PC1123', 'Acer PC', '500000','Korea','5','1
0');
Query OK, 1 row affected (0.01 sec)
mysql> insert into baraanuud values('LP1010', 'Macbook Pro', '1500000','U.S.A','
2','10');
Query OK, 1 row affected (0.03 sec)
mysql> insert into baraanuud values('LP1211', 'Acer laptop', '1300000','Korea','
1','10');
Query OK, 1 row affected (0.02 sec)
mysql> select * from baraanuud;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| EB1212 | us butsalgagch | 25000 | China | 0.5 | 750 |
| PC1212 | HP PC | 450000 | Tailand | 5 | 10 |
| PC1123 | Acer PC | 500000 | Korea | 5 | 10 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
| LP1211 | Acer laptop | 1300000 | Korea | 1 | 10 |
+--------+----------------+---------+---------+--------+--------+
8 rows in set (0.12 sec)
mysql> select * from baraanuud where CODE like 'EB%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| EB1212 | us butsalgagch | 25000 | China | 0.5 | 750 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.04 sec)
mysql> select * from baraanuud where CODE like '%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.00 sec)
mysql> select * from baraanuud where CODE like '10%' order by CODE asc;
Empty set (0.00 sec)
mysql> select * from baraanuud where CODE like 'EB%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
+--------+----------------+---------+---------+--------+--------+
3 rows in set (0.00 sec)
mysql> select * from baraanuud where price>'1000000';
+--------+-------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
| LP1211 | Acer laptop | 1300000 | Korea | 1 | 10 |
+--------+-------------+---------+---------+--------+--------+
3 rows in set (0.02 sec)
mysql> select * from baraanuud where COUNTRY like 'korea'order by COUNTRY asc;
+--------+-------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| PC1123 | Acer PC | 500000 | Korea | 5 | 10 |
| LP1211 | Acer laptop | 1300000 | Korea | 1 | 10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)
mysql> select sum (height) from baraanuud;
ERROR 1305 (42000): FUNCTION baraa.sum does not exist
mysql> select sum(height) from baraanuud;
+-------------+
| sum(height) |
+-------------+
| 19.5 |
+-------------+
1 row in set (0.17 sec)
mysql> select * from baraanuud where CODE like '%10' order by CODE asc;
+--------+-------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)
mysql> select sum(price) from baraanuud;
+------------+
| sum(price) |
+------------+
| 5650000 |
+------------+
1 row in set (0.02 sec)
mysql> select avg(price) from baraanuud;
+-------------+
| avg(price) |
+-------------+
| 706250.0000 |
+-------------+
1 row in set (0.00 sec)
mysql> select min(price) from baraanuud;
+------------+
| min(price) |
+------------+
| 25000 |
+------------+
1 row in set (0.00 sec)
mysql> select * from baraanuud where price<'1000000';
+--------+----------------+--------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+--------+---------+--------+--------+
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| EB1212 | us butsalgagch | 25000 | China | 0.5 | 750 |
| PC1212 | HP PC | 450000 | Tailand | 5 | 10 |
| PC1123 | Acer PC | 500000 | Korea | 5 | 10 |
+--------+----------------+--------+---------+--------+--------+
5 rows in set (0.00 sec)
mysql> select * from baraanuud where price 3500000x100'';
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 use near '35000
00x100''' at line 1
mysql> select * from baraanuud where price'1000000*10';
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 use near ''1000
000*10'' at line 1
mysql> select * from baraanuud where price='1000000*10';
Empty set, 8 warnings (0.00 sec)
mysql> select * from baraanuud price='1000000*10';
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 use near '='100
0000*10'' at line 1
mysql> select price*number from baraanuud;
+--------------+
| price*number |
+--------------+
| 150000000 |
| 350000000 |
| 18750000 |
| 18750000 |
| 4500000 |
| 5000000 |
| 15000000 |
| 13000000 |
+--------------+
8 rows in set (0.04 sec)
mysql>
mysql> select name.zuragt price*number from baraanuud;
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 use near '*numb
er from baraanuud' at line 1
mysql> select (price*number) from baraanuud where name like 'zuragt';
+----------------+
| (price*number) |
+----------------+
| 150000000 |
+----------------+
1 row in set (0.01 sec)
mysql> select (height*number) from baraanuud where name like 'zuragt';
+-----------------+
| (height*number) |
+-----------------+
| 500 |
+-----------------+
1 row in set (0.00 sec)
mysql> select (height*number) and (price*number) from baraanuud where name like
'zuragt';
+------------------------------------+
| (height*number) and (price*number) |
+------------------------------------+
| 1 |
+------------------------------------+
1 row in set (0.01 sec)
mysql> select (height*number),(price*number) from baraanuud where name like 'zur
agt';
+-----------------+----------------+
| (height*number) | (price*number) |
+-----------------+----------------+
| 500 | 150000000 |
+-----------------+----------------+
1 row in set (0.00 sec)
mysql> select * from baraanuud where CODE like 'EB%10' order by CODE asc;
+--------+--------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+--------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
+--------+--------+---------+---------+--------+--------+
1 row in set (0.00 sec)
mysql> select * from baraanuud where CODE like '%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.00 sec)
mysql> select * from baraanuud where CODE like '%10' order by CODE asc;
+--------+-------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)
mysql> select * from baraanuud where CODE like '%10%' order by CODE asc;
+--------+----------------+---------+---------+--------+--------+
| code | name | price | country | height | number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Yapon | 5 | 100 |
| EB1101 | Toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1101 | us butsalgagch | 25000 | China | 0.5 | 750 |
| LP1010 | Macbook Pro | 1500000 | U.S.A | 2 | 10 |
+--------+----------------+---------+---------+--------+--------+
4 rows in set (0.00 sec)
mysql> select * from baraanuud where CODE like '' order by CODE asc;
hicheel
Enter password:
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database delgvvr;
Query OK, 1 row affected (0.00 sec)
mysql> use delgvvr;
Database changed
mysql> create table baraa(Code char(6), Name char(30), Price int(50), Country ch
ar(20), Height float(3), Number int(5));
Query OK, 0 rows affected (0.29 sec)
mysql> insert into baraa values('EB1010', 'Zuragt', '1500000', 'Japan', '5', '10
0');
Query OK, 1 row affected (0.07 sec)
mysql> insert into baraa values('EB1101', 'toos sorogch', '350000', 'China', '0.
5', '1000');
Query OK, 1 row affected (0.08 sec)
mysql> insert into baraa values('EB1212', 'us butsalgagch', '25000', 'China', '0
.5', '750');
Query OK, 1 row affected (0.09 sec)
mysql> insert into baraa values('PC1212', 'HP PC', '450000', 'Thailand', '5', '1
0');
Query OK, 1 row affected (0.05 sec)
mysql> insert into baraa values('PC1123', 'Acer PC', '500000', 'Korea', '5', '10
');
Query OK, 1 row affected (0.04 sec)
mysql> insert into baraa values('LP1010', 'Macbook pro', '1500000', 'USA', '2',
'10');
Query OK, 1 row affected (0.03 sec)
mysql> insert into baraa values('LP1211', 'Acer laptop', '1300000', 'Korea', '1'
, '10');
Query OK, 1 row affected (0.05 sec)
mysql> select * from baraa;
+--------+----------------+---------+----------+--------+--------+
| Code | Name | Price | Country | Height | Number |
+--------+----------------+---------+----------+--------+--------+
| EB1010 | Zuragt | 1500000 | Japan | 5 | 100 |
| EB1101 | toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1212 | us butsalgagch | 25000 | China | 0.5 | 750 |
| PC1212 | HP PC | 450000 | Thailand | 5 | 10 |
| PC1123 | Acer PC | 500000 | Korea | 5 | 10 |
| LP1010 | Macbook pro | 1500000 | USA | 2 | 10 |
| LP1211 | Acer laptop | 1300000 | Korea | 1 | 10 |
+--------+----------------+---------+----------+--------+--------+
7 rows in set (0.00 sec)
mysql> select min(Price) from baraa;
+------------+
| min(Price) |
+------------+
| 25000 |
+------------+
1 row in set (0.00 sec)
mysql> select avg(Height) from baraa;
+--------------------+
| avg(Height) |
+--------------------+
| 2.7142857142857144 |
+--------------------+
1 row in set (0.00 sec)
mysql> select sum(Height) from baraa;
+-------------+
| sum(Height) |
+-------------+
| 19 |
+-------------+
1 row in set (0.00 sec)
mysql> select * from baraa where Code like 'EB%';
+--------+----------------+---------+---------+--------+--------+
| Code | Name | Price | Country | Height | Number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Japan | 5 | 100 |
| EB1101 | toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1212 | us butsalgagch | 25000 | China | 0.5 | 750 |
+--------+----------------+---------+---------+--------+--------+
3 rows in set (0.00 sec)
mysql> select * from baraa where Code like '%10';
+--------+-------------+---------+---------+--------+--------+
| Code | Name | Price | Country | Height | Number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Japan | 5 | 100 |
| LP1010 | Macbook pro | 1500000 | USA | 2 | 10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)
mysql>
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 1
Server version: 5.6.17 MySQL Community Server (GPL)
Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners.
Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.
mysql> create database delgvvr;
Query OK, 1 row affected (0.00 sec)
mysql> use delgvvr;
Database changed
mysql> create table baraa(Code char(6), Name char(30), Price int(50), Country ch
ar(20), Height float(3), Number int(5));
Query OK, 0 rows affected (0.29 sec)
mysql> insert into baraa values('EB1010', 'Zuragt', '1500000', 'Japan', '5', '10
0');
Query OK, 1 row affected (0.07 sec)
mysql> insert into baraa values('EB1101', 'toos sorogch', '350000', 'China', '0.
5', '1000');
Query OK, 1 row affected (0.08 sec)
mysql> insert into baraa values('EB1212', 'us butsalgagch', '25000', 'China', '0
.5', '750');
Query OK, 1 row affected (0.09 sec)
mysql> insert into baraa values('PC1212', 'HP PC', '450000', 'Thailand', '5', '1
0');
Query OK, 1 row affected (0.05 sec)
mysql> insert into baraa values('PC1123', 'Acer PC', '500000', 'Korea', '5', '10
');
Query OK, 1 row affected (0.04 sec)
mysql> insert into baraa values('LP1010', 'Macbook pro', '1500000', 'USA', '2',
'10');
Query OK, 1 row affected (0.03 sec)
mysql> insert into baraa values('LP1211', 'Acer laptop', '1300000', 'Korea', '1'
, '10');
Query OK, 1 row affected (0.05 sec)
mysql> select * from baraa;
+--------+----------------+---------+----------+--------+--------+
| Code | Name | Price | Country | Height | Number |
+--------+----------------+---------+----------+--------+--------+
| EB1010 | Zuragt | 1500000 | Japan | 5 | 100 |
| EB1101 | toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1212 | us butsalgagch | 25000 | China | 0.5 | 750 |
| PC1212 | HP PC | 450000 | Thailand | 5 | 10 |
| PC1123 | Acer PC | 500000 | Korea | 5 | 10 |
| LP1010 | Macbook pro | 1500000 | USA | 2 | 10 |
| LP1211 | Acer laptop | 1300000 | Korea | 1 | 10 |
+--------+----------------+---------+----------+--------+--------+
7 rows in set (0.00 sec)
mysql> select min(Price) from baraa;
+------------+
| min(Price) |
+------------+
| 25000 |
+------------+
1 row in set (0.00 sec)
mysql> select avg(Height) from baraa;
+--------------------+
| avg(Height) |
+--------------------+
| 2.7142857142857144 |
+--------------------+
1 row in set (0.00 sec)
mysql> select sum(Height) from baraa;
+-------------+
| sum(Height) |
+-------------+
| 19 |
+-------------+
1 row in set (0.00 sec)
mysql> select * from baraa where Code like 'EB%';
+--------+----------------+---------+---------+--------+--------+
| Code | Name | Price | Country | Height | Number |
+--------+----------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Japan | 5 | 100 |
| EB1101 | toos sorogch | 350000 | China | 0.5 | 1000 |
| EB1212 | us butsalgagch | 25000 | China | 0.5 | 750 |
+--------+----------------+---------+---------+--------+--------+
3 rows in set (0.00 sec)
mysql> select * from baraa where Code like '%10';
+--------+-------------+---------+---------+--------+--------+
| Code | Name | Price | Country | Height | Number |
+--------+-------------+---------+---------+--------+--------+
| EB1010 | Zuragt | 1500000 | Japan | 5 | 100 |
| LP1010 | Macbook pro | 1500000 | USA | 2 | 10 |
+--------+-------------+---------+---------+--------+--------+
2 rows in set (0.00 sec)
mysql>
Subscribe to:
Posts (Atom)