Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Irushadhiyya School

S.Maradhoo

Practical Project (Database)


Grade: 9

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.

Table Creation Questions

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.

Set appropriate field properties such as field size and format

Insert the given below records into the table:


EmployeeID Name Department HireDate Basic OT IsCurrent Deduction Bonuse Tax
Pay Employee s
EMP001 John Production 2017-03-15 50000.00 5.25 Yes 1500.00 2000.00 7500.00
EMP002 Jane Administratio 2018-06-22 60000.00 3.75 Yes 1200.00 1800.00 9000.00
n
EMP003 David Production 2019-01-10 5000.00 1.50 Yes 1300.00 2200.00 0.00
EMP004 Sarah Design 2017-09-05 62000.00 6.00 No 1400.00 1900.00 8500.00
EMP005 Michael Production 2020-02-18 53000.00 4.25 Yes 1600.00 2100.00 7800.00
EMP006 Emily Administratio 2016-11-30 58000.00 5.50 No 1400.00 1700.00 9200.00
n
EMP007 Robert Design 2019-08-12 57000.00 3.00 Yes 1200.00 2300.00 8300.00
EMP008 Olivia Production 2018-04-03 51000.00 1.75 Yes 1500.00 1900.00 7900.00
EMP009 William Production 2022-05-09 59000.00 5.25 Yes 1600.00 2200.00 8400.00
EMP010 Sophia Design 2021-07-14 63000.00 6.50 Yes 1700.00 2000.00 8700.00

2. Insert the given below records into the table:


Set appropriate field properties such as field size and format.

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.

You might also like