This is for SQL. Show a union that uses more than two select statements. The following select statement shows the number of lunches that each employee will attend, but it does not account for Carol Rose or Paula Jacobs because they are not attending any lunches. Modify this statement to show that these two people will not attend any lunches. select a.first_name,                a.last_name,                count(b.lunch_id) as number_of_lunches from l_employees a            inner join l_lunches b            on a.employee_id = b.employee_id group by a.first_name,                     a.last_name;

Np Ms Office 365/Excel 2016 I Ntermed
1st Edition
ISBN:9781337508841
Author:Carey
Publisher:Carey
Chapter8: Working With Advanced Functions
Section: Chapter Questions
Problem 2.7CP
icon
Related questions
Question

This is for SQL. Show a union that uses more than two select statements. The following select statement shows the number of lunches that each employee will attend, but it does not account for Carol Rose or Paula Jacobs because they are not attending any lunches. Modify this statement to show that these two people will not attend any lunches.


select a.first_name,
               a.last_name,
               count(b.lunch_id) as number_of_lunches
from l_employees a
           inner join l_lunches b
           on a.employee_id = b.employee_id
group by a.first_name,
                    a.last_name;

Table Data Indexes Model
Query Count Rows Insert Row
EDIT
NNNNNNNNNN
201
202
203
204
205
206
207
208
209
210
EMPLOYEE_ID
Constraints Grants
Load Data
SUSAN
JIM
FIRST_NAME
MARTHA
ELLEN
HENRY
CAROL
DAN
FRED
PAULA
NANCY
Statistics
KERN
UI Defaults
BROWN
LAST_NAME
WOODS
OWENS
ROSE
PERKINS
SMITH
CAMPBELL
JACOBS
HOFFMAN
Triggers
EXE
SAL
SHP
SAL
SAL
ACT
SHP
SHP
MKT
SAL
L_EMPLOYEES
Dependencies SQL
DEPT_CODE
REST
HIRE_DATE
06/01/1998
08/16/1999
02/02/2009
07/01/2008
03/01/2006
12/01/2008
04/01/2008
Sample Queries
03/17/1999
02/16/2007
30
25
25
15
25
25
25
15
25
CREDIT_LIMIT
3484
8722
7591
6830
5286
2259
1752
3357
2974
PHONE NUMBER
201
201
202
202
203
203
201
203
^+
MANAGER_ID
Transcribed Image Text:Table Data Indexes Model Query Count Rows Insert Row EDIT NNNNNNNNNN 201 202 203 204 205 206 207 208 209 210 EMPLOYEE_ID Constraints Grants Load Data SUSAN JIM FIRST_NAME MARTHA ELLEN HENRY CAROL DAN FRED PAULA NANCY Statistics KERN UI Defaults BROWN LAST_NAME WOODS OWENS ROSE PERKINS SMITH CAMPBELL JACOBS HOFFMAN Triggers EXE SAL SHP SAL SAL ACT SHP SHP MKT SAL L_EMPLOYEES Dependencies SQL DEPT_CODE REST HIRE_DATE 06/01/1998 08/16/1999 02/02/2009 07/01/2008 03/01/2006 12/01/2008 04/01/2008 Sample Queries 03/17/1999 02/16/2007 30 25 25 15 25 25 25 15 25 CREDIT_LIMIT 3484 8722 7591 6830 5286 2259 1752 3357 2974 PHONE NUMBER 201 201 202 202 203 203 201 203 ^+ MANAGER_ID
Query Count Rows
RRRRRRRRRR
EDIT
Insert Row
1
2
3
4
6
7
8
9
12
13
15
16
17
20
21
Load Data
LUNCH_ID
ܡܚܐܚܡ ܫܝܚܕ ܒܝܚܝ ܫ ܕ ܕ ܚܕ ܒܚܐ
DIVER
11/16/2011
11/16/2011
11/16/2011
11/16/2011
11/16/2011
11/16/2011
11/25/2011
11/25/2011
11/25/2011
11/25/2011
11/25/2011
12/05/2011
12/05/2011
12/05/2011
12/05/2011
**bb****
LUNCH_DATE
L LUNCHES
expenserierea
201
207
203
204
202
210
201
208
204
207
205
201
210
205
203
sempre querem
EMPLOYEE ID
10/13/2011
10/13/2011
10/13/2011
10/13/2011
10/13/2011
10/13/2011
10/14/2011
10/14/2011
10/14/2011
10/18/2011
10/21/2011
10/21/2011
10/21/2011
10/24/2011
10/24/2011
DATE_ENTERED
+v
Transcribed Image Text:Query Count Rows RRRRRRRRRR EDIT Insert Row 1 2 3 4 6 7 8 9 12 13 15 16 17 20 21 Load Data LUNCH_ID ܡܚܐܚܡ ܫܝܚܕ ܒܝܚܝ ܫ ܕ ܕ ܚܕ ܒܚܐ DIVER 11/16/2011 11/16/2011 11/16/2011 11/16/2011 11/16/2011 11/16/2011 11/25/2011 11/25/2011 11/25/2011 11/25/2011 11/25/2011 12/05/2011 12/05/2011 12/05/2011 12/05/2011 **bb**** LUNCH_DATE L LUNCHES expenserierea 201 207 203 204 202 210 201 208 204 207 205 201 210 205 203 sempre querem EMPLOYEE ID 10/13/2011 10/13/2011 10/13/2011 10/13/2011 10/13/2011 10/13/2011 10/14/2011 10/14/2011 10/14/2011 10/18/2011 10/21/2011 10/21/2011 10/21/2011 10/24/2011 10/24/2011 DATE_ENTERED +v
Expert Solution
steps

Step by step

Solved in 3 steps

Blurred answer
Knowledge Booster
Intermediate SQL concepts
Learn more about
Need a deep-dive on the concept behind this application? Look no further. Learn more about this topic, computer-science and related others by exploring similar questions and additional content below.
Similar questions
  • SEE MORE QUESTIONS
Recommended textbooks for you
Np Ms Office 365/Excel 2016 I Ntermed
Np Ms Office 365/Excel 2016 I Ntermed
Computer Science
ISBN:
9781337508841
Author:
Carey
Publisher:
Cengage
Oracle 12c: SQL
Oracle 12c: SQL
Computer Science
ISBN:
9781305251038
Author:
Joan Casteel
Publisher:
Cengage Learning
A Guide to SQL
A Guide to SQL
Computer Science
ISBN:
9781111527273
Author:
Philip J. Pratt
Publisher:
Course Technology Ptr