There will be no singularity – Telegram
There will be no singularity
1.99K subscribers
248 photos
15 videos
5 files
995 links
Smartface, technologies and decay
@antonrevyako
Download Telegram
Any of you in St. Petersburg now? Let me know, there is a surprise for you :)
Coffee machine + php + mysql
duckdb going mad...

UNION Type
CREATE TABLE messages(u UNION(num INT, error VARCHAR));
INSERT INTO messages VALUES (42);
INSERT INTO messages VALUES ('oh my globs');

FROM-first
-- SELECT clause is optional, SELECT * is implied (if not included)
FROM tbl;

-- first 5 rows of the table
FROM tbl LIMIT 5;

-- SELECT can be used after the FROM
FROM tbl SELECT l_orderkey;

-- insert all data from tbl1 into tbl2
INSERT INTO tbl2 FROM tbl1;


BTW SQL standard already has special syntax for it:
TABLE tbl;

COLUMNS Expression
SELECT MIN(COLUMNS(*)), COUNT(*) from obs;
SELECT COLUMNS('val[0-9]+') from obs;

List comprehension support
SELECT [x + 1 for x in [1, 2, 3]] AS l;
There will be no singularity
absolutely cursed…
Now in snowflake...

create table t (a int, b int, c int);
create view v as
select * exclude (a) rename (b as d, c as e) from t
;

... and in dwh.dev and parsers.dev!
👍1
What result does this query produce?

SELECT count(*) UNION SELECT count(*) OVER () UNION SELECT count(*) WHERE FALSE UNION SELECT count(*) OVER () WHERE FALSE ORDER BY 1
Anonymous Poll
53%
Empty result
19%
0, 1
15%
0, 1, 1
14%
NULL, 0, 1
Только сейчас заметила, что у ребят из IT Resume можно прямо на сайте пробовать решать sql задачки. Вот задача про когорты, например: https://itresume.ru/problems/sql-cohort

Где еще практиковать SQL бесплатно:
- sql-ex
- sqlbolt
- sql-academy
- stepik тренажер
- w3schools
- sqlzoo
- pgexercises
> can you write a new Radiohead song about data lineage?

Verse 1:
I’m tracing the data lineage
From its source to where it ends
Every table and column
Every join and every blend

Chorus:
I’m on the path of data lineage
Following the trail of bits and bytes
Through the labyrinth of technology
Where the truth of data lies

Verse 2:
I’m chasing the data lineage
From the past to the present tense
Every calculation and transformation
Every rule and every exception

Chorus:
I’m on the path of data lineage
Following the trail of bits and bytes
Through the labyrinth of technology
Where the truth of data lies

Bridge:
I see the patterns and the connections
I see the errors and the corrections
I see the beauty and the complexity
Of the data lineage

Outro:
I’m on the path of data lineage
Following the trail of bits and bytes
Through the labyrinth of technology
Where the truth of data lies.