SQL
Display the manager ID (should be not null) and the total number of employees they are supervising who are in the area code 650 and 515. Sort the display in descending order of total employees under them. Use Employee table.
In order to provide you correct and working SQL query, you would need to provide the table schema. Since you have not provided it, i have to guess the table and column names (you might have to change them accordingly) and provide you the query. In case you need any help, please reach out to me via the comments section.
QUERY
SELECT e2.employeeID, count(*) FROM Employee e1, Employee e2 WHERE e1.managerID = e2.employeeID AND e1.areaCode IN (650, 515) GROUP BY e2.employeeID ORDER BY count(*) DESC;
SQL Display the manager ID (should be not null) and the total number of employees they...
SQL From employees table, display the first_name, last_name, phone_number and Phone number Type. Phone number type should be "USA Phone Number" (Length=12) or "International Phone Number" (Length=18) or "Unknown" based on the length of the phone number. Sort the display in desc order of phone number type Use Either CASE or DECODE. Output Column Heading: First Name, Last Name, Phone Number, Phone Number Type
SQL From employees table, display the first_name, last_name, phone_number and Phone number Type. Phone number type should be "USA Phone Number" (Length=12) or "International Phone Number" (Length=18) or "Unknown" based on the length of the phone number. Sort the display in desc order of phone number type Use Either CASE or DECODE. Output Column Heading: First Name, Last Name, Phone Number, Phone Number Type
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...
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...
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 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’.
pls help me with these SQL questions
Here are tables
TEAM table
Task 10 (4 marks) Write an SQL statement to display fan categories, the number of tickets in each category the fan bought (change the alias to "NUMBER OF TICKETS PURCHASED") along with the sum of prices (change the alias to TOTAL PRICES') in each category the fans paid. Sort the result by total price in an ascending order. Task 11 (5 marks) Write an SQL statement to display...
There are 7 problems that require using joins. Each problem has 10 points. 1. Write an SQL command that will find any customers who have not placed orders and sort them out by CustomerID in ascending order. 2. List the employees and supervisors names for each supervisor who supervises more than two employees. 3. List the name of each employee, his or her birth date, the name of his or her manager, and the manager’s birth date for those employees...
Quis -2 EMPLOYEES EMPLOYEE ID NUMBER(6.0 FIRST NAME VARCHAR NTE) CONSTRAINT EMPLASTNAME NN NOT NULL ENA LAST NAME VARCHAI CONSTRAINT EMPEMAIL NN NOT NULL ENABLE "EMAIL VARCHAR CHARZI29 BYTEL "PHONE NUMBE CONSTRAINT EMP HIRE DATE NN NOT NULL ENABLE "HERE DAT Aaue BYTE) CONS TRAINT EMPJOB NN NOT NULL ENABLE 3o8 MBER3 BYTE) SA OMMISSION PCT NUMBER2.23 "MANAGER 1D NUMBER(6.0), "DEPARTMENT ID NUMBER(4,0) 1. Return the names of employees who have the 2nd highest salary Sεutct 2. For every employee,...
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...