Design and Queries from HR schema. The HR schema (primary key columns in bold; arrows show which column refers to which): Table Columns Links…

Design and Queries from HR schema.

The HR schema (primary key columns in bold; arrows show which column refers to which):

TableColumnsLinks
REGIONSREGION_ID, REGION_NAME–
COUNTRIESCOUNTRY_ID, COUNTRY_NAME, REGION_IDREGION_ID → REGIONS.REGION_ID
LOCATIONSLOCATION_ID, STREET_ADDRESS, POSTAL_CODE, CITY, STATE_PROVINCE, COUNTRY_IDCOUNTRY_ID → COUNTRIES.COUNTRY_ID
DEPARTMENTSDEPARTMENT_ID, DEPARTMENT_NAME, MANAGER_ID, LOCATION_IDMANAGER_ID → EMPLOYEES.EMPLOYEE_ID; LOCATION_ID → LOCATIONS.LOCATION_ID
JOBSJOB_ID, JOB_TITLE, MIN_SALARY, MAX_SALARY–
JOB_HISTORYEMPLOYEE_ID, START_DATE, END_DATE, JOB_ID, DEPARTMENT_IDEMPLOYEE_ID → EMPLOYEES.EMPLOYEE_ID; JOB_ID → JOBS.JOB_ID; DEPARTMENT_ID → DEPARTMENTS.DEPARTMENT_ID
EMPLOYEESEMPLOYEE_ID, FIRST_NAME, LAST_NAME, EMAIL, PHONE_NUMBER, HIRE_DATE, JOB_ID, SALARY, COMMISSION_PCT, MANAGER_ID, DEPARTMENT_IDJOB_ID → JOBS.JOB_ID; MANAGER_ID → EMPLOYEES.EMPLOYEE_ID; DEPARTMENT_ID → DEPARTMENTS.DEPARTMENT_ID

(i) Display details of jobs where the minimum salary is greater than 10000.

(ii) Display the first name and join date of the employees who joined between 2002 and 2005.

(iii) Display first name and join date of the employees who is either IT Programmer or Sales Man.

(iv) Display first name, salary, commission pct, and hire date for employees with salary less than 10000.

(v) Display job Title, the difference between minimum and maximum salaries for jobs with max salary in the range 10000 to 20000.

(vi) Display first name, salary, and round the salary to thousands.

(vii) Display employees where the first name or last name starts with S.

(viii) Display details of the employees where commission percentage is null and salary in the range 5000 to 10000 and department is 30.

(ix) Display first name and date of first salary of the employees.

(x) Display first name and last name after converting the first letter of each name to upper case and the rest to lower case.

From the Janata Bank Assistant Network Engineer 2020 – Written exam, question 50 of 68.

More from this paper