SQL query: Write an SQL query that will output the last name, employee id, hire date and department from the employee table. Pick only those employees whose department ID is specified in the employee table. If the employee id is 777, name is ABC and hire date is 01-JAN-2016, the output should look as follows - 'Stephen (Employee ID - 777) was hired on the 1st of January, 2016 – Department: 90'. Note - The date should not have preceding zeros
Select last_name+' (Employee ID - '+' '+employeeid+' was hired on the '+CAST(DAY(hire_date) AS VARCHAR(2)) + ' ' + DATENAME(MM, hire_date) + ' ' + CAST(YEAR(hire_date) AS VARCHAR(4))+' – Department: '+Department_Id from employees where department_id is not null;
Requirement is purely based on concatenating. Please change column names if applicable. Please comment if any error
SQL query: Write an SQL query that will output the last name, employee id, hire date and department from the employee table. Pick only those employees whose department ID is specified in the employee...
SQL query: Write a SQL statement using the employees table and retrieve employees whose monthly salary (including their commission) is greater or equal to 5,000 but less than or equal to 17,000 (we are assuming the salary on the table is monthly). In other words, if their monthly salary was 1000 and their commission was .2, their total monthly salary would be 1200 and given the criteria above this instance would not be selected. Please display the full name of...
The Employee table consists of the following data fields: Employee ID, Employee Name, Employee Department, Employee Manager (EMP_ID of the Employee to whom the employee reports) and Employee DOH (Date of Hire). Using the following data table, answer the questions with appropriate SQL queries. EMP_ID EMP_NAME EMP_DEPT EMP_MANAGER EMP_DOH 1 John IT 9 05-08-2010 2 Alex Finance 0 06-03-2008 3 Linda IT 9 07-02-2010 4 Robin Purchase 8 08-12-2010 5 Maki Purchase 8 09-08-2012 6 Ross Sales 7 10-05-2012 7...
A company maintains data on their employees in a table called employee. Write a query to find the highest paid employee in each department. The output should contain department_name, employee_name, and salary. Exclude employees with no department from your result. Input Format: employee table: Column Type employee_no Integer employee_name String department_no Integer salary Integer manager_no Integer department table: Column Type department_no String department_name String
Q2. Retrieve the names of all employees from the employee table to produce output on CSV format or delimited format with a common delimeter, rather than separete columns. Hint:Put the whole row into a string with a semicolon as the seperator(delimeter) between thecolumns: FORMAT:(fname;minit;lname) Example: EMPLOYEES -------------- James;E;Borg Frank;T;Wong Q3. Write a query to show the employees name from the employee table in this format: first letter of the first name, followed by a dot, a blank, and the full...
SQL - create statement for query For each patient, display his or her last name, first name, and the name of his or her doctor. For each pediatrics patient, display his or her ID and his or her doctor's ID and name. For each doctor, display the name and the name of the doctor's supervisor in alphabetic order of supervisor's name. Include column aliases for clarity. Note: Check for accuracy. For each doctor in one of the two areas entered...