Professional Documents
Culture Documents
Data base Practical Assignment
Data base Practical Assignment
S.Maradhoo
Create the given below table with given validation check and validation rule and add the
records. In word document create a table with each field name as field name, Data type,
validation check and validation rule for the able Employee. Fill each detail.
For each query design, Write SQL statements and screen short of the output.
1. Table Creation
Create a new table called "Employees" with the following fields:
EmployeeID ( Primary Key) :[Example : EMP125,EMP147]
EmpName ( 50 characters) :Set the "Validation Rule" property to require that it's not
empty.
Department ( 30 characters) [Production, Administration, Design]
HireDate (Date/Time : Use Date/Time and set a validation rule to ensure it falls
between 2016 and 2023.
Basic Pay :You can use the Currency data type.
No. of Overtime(in hours) : Use Number with Field Size set to Double, and format it with
two decimal places.
IsCurrentEmployee (Yes/No).
Deductions (Currency): To track any deductions from the salary.
Bonuses (Currency): To track any additional bonuses.
Tax (Currency): To track taxes.
1
Irushadhiyya School
S.Maradhoo
3. Suggest right data types, validation checks, and validation rules for given field in the above
table by considering the conditions. Try to give different validation check for each field by
observing the field values. In your word document write validation check ,validation rule and
data type for each field.
4. Write SQL statement for the following questions and paste screen shot of the output
i) To display a list of all employee’s name along with their department and hire date.
ii) To display the names of all employees only in the "Production" department.
iii) To display the employee’s name and Hire date with the earliest hire date.
iv) To display the employee’s name and Hire date, where hired in 2020 or later.
v) Count the total number of employees hired in Design department.
vi) List all employees ID only who have not been assigned to an administrator
department.
vii) List employees name and department who are hired between 2016 and 2023.
viii) Calculate the total basic pay for all employees.
ix) Calculate the Net salary of each employee (Basic Pay + Bonuses - Deductions).
x) List employees ID only who are not current employees and had overtime hours.
xi) Calculate the average tax amount deducted from employee salaries.
xii) Display Employee ID of employee who worked for more than 5 hours.
xiii) Display Employee ID of all current employees in descending order by their Basic
Pay.
xiv) Display Employee id, basic pay, Bonuses, dedication and net salary of all employee
who are tax payer.
xv) Display Employee id only whose overtime is below 2 hours or not pay any tax.