Group Project Queries
Group Project Queries
---------------------------------------------
Table no 1 (CompanySetup)
-------------------------
create table CompanySetup (
CompanyName varchar2(75),
Address varchar2(50),
City varchar2(25),
Phone varchar2(25),
Fax varchar2(15),
Email varchar2(25)
)
---------------------------------------------
Table no 2 (Departments)
------------------------
create table Departments(
DeptID varchar2(5),
Dname varchar2(35),
Remarks varchar2(50),
constraint deptid_PK PRIMARY KEY (DeptID)
)
----------------------------------------------
Table no 3 (Designation)
------------------------
create table Designation(
DesgID number(3),
Desgname varchar2(35),
Remarks varchar2(50),
constraint desgid_PK primary key (DesgID)
)
--------------------------------------------------
Table no 4 (EmployeeInfo)
-------------------------
create table EmployeeInfo(
EmpCode Number(5),
FirstName Varchar2(30),
LastName Varchar2(30)
NIC Varchar2(15),
TempAddress Varchar2(50),
PerAddress Varchar2(50),
Phone Varchar2(15),
Mobile Varchar2(15),
BirthDate Date,
HireDate Date,
Gender Varchar2(6),
Shift Varchar2(12),
DesgID Number(3),
DeptID Varchar2(5),
BasicPay Number(5),
constraint EmpCode_PK PRIMARY KEY (EmpCode),
constraint DesgID_FK Foreign Key (DesgID) REFERENCES Designation
constraint DeptID_FK Foreign Key (DeptID) REFERENCES Departments
)
--------------------------------------------------------------------------
Table no 5 (Academic)
---------------------
create table Academic(
EmpCode Number(5),
Degree Varchar2(15),
Institue Varchar2(50),
Grade Varchar2(5),
PassingYear Number(4),
constraint EmpCode_FK Foreign Key (EmpCode) REFERENCES EmployeeInfo
)
----------------------------------------------------------------------------
Table no 6 (Experience)
create table Experience(
EmpCode Number(5),
Company Varchar2(50),
Post Varchar2(20),
FromDate Date,
ToDate Date,
LastPay Number(8),
constraint EmpCode_FK_Exp Foreign Key EmpCode REFERENCES employeeinfo
)
------------------------------------------------------------------------------
Table no 7 (PayDescription)
---------------------------
create table PayDescription(
PayID varchar2(3),
Pname varchar2(35),
Type varchar2(50),
constraint PayID_PK Primary Key (PayID)
)
-------------------------------------------------------
Table no 8 (LeaveDesciption)
-----------------------------
create table LeaveDescription(
LeaveID varchar2(3),
Ldesc varchar2(35),
constraint LeaveID_PK Primary Key (LeaveID)
)
-------------------------------------------------------
Table no 9 (Attendance)
------------------------
create table attendance(
EmpCode Number(5),
Cdate Date,
TimeIn Date,
Timout Date,
TotalHours Number(3),
Status Varchar(1),
CurrentStatus Varchar(3),
constraint Empcode_FK_atten Foreign Key (EmpCode) REFERENCES employeeinfo
)
-----------------------------------------------------------------------------------
-
Table no 10 (LeaveTransaction)
create table LeaveTransaction(
EmpCode Number(5),
LeaveID Varchar(3),
LvFromDate Date,
LvToDate Date,
LvDays Number(3),
constraint EmpCode_FK_Lvt Foreign Key (EmpCode) REFERENCES employeeinfo
constraint LeaveID_FK Foreign Key (LeaveID) REFERENCES leavedescription
)
-----------------------------------------------------------------------------------
-
Table no 11 (Deduction)
------------------------
create table Deduction(
EmpCode Number(5),
PayID Varchar(3),
DeductionAmt Number(5),
Reason Varchar(35),
constraint EmpCode_FK_Ded Foreign Key (EmpCode) REFERENCES employeeinfo,
constraint PayID_FK Foreign Key (PayID) REFERENCES PayDescription
)
-----------------------------------------------------------------------------------
---
Table no 12 (SalaryMaster)
--------------------------
create table SalaryMaster(
InvoiceNo Number(5),
InvDate Date,
EmpCode Number(5),
Deduction Number(5),
constraint InvoiceNo_PK Primary Key InvoiceNo,
constraint EmpCode_FK_SM Foreign key EmpCode REFERENCES employeeinfo
)
-----------------------------------------------------------------------------------
---
Table no 13 (SalaryDetail)
--------------------------
create table SalaryDetail(
InvoiceNo Number(5),
PayID Varchar(3),
Payamount Number(5),
constraint InoiceNo_FK foreign key (InoiceNo) REFERENCES SalaryMaster,
constraint PayID_FK_SD foreign key (PayID) REFERENCES PayDescription
)
----------------------------------------------------------------------------------
The End.