Question

In: Computer Science

Develop SQL statements to do the following: Query 1: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_EMP_CITY,...

Develop SQL statements to do the following:

Query 1: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_EMP_CITY, LXXX_EMP_PHONE, LXXX_DEP_ID, order by LXXX_DEP_ID.

Query 2: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_DEP_NAME, order by LXXX_DEP_NAME.

Query 3: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_DEP_NAME who work for the "XXX_SALES" department.

Query 4: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_DEP_NAME, LXXX_EMP_CITY, LXXX_DEP_CITY who live and work in the same city, order by LXXX_DEP_CITY

Query 5: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_PROJ_TYPE, LXXX_START_DATE, LXXX_END_DATE who have worked in either an “XXX_CUSTOMER SURVEY” project or an “XXX_CUSTOMER GOLF OUTING” project.

Query 6: List all employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_ROLE_NAME who have worked in the role of an “XXX_PROJECT MANAGER”.

Solutions

Expert Solution

QUERY 1:

  SELECT LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_EMP_CITY, LXXX_EMP_PHONE, LXXX_DEP_ID FROM EMPLOYEE ORDER BY LXXX_DEP_ID ASC;

QUERY 2:

SELECT LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_DEP_N AME FROM EMPLOYEE ORDER BY LXXX_DEP_NAME ASC;
QUERY 3:

SELECT LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_DEP_N AME FROM EMPLOYEE WHERE LXXX_DEP_NAME FROM EMPLOYEE WHERE LXXX_DEP_NAME='XXX_SALES';
QUERY 4:   

SELECT LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_DEP_NAME, LXXX_EMP_CITY, LXXX_DEP_CITY FROM EMPLOYEE WHERE LXXX_EMP_CITY= LXXX_DEP_CITY;

QUERY 5:

  SELECT LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_PROJ_TYPE, LXXX_START_DATE, LXXX_END_DATE FROM EMPLOYEE WHERE PROJ_TYPE='XXX_CUSTOMER SURVER' OR PROJ_TYPE='XXX_CUSTOMER COLF OUTING';

QUERY 6:

  SELECT employees by LXXX_EMP_ID, LXXX_EMP_NAME, LXXX_ROLE_NAME FROM EMPLOYEE WHERE LXXX_ROLE_NAME ='XXX_PROJECT MANAGER';

IF YOU HAVE ANY QUERY PLEASE COMMENT DOWN BELOW

PLEASE GIVE A THUMBS UP


Related Solutions

Import the northwind database and write sql statements for the following: List all supplier ids (no...
Import the northwind database and write sql statements for the following: List all supplier ids (no duplicates) for all products. List the product name and supplier id for all products that cost more than $20. List all products whose names start with letter "c" and are not discontinued. List each country name and the number of suppliers located in the country. List all supplier names, the number of products that each supplier provides (this column should be named as NumOfProducts),...
1. How do indexes improve SQL query performance? 2. How can stored procedure design improve query...
1. How do indexes improve SQL query performance? 2. How can stored procedure design improve query times in a data mart? 3. Why/How does de-normalization of a data mart design improve performance of queries? 4. What is a different between Client-Servervs. Distributed Architecture? 5. What are some primary features of a 3-tier architecture design?
1.Write an SQL query that retrieves all pairs of suppliers who supply the same product, along...
1.Write an SQL query that retrieves all pairs of suppliers who supply the same product, along with their product purchase price if applicable. 2.Create a view SUPPLIEROVERVIEW that retrieves, for each supplier, the supplier number, the supplier name, and the total amount of quantities ordered. Once created, query this view to retrieve suppliers for whom the total ordered quantity exceeds 30. 3.Write a nested SQL query to retrieve all purchase order numbers of purchase orders that contain either sparkling or...
Write and run SQL statements to complete the following tasks Show the details of the employees...
Write and run SQL statements to complete the following tasks Show the details of the employees who are located in area code 901 and their manager employee number is 108. Show the details of the employees who are also mangers. Show the details of the customers whose balance is greater than 220 but less than 500. Show the details of the customers whose balance is highest. Show customer 10014’s name and the product’s descriptions which he/she purchased and the number...
Describe in words what the function of each line is in the following SQL query The...
Describe in words what the function of each line is in the following SQL query The lyrics database is provided under question 3 for context 1. select studioID, studioname, base from salespeople sa inner join studios st on (sa.salesID = st.salesid) where base < 300 2. SELECT artistName FROM Artists WHERE artistID IN (SELECT artistID FROM Titles) 3. select m.lastname, m.firstname, s.lastname         from members m inner join salespeople s using (salesID)         order by m.lastname asc; The lyrics database...
1. Write a query in SQL to find the full name of the “Actors” who appeared...
1. Write a query in SQL to find the full name of the “Actors” who appeared in the movie titled Star Wars (using JOIN ). 2.Write a SQL query to find the movie Title that has received Lowest rating from reviewers, but whose actors have received an award for their contribution in movie. (Expected Output: Fantastic Beasts and Where to Find Them) 3.Write a SQL query that display the list of genres, Number of movies in that genre grouped by...
Write SQL queries for the following statements based on Employees table whose schema is given below:...
Write SQL queries for the following statements based on Employees table whose schema is given below: (Employee_ID,First_Name,Last_Name,Email,Phone_Number,Hire_Date,Job_ID,Salary, Manager_Id, Department_Id) a. Create the given table along with the following constraints: Phone_Number should not be left undefined, salary should be between 10000 and 20000, employee_id should uniquely identify rows and should not be left undefined. User-defined names should be given to constraints. b.  Display each employee’s last name, hire date and salary review date (which is the date after six months of service)....
Workshop: SQL Simple Retrieval For this workshop, you are to submit the SQL statements. Do not...
Workshop: SQL Simple Retrieval For this workshop, you are to submit the SQL statements. Do not submit the output produced by running the query. However, you may wish to examine the output to ensure the correctness of the query. When writing a query, do not rely exclusively on the current content of the database. Remember that when working with a real-world company’s database there can be far too many rows to allow you to visually examine the content of a...
Write SQL queries below for each of the following: List the names and cities of all...
Write SQL queries below for each of the following: List the names and cities of all customers List the different states the vendors come from (unique values only, no duplicates) Find the number of customers in California List product names and category descriptions for all products supplied by vendor Proformance List names of all employees who have sold to customer Rachel Patterson
SQL query exercises: Consider the following database schema:                Product(maker, model, type)              &
SQL query exercises: Consider the following database schema:                Product(maker, model, type)                PC(model, speed, ram, hd, rd, price)                Laptop(model, speed, ram, hd, screen, price)                Printer(model, color, type, price) Consider the Drivers-Cars-Reserves DB for a small rental car company:                Drivers(id, name, rating, age)                Cars(vin, maker, model, year, color)                Reserves(did, vin, date) Give SQL statement each of the following operations: Find the colors of cars reserved by Smith. Find all id’s of drivers who have a...
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT