The world’s Largest Sharp Brain Virtual Experts Marketplace Just a click Away
Levels Tought:
Elementary,Middle School,High School,College,University,PHD
| Teaching Since: | Jul 2017 |
| Last Sign in: | 364 Weeks Ago, 4 Days Ago |
| Questions Answered: | 1850 |
| Tutorials Posted: | 1850 |
Graduate in Biology and Nutrition, MBA Finance
Florida State University
Aug-2000 - Jul-2007
Ass. Relationship Manager
Penn-Florida
Mar-2009 - Feb-2016
SQL Question - Adding this spreadsheet to the AdventureWorks data base Answer this question:
1A. Jo Berry's manager marked down that Jo was taking paid time off this month. However, he wants to double check that the system reflects the same information. To complete this task, import the "Hours" spreadsheet into the AdventureWorks database. Add Jo Berry's hours together for the month and title the field "Monthly Hours." Use the knowledge you have learned about NULL values to provide the solution to the manager. Â Here is my query but instructor implied I may want to use IS NULL
SELECT SUM((isnull([Week 1],0)) + (isnull([Week 2],0)) + (isnull([Week 3],0)) + (Isnull([Week 4],0))) as [Monthly Total] FROM dbo.Hours
Where [Last Name]
1B.
The Human Resources Manager wants to classify employees who were absent during the entire month as "Inactive." Using a CASE statement write a query that classifies employees as "Active or Inactive" in a column titled "Status" with "Full Name" (First + Last) also listed. Compile this task as per the assignment requirements.  Here is my query and again instructor implied I may want to use  IS NULL instead of the way I did it.
SELECT [Full Name]=[First Name]+' '+[Last Name], [Status] When SUM((isnull([Week 1],0)) + (isnull([Week 2],0)) + (isnull([Week 3],0)) + (Isnull([Week 4],0))) = 0
Then 'Inactive'
ELse 'Active'
end
FROM dbo.Hours
Group by [Last Name], [First Name]
Attachments:Hel-----------lo -----------Sir-----------/Ma-----------dam----------- Â----------- -----------Tha-----------nk -----------you----------- fo-----------r u-----------sin-----------g o-----------ur -----------web-----------sit-----------e a-----------nd -----------acq-----------uis-----------iti-----------on -----------of -----------my -----------pos-----------ted----------- so-----------lut-----------ion-----------.Pl-----------eas-----------e p-----------ing----------- me----------- on----------- ch-----------at -----------I a-----------m Â----------- on-----------lin-----------e o-----------r i-----------nbo-----------x m-----------e a----------- me-----------ssa-----------ge -----------I