Click here to download the source code
CREATE VIEW VW_GETEMPLOYEE
AS
select e.emp_id as 'ID',e.emp_name as 'Name',d.dept_name as 'Department',e.emp_cnic as 'CNIC',E.emp_dob as 'Date of Birth',
e.emp_email as 'Email',e.emp_hiredate as 'Hire Date',s.status_year as 'Year', s.status_basicsalary as 'Basic Salary',s.status_bonus as 'Annual Bonus',s.status_medical as 'Medical Allownace', s.status_casualleaves as 'Annual Casual Leaves',s.status_sickleaves as 'Sick Leaves',s.status_annualleaves as 'Annual Leaves'
from tbl_employee e inner join TBL_EMPLOYEEWORKINGSTATUS s on e.emp_id = s.status_emp_fk
inner join tbl_departments d on d.dept_id=s.status_dep_fk
SELECT * FROM VW_GETEMPLOYEE