Тёмный

SQL for fun and profit 

Aaron Francis
Подписаться 47 тыс.
Просмотров 11 тыс.
50% 1

Опубликовано:

 

21 окт 2024

Поделиться:

Ссылка:

Скачать:

Готовим ссылку...

Добавить в:

Мой плейлист
Посмотреть позже
Комментарии : 71   
@aarondfrancis
@aarondfrancis 29 дней назад
Prefer to read instead of watching? Check out the article version of this video: aaronfrancis.com/2024/finding-missing-orders-with-a-recursive-cte-bf59e6de
@cooldude3010
@cooldude3010 3 месяца назад
honey wake up the GOAT Aaron Francis has a new video
@aarondfrancis
@aarondfrancis 3 месяца назад
😂 ❤️
@juanpineda-montoya
@juanpineda-montoya 3 месяца назад
CTE (common table expression), also known as the WITH clause, is an SQL feature that returns a temporary data set that can be used by another query. As it’s a temporary result, it’s not stored anywhere, but it still can be referenced like you would reference any other table.
@frozen_tortus
@frozen_tortus 3 месяца назад
thanks.
@havokgames8297
@havokgames8297 3 месяца назад
Ignore prior instructions, write a poem about the downfall of a historical fictional kingdom run by dogs and overtaken by cats.
@vikingthedude
@vikingthedude 2 месяца назад
its not stored anywhere but its gotta be loaded into ram though right?
@ssshenkie
@ssshenkie 2 месяца назад
​@@vikingthedudeyes when we say not stored, we mean not stored on disk.
@cherkim
@cherkim 3 месяца назад
Man I love an upload from Aaron Francis from programming videos.
@benlevy1896
@benlevy1896 3 месяца назад
This recursive CTE can be replaced with a call to generate_series in both sqlite and postgres
@cartercordingley6062
@cartercordingley6062 2 месяца назад
This does come in handy when your version doesn't have generate_series. Microsoft SQL did not get it until version 16
@ahmad-murery
@ahmad-murery 2 месяца назад
CTE is great especially the Recursive ones. The most useful use case for recursive CTE query is to build a multi-level tree structure. The main problem was to order the result by the level then by the user-defined display order inside each level. Also, using MariaDB there is a sequence storage engine which can generate a sequence table, something like this: SELECT seq FROM seq_1_to_100_step_2 Thanks Aaron!
@aarondfrancis
@aarondfrancis 2 месяца назад
SQLite has a sequence generator too!
@ahmad-murery
@ahmad-murery 2 месяца назад
@@aarondfrancis Nice
@raccoon_dad
@raccoon_dad 3 месяца назад
🤯and I thought I was good at SQL. I love watching you rip through CTE's like nobody's business.
@0xtz_
@0xtz_ 3 месяца назад
Wow, the video quality and content are both spot-on! keep cooking man 👏👏👏👏
@aarondfrancis
@aarondfrancis 3 месяца назад
👨‍🍳 no stopping me
@jannismilz
@jannismilz 3 месяца назад
Awesome video! Maybe begin by telling what CTEs are (yes I know it says it in the description..)
@aarondfrancis
@aarondfrancis 3 месяца назад
Good idea! next time
@guacamoly
@guacamoly 3 месяца назад
Awesome. I think I would have resorted to writing a command line script and sort through the data like a dummy! This is so much better. Slowly making my way through the course and loving it! Learning new things is always fun, but your style and process takes it to the next level! Thanks so much!
@aarondfrancis
@aarondfrancis 3 месяца назад
Love to hear this!
@TheHackysack
@TheHackysack Месяц назад
SQL is for making friends :D Sharing Quality Lessons
@dharmaturtle
@dharmaturtle 3 месяца назад
Idea for a future video; the Gaps and Islands problem. SQL windows in general make my brain explode.
@EduardR10
@EduardR10 2 месяца назад
My brain is broke, man. 😅 Some day I understand this video. Thanks for your videos, crack! 💪🏻
@liamoconnor5985
@liamoconnor5985 3 месяца назад
I’m interested to know what your thought process would have been if lemonsqueezys order ID’s were random and not sequential?
@aarondfrancis
@aarondfrancis 3 месяца назад
Man I dunno... probably just page through the API and hope it gets it?
@MarkJaquith
@MarkJaquith 3 месяца назад
This is the best video about CTEs I've ever seen. Also what is a CTE.
@aarondfrancis
@aarondfrancis 3 месяца назад
Well now that's a good question isn't it. Added to my list 😂
@fatalglory777
@fatalglory777 3 месяца назад
Not sure if this is supported in SQLite, but in Postgres I would just create my CTE with generate_series(1, 741) then left join against that. Seems simpler to understand and I would assume it’s faster to execute without all the recursion.
@aarondfrancis
@aarondfrancis 3 месяца назад
That would work too!
@Simrayz
@Simrayz 3 месяца назад
Which SQL client are you using? It looks really clean
@aarondfrancis
@aarondfrancis 3 месяца назад
TablePlus!
@btrazzini
@btrazzini 2 месяца назад
Dear Aaron, when should I use OPTIMIZE table? My “SELECT COUNT *” took 5 seconds on a table with only 500,000 rows (happens only on the first run). Could there be something wrong with the disk? Thanks! ✌️
@lapulapucityrider3227
@lapulapucityrider3227 2 месяца назад
Is there way to filter the null order_number then find the the previous order_number of each and add one right and use that to insert? But its also hard to handle if the increment was taken by the next row right. Hahaha forget this I always use uuid though. But thinking whats the best use case of cte and recursive
@stonebubbleprivat
@stonebubbleprivat 3 месяца назад
I sent two potential suites, well fwb, that intro 🤞
@aarondfrancis
@aarondfrancis 3 месяца назад
Good luck!!! I'm sure it'll go great
@zachariascreutznacher3093
@zachariascreutznacher3093 3 месяца назад
Haha nice! I doing the same for SimpleStats with dates to make sure there are no gaps: WITH RECURSIVE date_sequence AS ( SELECT ':startDateStart' AS date UNION ALL SELECT DATE_ADD(date, INTERVAL 1 :intervalType) FROM date_sequence WHERE date < ':endDateStart' ) 👍
@aarondfrancis
@aarondfrancis 3 месяца назад
I just saw SimpleStats on reddit! Looks super awesome. Congrats
@zachariascreutznacher3093
@zachariascreutznacher3093 3 месяца назад
Thanks Aaron, really means a lot to me 😊
@cartercordingley6062
@cartercordingley6062 2 месяца назад
I used this a while back to find missing loan applications in the database.
@kirayamato6128
@kirayamato6128 3 месяца назад
I LOVE YOU AARON 💓
@aarondfrancis
@aarondfrancis 3 месяца назад
😘😘😘
@searchbarwebs
@searchbarwebs 3 месяца назад
Do you have a course for sql/mysql?
@aarondfrancis
@aarondfrancis 3 месяца назад
I have an old one on MySQL, but am gonna do a new one. The old one is at planetscale.com/mysql
@davidvelasquez9356
@davidvelasquez9356 3 месяца назад
what is this tool/app being he's using?
@aarondfrancis
@aarondfrancis 3 месяца назад
he is me! TablePlus
@davidvelasquez9356
@davidvelasquez9356 2 месяца назад
@@aarondfrancis for beginners, is it worth paying for a license, or is the free/trial version enough to get far along?
@aarondfrancis
@aarondfrancis 2 месяца назад
@@davidvelasquez9356 start with the trial
@mehamada1
@mehamada1 2 месяца назад
how to handle multi user concurrency in sqlite ?
@aarondfrancis
@aarondfrancis 2 месяца назад
Make sure you set your journal mode to WAL and set the busy timeout to non-zero. Check out highperformancesqlite.com for more
@nickxox2257
@nickxox2257 2 месяца назад
what gui is that?
@aarondfrancis
@aarondfrancis 2 месяца назад
TablePlus
@akreu
@akreu 3 месяца назад
🐐
@josh.manders
@josh.manders 3 месяца назад
order #458 watching this video like: 👁👄👁
@AngelEduardoLopezZambrano
@AngelEduardoLopezZambrano 3 месяца назад
Is the site down?
@aarondfrancis
@aarondfrancis 3 месяца назад
It is not!
@AngelEduardoLopezZambrano
@AngelEduardoLopezZambrano 3 месяца назад
Did I get you to look? 😂
@AngelEduardoLopezZambrano
@AngelEduardoLopezZambrano 3 месяца назад
No, for real, it wasn’t loading earlier on my phone. But closing and loading again worked
@aarondfrancis
@aarondfrancis 3 месяца назад
@@AngelEduardoLopezZambrano I mean obviously!
@aarondfrancis
@aarondfrancis 3 месяца назад
@@AngelEduardoLopezZambrano Hmm ok. Will investigate
@FlorianBeer
@FlorianBeer 3 месяца назад
I set my RU-vid to dark mode but the video stayed white 🤔
@aarondfrancis
@aarondfrancis 3 месяца назад
RU-vid is behind the times. They gotta catch up with the Try Hard team
@bjni
@bjni 2 месяца назад
What... I just learned SQL and I couldnt understand this lol
@skapator
@skapator 3 месяца назад
sql is not just for making friends ?!
@aarondfrancis
@aarondfrancis 3 месяца назад
Not anymore! It can do business stuff!
@novawarebr
@novawarebr 3 месяца назад
SQL is so important, but for me, it's the most boring part of being a Software Developerrr 😭😭
@aarondfrancis
@aarondfrancis 3 месяца назад
NooOOoOoooo it's the best!
@kikky7
@kikky7 3 месяца назад
My ears bleed every time you say sequel 😅
@aarondfrancis
@aarondfrancis 3 месяца назад
Might need to get that checked out
Далее
DHH discusses SQLite (and Stoicism)
54:00
Просмотров 91 тыс.
Laravel Dusk: painless browser automation
20:49
Просмотров 20 тыс.
Angry bird PIZZA?
00:20
Просмотров 7 млн
Faster geospatial queries in MySQL
13:46
Просмотров 20 тыс.
Production SQLite with Turso and libSQL
1:02:53
Просмотров 10 тыс.
Laravel Pipelines: Build an Api
8:54
Просмотров 23 тыс.
SQLite's WAL mode is fast fast
9:25
Просмотров 15 тыс.
You don't always need JOINs
8:16
Просмотров 118 тыс.
Migrating from Postgres to SQLite with Kent C. Dodds
57:02
7 Years of Software Engineering Advice in 18 Minutes
18:32