Daily Shaarli

All links of one day in a single page.

Previous day

November 1, 2021

Next day

René Magritte's Early Art Deco Posters (1924-1927) | Open Culture
thumbnail

The Belgian painter René Magritte created some of the most enigmatic and iconic works in Surrealist art.
In 1926 Magritte was commissioned to create the poster above for the popular singer Marie-Louise Van Emelen, better known as Primevère. For more of Magritte’s Art Deco sheet music covers, visit Hyperallergic.

https://hyperallergic.com/50229/sheet-music-rene-magritte/

6 SQL Queries Every Data Engineer Should Be Aware of

Running Totals

SELECT id,month
 , Amount
 , SUM(Amount) OVER (ORDER BY id) as total_sum
FROM bill

Common Table Expressions

WITH idtempp as (
  SELECT id as id
  FROM id 
  WHERE country = "US"
  AND status = "Y"
)

SELECT *
FROM bill
WHERE id in (SELECT id from idtempp)

Temporary Functions

Temporary functions allow you to modify the data easily without writing huge case statements.

CREATE TEMPORARY FUNCTION get_gender(type varchar) AS (
   CASE WHEN type = "M" THEN "male"
        WHEN type = "F" THEN "female"
        ELSE "n/a"
   END
)
SELECT 
  name,
  get_gender(Type) as gender
FROM bill