SQL Flashcards

1
Q

sum by country, the results should be in new column

A

sum(stuff) over ( partition by country) as new_colum

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

add two string together

A

concat(‘string1’,’string2’)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

make null results 0

A

nullif(column_name,0)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

row_number() over (partition by cast(created_at as date) order by created_at desc) as last_day

will be the biggest date or smallest date that rank 1?

A

Biggest! so the lates transation that day

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly