Professional Documents
Culture Documents
1. Table Creation
Create a new table called "Employees" with the following fields:
EmployeeID ( Primary Key) :[Example : EMP125,EMP147]
FirstName ( 50 characters) :Set the "Validation Rule" property to require that it's not
empty.
LastName ( 50 characters)
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.
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.
4. Table Relationships:
Create two tables, "Customers" and "Orders." Establish a one-to-many relationship between
them, ensuring that each order is associated with a single customer. Define the necessary
foreign keys and enforce referential integrity.
5. Write SQL statement for the following questions and write the output
i) To display a list of all employees name along with their department and hire date.
ii) To display the first and last names of all employees only in the "Production"
department.
iii) To display the employee’s First name, Last name and Hire date with the earliest hire
date.
iv) To display the employee’s First name, Last 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 a 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, Payroll 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 and pay roll id only whose overtime is below 2 hours or not pay
any tax.