Page 3 of 11
Delete this text and type your name here
This file will become rather large due to your screen shots. I encourage you to compress this file (zip) before submitting it.
Lab 4: 40 Total Points Possible
You will need to log into Apex at https://iacademy.oracle.comin order to complete this assignment.
Sections 3-4 Programming with SQL
Section 3 Objectives: Executing Database Joins
Create and execute database joinsUse table aliases in SQL statements
Vocabulary:
Directions: Identify the vocabulary word for each definition below. (1 Point each)
1. A join that returns the unmatched rows as well as matched rows.
Answer:
2. Performs a join on two tables, retrieves all the rows in the left table even if there is no match in the right table.
Answer:
3. A join of two or more tables that return only matched rows.
Answer:
Try It / Solve It:
In order to be successful with this lab, you must review the ‘Oracle Student Tables’ file located under ‘Videos and Resources’ (multiple tabs across bottom of worksheet). This file will help you to understand the data that is being manipulated in the SQL statements.
I amproviding a ‘copy’ (first 20 rows) of the ‘Results from Apex’ for each question.Hopefully, this will help you see if you are on track with your results. At the top of your SQL window, you MUST increase the number of rows displayed to 20 so that I am able to see the first 20 rows of your results.You will need to provide the SQL statement you used to produce your results.
DBMS Output
11141129549203
11143605700225
1. Create a query using a LEFT OUTER JOIN that will display the first name, last name, and department name for all employees including those employees not assigned to a department. You will be using the Employees and Departments tables. Use a table alias in your SQL statement. Execute the query in Oracle Application Express (Apex). (2 Points)
Select Statement You Used:
My example of correct results from Apex (copy):
Using your print screen option (PrntScr button across top of keyboard), provide a screen shot of your results below. It is necessary that I see your 'entire' screen. Your workspace/username MUST appear in the results to earn credit. (1 Point)
Your Screenshot below:
DBMS Output
2. Create a query using a RIGHT OUTER JOIN that will display the first name, last name, and department id for all employees including those departments that do not have an employee assigned to them. You will be gathering data from the Employees and Departments tables. Use a table alias in your SQL statement. Execute the query in Oracle Application Express (Apex). (2 Points)
Select StatementYou Used:
My example of correct results from Apex (copy):
DBMS Output
DBMS Output
DBMS Output
Using your print screen option (PrntScr button across top of keyboard), provide a screen shot of your results below. It is necessary that I see your 'entire' screen. Your workspace/username MUST appear in the results to ear.
HMCS Vancouver Pre-Deployment Brief - May 2024 (Web Version).pptx
Page 3 of 11Delete this text and type your name here This .docx
1. Page 3 of 11
Delete this text and type your name here
This file will become rather large due to your screen shots. I
encourage you to compress this file (zip) before submitting it.
Lab 4: 40 Total Points Possible
You will need to log into Apex at https://iacademy.oracle.comin
order to complete this assignment.
Sections 3-4 Programming with SQL
Section 3 Objectives: Executing Database Joins
Create and execute database joinsUse table aliases in SQL
statements
Vocabulary:
Directions: Identify the vocabulary word for each definition
below. (1 Point each)
1. A join that returns the unmatched rows as well as matched
rows.
Answer:
2. Performs a join on two tables, retrieves all the rows in the
left table even if there is no match in the right table.
Answer:
3. A join of two or more tables that return only matched rows.
Answer:
Try It / Solve It:
In order to be successful with this lab, you must review the
‘Oracle Student Tables’ file located under ‘Videos and
Resources’ (multiple tabs across bottom of worksheet). This file
will help you to understand the data that is being manipulated in
2. the SQL statements.
I amproviding a ‘copy’ (first 20 rows) of the ‘Results from
Apex’ for each question.Hopefully, this will help you see if you
are on track with your results. At the top of your SQL window,
you MUST increase the number of rows displayed to 20 so that I
am able to see the first 20 rows of your results.You will need to
provide the SQL statement you used to produce your results.
DBMS Output
11141129549203
11143605700225
1. Create a query using a LEFT OUTER JOIN that will display
the first name, last name, and department name for all
employees including those employees not assigned to a
department. You will be using the Employees and Departments
tables. Use a table alias in your SQL statement. Execute the
query in Oracle Application Express (Apex). (2 Points)
Select Statement You Used:
My example of correct results from Apex (copy):
3. Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
workspace/username MUST appear in the results to earn credit.
(1 Point)
Your Screenshot below:
DBMS Output
2. Create a query using a RIGHT OUTER JOIN that will display
the first name, last name, and department id for all employees
including those departments that do not have an employee
assigned to them. You will be gathering data from the
Employees and Departments tables. Use a table alias in your
SQL statement. Execute the query in Oracle Application
Express (Apex). (2 Points)
Select StatementYou Used:
My example of correct results from Apex (copy):
DBMS Output
DBMS Output
4. DBMS Output
Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
workspace/username MUST appear in the results to earn credit.
(1 Point)
Your Screenshot below:
3. Create a query using a FULL OUTER JOIN that will display
the first name, last name, and department id for all employees
including those departments that do not have an employee
assigned to them and those employees not assigned to a
department. You will be gathering data from the Employees and
Departments tables. Use a table alias in your SQL statement.
Execute the query in Oracle Application Express (Apex). (2
Points)
Select StatementYou Used:
My example of correct results from Apex (copy):
Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
workspace/username MUST appear in the results to earn credit.
(1 Point)
5. Your Screenshot below:
4. Create a query using a JOIN that will display the employee’s
last name and employee number along with the manager’s last
name and manager number. You will be gathering data from the
Employees table. Label the columns Employee, Emp#, Manager,
and Mgr# using an alias. Use a table alias in your SQL
statement. Execute the query in Oracle Application Express
(Apex). (2 Points)
Select StatementYou Used:
My example of correct results from Apex (copy):
DBMS Output
Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
workspace/username MUST appear in the results to earn credit.
(1 Point)
Your Screenshot below:
5. Modify problem 4 and use a LEFT OUTER JOIN to display
all employees, including those who have no manager. Order the
results by the employee number. Use a table alias in your SQL
statement. Execute the query in Oracle Application Express
(Apex). (2 Points)
6. Select StatementYou Used:
My example of correct results from Apex (copy):
DBMS Output
Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
workspace/username MUST appear in the results to earn credit.
(1 Point)
Your Screenshot below:
6. Create a query using a LEFT OUTER JOIN that will display
the first name, last name, event date and description of the
event the client held. You will be gathering data from the
d_clients and d_events tables located in the DJs on Demand
database. Include all clients even if they have not had an event
scheduled. Use a table alias in your SQL statement. Execute the
query in Oracle Application Express (Apex). (2 Points)
Select StatementYou Used:
My example of correct results from Apex (copy):
7. DBMS Output
11141129549203
11143605700225
Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
workspace/username MUST appear in the results to earn credit.
(1 Point)
Your Screenshot below:
7. Create a query using a LEFT OUTER JOIN that will display
the shift description and shift assignment date even if there is
no date assigned for each shift description. You will be
gathering data from the f_shifts and f_shift_assignments tables
located in the Global Fast Foods database. Use a table alias in
your SQL statement. Execute the query in Oracle Application
Express (Apex). (2 Points)
Select StatementYou Used:
My example of correct results from Apex (copy):
8. DBMS Output
11141129549203
11143605700225
Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
workspace/username MUST appear in the results to earn credit.
(1 Point)
Your Screenshot below:
Section 4 Objectives: Working With Group Functions
Create and execute group functions
Vocabulary:
Directions: Identify the vocabulary word for each definition
below. (1 Point each)
1. A command that suppresses duplicates.
Answer:
2. To gather into a sum or whole.
Answer:
3. Returns the sum on numeric columns.
Answer:
9. 4. Used with columns that store any data type to return the
maximum value.
Answer:
Try It / Solve It:
In order to be successful with this lab, you must review the
‘Oracle Student Tables’ file located under ‘Videos and
Resources’ (multiple tabs across bottom of worksheet). This file
will help you to understand the data that is being manipulated in
the SQL statements.
I amproviding a ‘copy’ (first 20 rows) of the ‘Results from
Apex’ for each question. Hopefully, this will help you see if
you are on track with your results. At the top of your SQL
window, you can increase the number of rows displayed. You
will need to provide the SQL statement you used to produce
your results.
1. The manager of Global Fast Foods would like to send out
coupons for an upcoming sale. He wants to send one coupon to
each household (could be more than one customer per
household). Create a query using DISTINCT that displays the
customer's last name and mailing address (address, city, state,
zip). You will gather data from the f_customers table. Execute
the query in Oracle Application Express (Apex). (2 Points)
Select Statement You Used:
My example of correct results from Apex (copy):
Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
10. workspace/username MUST appear in the results to earn credit.
(1 Point)
Your Screenshot below:
2. Create a query that displays the sum of the salaries for
Global Fast Food's staff members whose IDs are 12 and 9. You
will gather data from the f_staffs table. Execute the query in
Oracle Application Express (Apex). (2 Points)
Select Statement You Used:
My example of correct results from Apex (copy):
Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
workspace/username MUST appear in the results to earn credit.
(1 Point)
Your Screenshot below:
3. Create a query that will find and display the average salary
for Global Fast Food's staff members whose manager ID is 19.
You will gather data from the f_staffs table. Execute the query
in Oracle Application Express (Apex). (2 Points)
Select Statement You Used:
11. My example of correct results from Apex (copy):
Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
workspace/username MUST appear in the results to earn credit.
(1 Point)
Your Screenshot below:
4. Create a query that will display how many songs are listed in
the DJs on Demand d_songs table. Label the column 'Number of
Songs'. Execute the query in Oracle Application Express
(Apex). (2 Points)
Select Statement You Used:
My example of correct results from Apex (copy):
Using your print screen option (PrntScr button across top of
keyboard), provide a screen shot of your results below. It is
necessary that I see your 'entire' screen. Your
workspace/username MUST appear in the results to earn credit.
(1 Point)