0% found this document useful (0 votes)
7 views2 pages

SQL1

Uploaded by

bamulya1324
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)
7 views2 pages

SQL1

Uploaded by

bamulya1324
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/ 2

create table emp(emp_no int(5),emp_name varchar(20),Basic_sal int(10),HRA

int(10),DA int(10),PF int(10),gross_sal int(10),net_sal int(10));

mysql> desc emp;


+-----------+-------------+------+-----+---------+-------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-------------+------+-----+---------+-------+
| emp_no | int(5) | YES | | NULL | |
| emp_name | varchar(20) | YES | | NULL | |
| Basic_sal | int(10) | YES | | NULL | |
| HRA | int(10) | YES | | NULL | |
| DA | int(10) | YES | | NULL | |
| PF | int(10) | YES | | NULL | |
| gross_sal | int(10) | YES | | NULL | |
| net_sal | int(10) | YES | | NULL | |
+-----------+-------------+------+-----+---------+-------+
8 rows in set (0.00 sec)

mysql> insert into emp(emp_no,emp_name,Basic_sal)values(4401,'Amulya',75000);


Query OK, 1 row affected (0.00 sec)

mysql> insert into emp(emp_no,emp_name,Basic_sal)values(4402,'Keerthana',50000);


Query OK, 1 row affected (0.01 sec)

mysql> insert into emp(emp_no,emp_name,Basic_sal)values(4403,'sahasra',38000);


Query OK, 1 row affected (0.00 sec)

mysql> insert into emp(emp_no,emp_name,Basic_sal)values(4404,'geetha',100000);


Query OK, 1 row affected (0.00 sec)

mysql> insert into emp(emp_no,emp_name,Basic_sal)values(4405,'suhan',60000);


Query OK, 1 row affected (0.00 sec)

mysql> insert into emp(emp_no,emp_name,Basic_sal)values(4406,'venkat',85000);


Query OK, 1 row affected (0.00 sec)

mysql> insert into emp(emp_no,emp_name,Basic_sal)values(4407,'rani',75000);


Query OK, 1 row affected (0.00 sec)

mysql> insert into emp(emp_no,emp_name,Basic_sal)values(4408,'shankar',50000);


Query OK, 1 row affected (0.00 sec)

mysql> select*from emp;


+--------+-----------+-----------+------+------+------+-----------+---------+
| emp_no | emp_name | Basic_sal | HRA | DA | PF | gross_sal | net_sal |
+--------+-----------+-----------+------+------+------+-----------+---------+
| 4401 | Amulya | 75000 | NULL | NULL | NULL | NULL | NULL |
| 4402 | Keerthana | 50000 | NULL | NULL | NULL | NULL | NULL |
| 4403 | sahasra | 38000 | NULL | NULL | NULL | NULL | NULL |
| 4404 | geetha | 100000 | NULL | NULL | NULL | NULL | NULL |
| 4405 | suhan | 60000 | NULL | NULL | NULL | NULL | NULL |
| 4406 | venkat | 85000 | NULL | NULL | NULL | NULL | NULL |
| 4407 | rani | 75000 | NULL | NULL | NULL | NULL | NULL |
| 4408 | shankar | 50000 | NULL | NULL | NULL | NULL | NULL |
+--------+-----------+-----------+------+------+------+-----------+---------+
8 rows in set (0.00 sec)

mysql> update emp set HRA=0.15*Basic_sal;


Query OK, 8 rows affected (0.00 sec)
Rows matched: 8 Changed: 8 Warnings: 0

mysql> update emp set DA=0.11*Basic_sal;


Query OK, 8 rows affected (0.00 sec)
Rows matched: 8 Changed: 8 Warnings: 0

mysql> update emp set PF=0.06*Basic_sal;


Query OK, 8 rows affected (0.00 sec)
Rows matched: 8 Changed: 8 Warnings: 0

mysql> update emp set gross_sal=Basic_sal+HRA+DA;


Query OK, 8 rows affected (0.00 sec)
Rows matched: 8 Changed: 8 Warnings: 0

mysql> update emp set net_sal=gross_sal-PF;


Query OK, 8 rows affected (0.00 sec)
Rows matched: 8 Changed: 8 Warnings: 0

mysql> select *from emp;


+--------+-----------+-----------+-------+-------+------+-----------+---------+
| emp_no | emp_name | Basic_sal | HRA | DA | PF | gross_sal | net_sal |
+--------+-----------+-----------+-------+-------+------+-----------+---------+
| 4401 | Amulya | 75000 | 11250 | 8250 | 4500 | 94500 | 90000 |
| 4402 | Keerthana | 50000 | 7500 | 5500 | 3000 | 63000 | 60000 |
| 4403 | sahasra | 38000 | 5700 | 4180 | 2280 | 47880 | 45600 |
| 4404 | geetha | 100000 | 15000 | 11000 | 6000 | 126000 | 120000 |
| 4405 | suhan | 60000 | 9000 | 6600 | 3600 | 75600 | 72000 |
| 4406 | venkat | 85000 | 12750 | 9350 | 5100 | 107100 | 102000 |
| 4407 | rani | 75000 | 11250 | 8250 | 4500 | 94500 | 90000 |
| 4408 | shankar | 50000 | 7500 | 5500 | 3000 | 63000 | 60000 |
+--------+-----------+-----------+-------+-------+------+-----------+---------+
8 rows in set (0.00 sec)

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy