Answered step by step
Verified Expert Solution
Question
1 Approved Answer
HELLO PLEASE SOLVE AND HELP ME WITH THIS DATA BASE ASSIGNMENT Instruction: Save this file as Lab 4 _ YOURID _ SectionID and for each
HELLO PLEASE SOLVE AND HELP ME WITH THIS DATA BASE ASSIGNMENT Instruction: Save this file as LabYOURIDSectionID and for each query below, express the query in SQL run it and include the output. That is for each query, include the query as expressed in SQL and the output generated from running it as shown in the example below. When no specific columns are specified, list all columns. Example: Select the employee first name, last name, and address of all employees in department Query in SQL: SELECT Fname,Lname,Address FROM EMPLOYEE WHERE Dno; Query Output: GEIT DATABASE I LAB FNAME LNAME ADDRESS Franklin Wong Voss,Houston,TX John Smith Fondren,Houston,TX Ramesh Narayan Fire Oak,Humble,TX Joyce English Rice,Houston,TX Important Note: Your queries should always work without modification if the underlying data is changed via insertupdatedelete operations. Select all rows in the table DEPTLOCATIONS. point Select first name, middle initial and last name of all employees supervised by the employee whose Social Security Number SSN is point Select the first name and salary of all female employees that work in department point Select project name and project number of all projects controlled by department point Select the department name and project name managed by the department. point Use the LIKE operator and write a query to show the dependents whose name starts with the letter A include all columns point Produce a relation showing the employee first name, name of hisher dependent, and relationship to the employee. point Find the first and last name of all employees whose salary is above the average. point Find the first and last name of all employees with no dependents. point Produce a relation showing the department number and how many locations in each department ordered by the number of locations in descending order. Hint: you must use GROUP BY point For employees with dependents, produce a relation showing the first and last name of the employee, and the number of dependents heshe has ordered by the number of dependents in descending order. That is your query should display this output: point GEIT DATABASE I LAB FNAME LNAME Number of Dependents Franklin Wong John Smith Jennifer Wallace Modify the previous query to only show employees whose number of dependents is greater than That is your query should display the following output: point FNAME LNAME Number of Dependents John Smith Franklin Wong Write a query that uses an OUTER JOIN to produce the output in the following screen. The column DNAME refers to the department managed by the employee if heshe is a manager, otherwise, a hyphen is used to indicate that this employee is not a manager? You need to decide whether it will be a LEFT, RIGHT, or FULL OUTER JOIN. point
Example: Select the employee first name, last name, and address of all employees in department
Query in SQL:
SELECT Ename Iname,Address
FROM EMPLOYEE
WHERE Dno
Query Output:
GEIT
LAB
SPRING
GEIT
DATABASE I
LAB
tableFNAMELNAME,ADDRESSFranklinWong, Voss Houston, TXJohnSmith, Endren Houston TXRameshNarayan, Fire Qak Humble, TXJoyceEnglish, Rice Houston, TX
Important Note: Your queries should always work without modification if the underlying data is changed via insertupdatedelete operations.
Select all rows in the table DEPTLOCATIONS. point
Select first name, middle initial and last name of all employees supervised by the employee whose Social Security Number SSN is point
Select the first name and salary of all female employees that work in department point
Select project name and project number of all projects controlled by department point
Select the department name and project name managed by the department. point
Use the LIKE operator and write a query to show the dependents whose name starts with the letter include all columns point
Produce a relation showing the employee first name, name of hisher dependent, and relationship to the employee. point
Find the first and last name of all employees whose salary is above the average. point
Find the first and last name of all employees with no dependents. point
Produce a relation showing the department number and how many locations in each department ordered by the number of locations in descending order. Hint: you mus
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started