0% found this document useful (0 votes)
12 views1 page

Employee Salary Database Schema and Stats

The document outlines the creation of an EMPLOYEE table with various attributes such as employee ID, name, department, salary, commission, and join date. It includes SQL insert statements for adding employee records and specifies queries for calculating total employees, salary statistics, and department-wise metrics. The document serves as a guide for managing employee data and performing analytical queries in a database.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views1 page

Employee Salary Database Schema and Stats

The document outlines the creation of an EMPLOYEE table with various attributes such as employee ID, name, department, salary, commission, and join date. It includes SQL insert statements for adding employee records and specifies queries for calculating total employees, salary statistics, and department-wise metrics. The document serves as a guide for managing employee data and performing analytical queries in a database.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

CREATE TABLE EMPLOYEE (

emp_id NUMBER PRIMARY KEY,


emp_name VARCHAR2(30),
department VARCHAR2(20),
salary NUMBER(10,2),
commission NUMBER(10,2),
join_date DATE
);

INSERT INTO EMPLOYEE VALUES (1,'Rahul','HR',45000,3000,DATE '2024-01-10');


INSERT INTO EMPLOYEE VALUES (2,'Asha','HR',50000,NULL,DATE '2024-03-12');
INSERT INTO EMPLOYEE VALUES (3,'Rohit','IT',65000,5000,DATE '2023-11-05');
INSERT INTO EMPLOYEE VALUES (4,'Neha','IT',70000,NULL,DATE '2024-04-19');
INSERT INTO EMPLOYEE VALUES (5,'Vikram','Sales',40000,7000,DATE '2024-02-02');
INSERT INTO EMPLOYEE VALUES (6,'Kiran','Sales',42000,NULL,DATE '2024-03-30');

Count total employees – count


Total salary paid - sum
Average salary - avg
Highest salary - max
Lowest salary - min

Count employees department-wise -


Department-wise total salary expenditure -
Average salary per department
Highest salary in each department
Lowest salary per department

You might also like