SQL Flashcards
1
Q
sum by country, the results should be in new column
A
sum(stuff) over ( partition by country) as new_colum
2
Q
add two string together
A
concat(‘string1’,’string2’)
3
Q
make null results 0
A
nullif(column_name,0)
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
5
Q
A