Employee and Salary Table Structure in SQL

2.salary Table:

CREATE TABLE salary (
id NUMBER REFERENCES employee(id),
designation VARCHAR2(25) NOT NULL,
salary NUMBER
);
Description:
The salary table is devised in order to store relevant data of an employee's salary and their respective designation.
It has following columns:
id: which would be foreign key as referential integrity will be placed through id column of table "employee". This helps create the linkage of several related records with a employee by that particular id-column in table "employee."
designation: The job title or designation of the employee, which is to be required.
Salary: It is the amount of actual salary for an employee. This column contains numeric values, it can hold the amount of base salary or another compensation detail.
These tables are related through the id field in both employee and salary tables, reflecting the relationship between employee information and their compensation. This id in the employee table demonstrates self-referential use to illustrate employee-to-manager relationships within the same table.



Sample Data

Employee Table:


id	empname			birth_date	mgr_id
1	Amit Sharma		1985-04-25	NULL
2	John Smith		1990-02-15	1
3	Priya Desai		1980-08-30	1
4	Robert Johnson		1995-11-05	2
5	Suresh Kumar		1992-06-18	3


Salary Table:


id	designation		Salary
1	Senior Developer	120000
2	Software Engineer	80000
3	Project Manager		150000
4	Junior Developer	60000
5	Team Lead		110000


Other Topic:-->>Top Queries for Employee Salary Management.Retriving and sorting Data FAQ