0% found this document useful (0 votes)
20 views4 pages

1arith Op

Uploaded by

anushkaanand2021
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views4 pages

1arith Op

Uploaded by

anushkaanand2021
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 4

arithematic operator

mysql> select 10+5;


+------+
| 10+5 |
+------+
| 15 |
+------+
1 row in set (0.03 sec)

mysql> select 10*8;


+------+
| 10*8 |
+------+
| 80 |
+------+
1 row in set (0.02 sec)

mysql> select 10+6-5+64*2;


+-------------+
| 10+6-5+64*2 |
+-------------+
| 139 |
+-------------+
1 row in set (0.00 sec)

mysql> select 2.345+679.48930;


+-----------------+
| 2.345+679.48930 |
+-----------------+
| 681.83430 |
+-----------------+
1 row in set (0.02 sec)

mysql> select (2+4+5+6)*80/5;


+----------------+
| (2+4+5+6)*80/5 |
+----------------+
| 272.0000 |
+----------------+
1 row in set (0.00 sec)

mysql> select (2+4+5+6)*80/5, 456789+56789/3,5463829465-


548395474/4*2,67890+7545892;
+----------------+----------------+--------------------------+---------------+
| (2+4+5+6)*80/5 | 456789+56789/3 | 5463829465-548395474/4*2 | 67890+7545892 |
+----------------+----------------+--------------------------+---------------+
| 272.0000 | 475718.6667 | 5189631728.0000 | 7613782 |
+----------------+----------------+--------------------------+---------------+
1 row in set (0.00 sec)

mysql> select "hello" + "world";


+-------------------+
| "hello" + "world" |
+-------------------+
| 0 |
+-------------------+
1 row in set, 2 warnings (0.03 sec)
mysql> select "hello + world";
+---------------+
| hello + world |
+---------------+
| hello + world |
+---------------+
1 row in set (0.00 sec)

mysql> select 10000000000000000000000000000000000000000*1;


+---------------------------------------------+
| 10000000000000000000000000000000000000000*1 |
+---------------------------------------------+
| 10000000000000000000000000000000000000000 |
+---------------------------------------------+
1 row in set (0.00 sec)

mysql> select 1000000000000000000000000000000*1;


+-----------------------------------+
| 1000000000000000000000000000000*1 |
+-----------------------------------+
| 1000000000000000000000000000000 |
+-----------------------------------+
1 row in set (0.00 sec)

mysql> select 100000000000000000000000000000*1;


+----------------------------------+
| 100000000000000000000000000000*1 |
+----------------------------------+
| 100000000000000000000000000000 |
+----------------------------------+
1 row in set (0.00 sec)

mysql> select 1000000000000000000000000000000000000000000000000000000000000000000*1


-> ;
+-----------------------------------------------------------------------+
| 1000000000000000000000000000000000000000000000000000000000000000000*1 |
+-----------------------------------------------------------------------+
| 1000000000000000000000000000000000000000000000000000000000000000000 |
+-----------------------------------------------------------------------+
1 row in set (0.00 sec)

mysql> select
10000000000000000000000000000000000000000000000000000000000000000000000000000000000
00*1
-> ;
+----------------------------------------------------------------------------------
-------+
|
10000000000000000000000000000000000000000000000000000000000000000000000000000000000
00*1 |
+----------------------------------------------------------------------------------
-------+
|
99999999999999999999999999999999999999999999999999999999999999999 |
+----------------------------------------------------------------------------------
-------+
1 row in set, 1 warning (0.00 sec)

mysql> select "502" + "1002";


+----------------+
| "502" + "1002" |
+----------------+
| 1504 |
+----------------+
1 row in set (0.00 sec)

mysql> select '8.9'*10;


+----------+
| '8.9'*10 |
+----------+
| 89 |
+----------+
1 row in set (0.00 sec)

mysql> select '500'+'00002';


+---------------+
| '500'+'00002' |
+---------------+
| 502 |
+---------------+
1 row in set (0.00 sec)

mysql> select 'AA90'+'1';


+------------+
| 'AA90'+'1' |
+------------+
| 1 |
+------------+
1 row in set, 1 warning (0.00 sec)

mysql> select '10X'*'1'+'SOA';


+-----------------+
| '10X'*'1'+'SOA' |
+-----------------+
| 10 |
+-----------------+
1 row in set, 2 warnings (0.00 sec)

mysql> use company;


Database changed
mysql> select '10X'*'1'+'50A';
+-----------------+
| '10X'*'1'+'50A' |
+-----------------+
| 60 |
+-----------------+
1 row in set, 2 warnings (0.00 sec)

mysql> select '10X'*'1'*'PRA';


+-----------------+
| '10X'*'1'*'PRA' |
+-----------------+
| 0 |
+-----------------+
1 row in set, 2 warnings (0.00 sec)

mysql> select * from employee;


+----------+-------+---------+-----------+------------+-------------------------
+------+--------+-----------+-----+
| Fname | Minit | Lname | Ssn | Bdate | Address |
Sex | Salary | Super_ssn | Dno |
+----------+-------+---------+-----------+------------+-------------------------
+------+--------+-----------+-----+
| John | B | Smith | 123456789 | 1965-01-09 | 731 Fondren, Houston TX | M
| 30000 | 333445555 | 5 |
| Franklin | T | Wong | 333445555 | 1965-12-08 | 638 Voss, Houston TX | M
| 40000 | 888665555 | 5 |
| Joyce | A | English | 453453453 | 1972-07-31 | 5631 Rice, Houston TX | F
| 25000 | 333445555 | 5 |
| Ramesh | K | Narayan | 666884444 | 1962-09-15 | 975 Fire Oak, Humble TX | M
| 38000 | 333445555 | 5 |
| James | E | Borg | 888665555 | 1937-11-10 | 450 Stone, Houston TX | M
| 55000 | NULL | 1 |
| Jennifer | S | Wallace | 987654321 | 1941-06-20 | 291 Berry, Bellaire TX | F
| 43000 | 888665555 | 4 |
| Ahmad | V | Jabbar | 987987987 | 1969-03-29 | 980 Dallas, Houston TX | M
| 25000 | 987654321 | 4 |
| Alicia | J | Zelaya | 999887777 | 1968-01-19 | 3321 Castle, Spring TX | F
| 25000 | 987654321 | 4 |
+----------+-------+---------+-----------+------------+-------------------------
+------+--------+-----------+-----+
8 rows in set (0.03 sec)

mysql> select fname, ssn-salary from employee;


+----------+------------+
| fname | ssn-salary |
+----------+------------+
| John | 123426789 |
| Franklin | 333405555 |
| Joyce | 453428453 |
| Ramesh | 666846444 |
| James | 888610555 |
| Jennifer | 987611321 |
| Ahmad | 987962987 |
| Alicia | 999862777 |
+----------+------------+
8 rows in set (0.00 sec)

You might also like