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’.
Explanation::
CREATE TABLE QUERY::
CREATE TABLE EMPLOYEE (
employeeID INT NOT NULL,
firstName VARCHAR(100),
lastname VARCHAR(100),
phoneNumber VARCHAR(100),
jobID varchar(100),
PRIMARY KEY (employeeID)
);
-------------------------------------------------------------------------------------------------------
INSERT QUERY FOR SOME DATA IN TABLE::
INSERT INTO
EMPLOYEE(employeeID,firstName,lastname,phoneNumber,jobID)
values(123,'Steve','Berry','123.456.789','REPORTER');
INSERT INTO
EMPLOYEE(employeeID,firstName,lastname,phoneNumber,jobID)
values(124,'Amanda','Pelkey','127.488.289','CREW');
INSERT INTO
EMPLOYEE(employeeID,firstName,lastname,phoneNumber,jobID)
values(125,'Harry','Potter','127.488.289','Presenter');
INSERT INTO
EMPLOYEE(employeeID,firstName,lastname,phoneNumber,jobID)
values(126,'Hermione','Granger','127.488.289','Representative');
INSERT INTO
EMPLOYEE(employeeID,firstName,lastname,phoneNumber,jobID)
values(127,'Ronald','Weasley','127.488.289','Prep Team');
INSERT INTO
EMPLOYEE(employeeID,firstName,lastname,phoneNumber,jobID)
values(128,'Tom','Riddle','127.488.289','Fire Team');
INSERT INTO
EMPLOYEE(employeeID,firstName,lastname,phoneNumber,jobID)
values(129,'Sirius','Black','127.488.289','Reporter');
INSERT INTO
EMPLOYEE(employeeID,firstName,lastname,phoneNumber,jobID)
values(130,'Nevil','Longbottom','127.488.289','Helper');
INSERT INTO
EMPLOYEE(employeeID,firstName,lastname,phoneNumber,jobID)
values(131,'Parvati','Patil','127.488.289','Press');
QUERY::
SELECT * FROM EMPLOYEE GIVES::

ANSWER QUERY::
SELECT employeeID,RIGHT(firstname,2),REPLACE(phoneNumber,'.','/') FROM EMPLOYEE WHERE jobID LIKE '%REP%';
OUTPUT::

Please provide the feedback!!
Thank You!!
Write an SQL statement that will display the Employee ID, First name (only last 2 letters),...
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: 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...
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...
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,...
write SQL code to list the employee first name, last name, and salary from the employee table and the department from the jobs table
I need this written in SQL
Employee EMP ID EMP FNAME EMP LNAME EMP STREET EMP CITY EMP STATE EMP ZIP EMP START DATE Table TABLE ID AREA IDTABLE SEATS Area AREA ID AREA NAME AREA SUPERVISOR EMPLOYEE ID Customer CUST ID CUST LAST NAME CUST NUMBER OF GUESTS Assignment EMPID TABLE ID Seating CUST IDTABLE ID SEATING COST SEATING DATE SEATING TIP Question 29 (10 points) Write an SQL query to list the employee ID and first and last...
write SQL code list all employee name and employee number (by this order) for all employees with job code 709
Given the following table structure, write the SQL code to display all the first and last names of the individuals that have a last name that begins with the letter 'M! CREATE TABLE Persons Personi int LastName varchar(80). FirstName varchar(80). Address varchar(125). State char(2) Given the following table structure, write the SQL code to display all the first and last names of the individuals that have a last name that does not contain the letter 'S: CREATE TABLE Persons PersonlDint,...
Problem 33, chapter 7 from Database Systems 13th edition by Coronel Write a query to display the employee number, last name, email address, title, and department name of each employee whose job title ends in the word “ASSOCIATE.” Sort the output by department name and employee title Problem 36, chapter 7 from Database Systems 13th edition by Coronel Write a query to display the number of products within each base and type combination, sorted by base and then by type...