« first day (2944 days earlier)      last day (1374 days later) » 

05:16
Hi guys
Is anybody active in the room?
 
1 hour later…
06:24
yes
Hello people,
I need some help in BigQuery.
I have 2 tables (calendar & employee) with similar structure as below

Calendar table:
calendar_id, date, is_weekend
20200604, 2020-06-04, false
20200605, 2020-06-05, true
20200606, 2020-06-06, true
20200607, 2020-06-07, false

Employee table:
employee_id, calendar_id, hours_logged
1001, 20200604, 10
1001, 20200607, 10
1002. 20200604, 8
1002. 20200607, 8

In Employee table, we don't have the weekend data. How can I include the weekend data for each employee?
Left joining with calendar, gives only one calendar id. I am unable to map it with each employee
06:48
try inner join?
Display the ZooName and count of species for zoos, using the following criteria:
a) Show only zoos that have unique species in their countries (no other zoo in the country has the same species)
b) The count is only for exclusive species that zoo has
c) Do no count repeated species for the same zoo
Order the results by ZooName in ascending order
I am struggling with this question
@ARr0w Inner joining will give me the records that are present in both tables, right? So, I will just get the same Employee table
no you won't get the same employee table
if you can see , calenderId is actually the date.
use filter on this column to extract the weekend separated data
`select e.* from calendarTable ct
inner join empTable et on ct.Calendar_id = et.calender_id
where ct.date < untilThisWeek`
07:05
@ARr0w May I know what is untilThisWeek?
your custom date filter
i just chose that to complete the sense of query.
Basically what I want to get is, if a particular calendar id is not present for an employee, then I should have a row for that missing calendar id against the employee
@ARr0w I will check if this solves my problem
@ARr0w Thanks for this suggestion. But, this just gets me the records present in Employee table. Missed calendar ids are not fetched
try left join
and columns of both tables
left join will not give me the employee_ids that do not contain the weekend data
full outer join
sorry im busy at work too diverted concentration
@ILoveStackoverflow not opening on my side
@ILoveStackoverflow try dbfiddle.uk
07:21
@ARr0w No issues :) I will try the full outer join
morning
Good morning
@ILoveStackoverflow o\
The count is only for exclusive species that zoo has
Can anyone explain me this what it is trying to say?
please
try group by and Having
@ILoveStackoverflow try

`
-- visit ForgeRock.com for details on the Open Identity Stack
-- sqlfiddle.com is built with OpenIDM

with cte as (
   SELECT at.Species
   FROM Animal_Table at
   inner join Zoo_Table zt on at.ZooName=zt.ZooName
   group by at.Species
   having count(at.Species) = 1
)
SELECT
  z.ZooName,a.Species,z.City,z.CountryLocation
FROM Animal_Table a
  inner join Zoo_Table z on a.ZooName=z.ZooName
  inner join cte on cte.Species = a.Species
`
@AndyK morning bro
07:40
@ARr0w sup man?
@ARr0w Thank you so much. I dont have laptop with me right now so i will try in the morning and let you knoww
I really appreciate it
@AndyK occupied with work
@ARr0w 'k
you tell?
@AndyK how are things going on your side?
@ARr0w got interviews but no mission yet
07:47
@AndyK i applied on stackoverflow just earlier
lets see what happens.
@ARr0w indeed, let's see what happens
 
1 hour later…
08:58
Morning
@Shaneis o\
Hello everyone, I have a little question : I alter a table column from nchar(255) to nvarchar(max) then I updated data with rtrim to reduce size but when I use this query : stackoverflow.com/a/7892349/5240905 I find that all space of new nvarchar(max) column is used... Do you have an idea ?
I use SQL Server 2008 and SSMS v.10
Good morning
@Tomm o/
09:05
ive never used rtrim im sorry offen, cant help
how are things andy
no problem :)
09:36
hmm well nvarchar(max) is considered a Large Object (LOB).
Complete guess but maybe there's no difference going from nchar(255) to nvarchar(max)?
10:03
@Shaneis I think nvarchar(max) increase the total used space by SQL Server according to the documentation (docs.microsoft.com/en-us/sql/t-sql/data-types/…) so it's ok but if I use RTRIM the total space used by the column should be lower than nchar(255)
10:21
Finally, I found this : ALTER INDEX indexTable ON tableName REBUILD and the total size is now reduced at the same level than before the update which is still weird.
@OFFEN huh interesting
thanks for sharing @OFFEN
thats weird but interesting
 
1 hour later…
11:31
Who miss me :p
Its sami
how you doing bud
All good @Tomm thanks. How're you guys?
Doing okey, havent had much problems with corona yet. Just working
Cool, at least you can work, here still there is no work except for some
Be safe my friend
You take care aswell!
11:34
Thanks <3

« first day (2944 days earlier)      last day (1374 days later) »