Write an SQL statement that will display the Employee ID, full name (all capital) and Job ID of all employees that belong to a department with Department ID 20 and whose Job ID has a substring “rep”.
SQL Query :
SELECT Employee_ID, UPPER(First_Name) || ' ' || UPPER(Last_Name) "Full Name" , Job_ID
FROM employees
WHERE Department_ID = 20 AND Job_ID LIKE '%rep%'
Explanation: UPPER() converts the string into upper case. || stands for string concatenation operation. LIKE matches the pattern in the string.
Write an SQL statement that will display the Employee ID, full name (all capital) and Job...
Write an SQL statement that will display the Employee ID, First name (only last 2 letters), phone number (replace . by /) of all employees whose job Id has a word ‘REP’.
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...
write SQL code list all employee name and employee number (by this order) for all employees with job code 709
Use the HR database for all the questions in this lab. For each item in this lab, paste the SQL you used to complete the task and the number of rows retrieved. Ensure you follow the coding standards listed in the ETSU SQL standards guide found on D2L. Save this document as a PDF and name it your_name_lab7.pdf Display the employees’ first name, last name and phone number of employees with salaries greater than 10,000 dollars. SELECT first_name, last_name, phone_number,...
Please refer to the following business scenarios:
(i) Using SELECT statements of SQL, find the employee id, first
name, last name, job title and email of all employees working in
Asia (i.e. all countries coming from the region
‘Asia’). This query must be implemented
as a nested query!
(ii) Using SELECT statements of SQL, find the employee id, first
name, last name, job title and supervisor id of employees who had
worked for more than 3 years and completed...
Write just one SQL statement per question 1. Display Publisher ID, Publisher Name and Total Number of Books published by each publisher. 2. List Publisher ID, Publisher Name, Title and price of the highest priced book. 3. List Order ID, Customer ID, Order Date, and Number of Items in each order. Order the data by Customer ID in ascending (A – Z) order. 4. Display Title, Category and Profit for each book in the children and computer category. 5. Display...
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...
Write SQL authorization statements on the employee table as per the following requirements: Employee (id, name, job_name, dept_name, salary) - You have three managers with manager1, manager2 and manager3 user ids. All of them are members of the role manager. - All managers have the same privileges: select, insert, update, delete. - No managers can transfer his privileges on the employee table.
Write SQL Queries for the following Select the employee name and no of departments each employee works for Select the employee names with salary greater than average salary of all employees Select the department names with no manager assigned yet. Select the employee names who work for more than 1 department. Select the employee names and their manager names (keep in mind, one employee works for multiple departments so they will have multiple managers). Select the name and salary of...
a. Write a program that reads your id and full name and display. And also display the index of first letter and last letter of your full name. b. Modify above program, Declare a string course, let your program read course from user, check if course is not equal to comp2002, clear the string otherwise concatenate course and "Computer Science Department". c. Modify above program declare a string college="". If string college is empty then assign a new string "College...