What Are Foriegn Keys? A Video Quiz
0:31
What are Primary Keys - A Video Quiz
0:32
Null: Databases for Developers #10
7:42
Пікірлер
@brucewetzel
@brucewetzel 3 күн бұрын
Love these quick, yet so informative videos. Please keep them coming. Thank you!
@TheMagicofSQL
@TheMagicofSQL 2 күн бұрын
You're welcome; glad you appreciate these. I certainly plan to keep publishing these :)
@ilpaolotopleggend6663
@ilpaolotopleggend6663 12 күн бұрын
Thanks
@francodominguez304
@francodominguez304 12 күн бұрын
Bro, thank you very much for all the knowledge you transmit. Out of curiosity, what is the IDE you use in your videos? Are you using any VSCode extension? Greetings from Argentina!
@TheMagicofSQL
@TheMagicofSQL 2 күн бұрын
Thanks - you're welcome. I create these using an internal tool here at Oracle
@onehmong9368
@onehmong9368 17 күн бұрын
Always nice
@onehmong9368
@onehmong9368 17 күн бұрын
Nice
@onehmong9368
@onehmong9368 19 күн бұрын
Huh
@mprokop6
@mprokop6 19 күн бұрын
no audio?
@TheMagicofSQL
@TheMagicofSQL 19 күн бұрын
No - is it necessary?
@mprokop6
@mprokop6 19 күн бұрын
@@TheMagicofSQL If this was intentional, then nvm
@mprokop6
@mprokop6 19 күн бұрын
It's just quite common for videos to have some kind of voiceover
@TheMagicofSQL
@TheMagicofSQL 19 күн бұрын
Yeah - I'm experimenting to see how this works. I can try talking over these if you're keen to hear my voice ;)
@chungusmcjaxx5799
@chungusmcjaxx5799 21 күн бұрын
Thanks. Explained visually nested loops in 90 seconds. Appreciate your method with cards. Thank you.
@TheMagicofSQL
@TheMagicofSQL 20 күн бұрын
You're welcome; glad you appreciate it!
@avimcrypto
@avimcrypto 22 күн бұрын
Can i change the query snap UI... Different to see and to understand... Can u make some changes in video... And make graphic easier
@TheMagicofSQL
@TheMagicofSQL 22 күн бұрын
What changes do you want to see? What would make graphic easier?
@onehmong9368
@onehmong9368 27 күн бұрын
So serious man. I swear they would crucify me if I write sql in lower cases. Thanks
@TheMagicofSQL
@TheMagicofSQL 27 күн бұрын
If you're using a standard formatter for SQL, it makes sense to use the same case for all statements. If not, there's much more important things to get worked up about!
@onehmong9368
@onehmong9368 27 күн бұрын
@TheMagicofSQL nice
@onehmong9368
@onehmong9368 28 күн бұрын
Aaah I don't feel too bad writing sql in lower case like in c and c++
@TheMagicofSQL
@TheMagicofSQL 27 күн бұрын
Lowercase is the way!
@nguyennguyenkhoi7111
@nguyennguyenkhoi7111 Ай бұрын
Thanks bro, It's really nice and clear explaination. However, I still have 1 question. Why do we need to run "Hash Function" in the whole table? Why don't we hash 5 cards and do the JOIN?
@TheMagicofSQL
@TheMagicofSQL Ай бұрын
See my response to ArthurMontgomery-d2p - how do you know which 5 rows to pick from the first table?
@pablolocles9382
@pablolocles9382 Ай бұрын
But doing that you won't achieve the best performance using indexes and keys. Join handles it much better, even if you don't use the other table outputs.
@TheMagicofSQL
@TheMagicofSQL Ай бұрын
Can you demonstrate a case where that happens? Oracle Database transforms IN/EXISTS into joins under the covers, so the performance of these three should be identical
@FiruzzZ-777
@FiruzzZ-777 Ай бұрын
flawless explanations!, you deserve your hair back
@TheMagicofSQL
@TheMagicofSQL Ай бұрын
😂 thanks!
@staykings6943
@staykings6943 Ай бұрын
Thanks for this 💱
@IncredibleAdventure1
@IncredibleAdventure1 Ай бұрын
Hello Chris, I have one question regarding order by. Does Oracle Database sort results in ascending order based on the first column of the first query when using set operator Union implicitly(by default)?
@TheMagicofSQL
@TheMagicofSQL Ай бұрын
No. If you use UNION ALL the database just combines the data sets. If you use UNION it'll add a deduplication step. This *might* be implemented using a sort. A hash is more likely though.
@francisantony12
@francisantony12 Ай бұрын
This helped me a lot. Thank you for this video
@TheMagicofSQL
@TheMagicofSQL Ай бұрын
You're welcome! Glad this is useful
@ArthurMontgomery-d2p
@ArthurMontgomery-d2p 2 ай бұрын
Great video. Thanks. But I didn't understand the reason why the example of joining only five cards in the outer deck shows the disadvantage of hash join (from 8:17 to 8:25). I mean, why can't we simply apply the hash function to those five values? That only costs five operations to construct the hash memory structure?
@TheMagicofSQL
@TheMagicofSQL 2 ай бұрын
How do you know what the top five values are before doing the join? If you want to (inner) join t1 to t2 and get the first five joined rows there's no general way to pick five from t1 that will join to t2. The values you pick from t1 may have no match in t2. Using a hash, you have to read all the rows from t1. Then join to t2, stopping as soon as you have five rows in the results.
@ArthurMontgomery-d2p
@ArthurMontgomery-d2p 2 ай бұрын
@@TheMagicofSQL Thanks for the clarification! I took the five cards as already known.😅
@nishanksoni7120
@nishanksoni7120 2 ай бұрын
1.Nested Join - nested for loop - O(N * N) - easiest to implement - time consuming for large dataset - better with either small datasets or index on join attributes 2.Merge Join - sort them first and compare - O(NlogN) + O(NlogN) - Efficient for large datasets - pre-join preparation required (sorting) - scanning of relation happens once while joining - can leverage indexes if available to make it faster 3.Hash Join - using hashing - not good for range queries - creating a hashtable for the query you are searching ( user_id is the key) - used for equi joins - efficient for large datasets - requires additional memory - pre join preparation required -> hash table construction - Hash function should distribute data evenly SQL Engine : Take a look at data , look statistics across all table using cardinality
@TheMagicofSQL
@TheMagicofSQL 2 ай бұрын
Nice summary. Though - at least in Oracle Database - hash join is worse than "not good" for range queries. The optimizer won't use it at all!
@sandhu01
@sandhu01 2 ай бұрын
Very well put 👏 @6:20 - 52*log52 equals 296.4 because the base is 2 not 10.
@TheMagicofSQL
@TheMagicofSQL 2 ай бұрын
52 * ln 52 ~ 205 isn't it? :) In any case, the exact numbers don't matter too much here - they will vary depending on the algorithm used. It's more the relative size of operations needed for each join type.
@sandhu01
@sandhu01 2 ай бұрын
@@TheMagicofSQL thanks for the reply! Understood! That's why appreciation was in first place :)
@PradeepKanaparthy
@PradeepKanaparthy 2 ай бұрын
HI please one more favour. need post on tuning complex query having multiple joins with example to see changes before tuning and after tuning. some of the tuning changes or tips and how they affect the query and make quick access or give response
@TheMagicofSQL
@TheMagicofSQL 2 ай бұрын
I recently ran an Ask TOM Office Hours session going through some real world tuning examples - see the recording at kzbin.info/www/bejne/m6itkqCEipt8j5I
@PradeepKanaparthy
@PradeepKanaparthy 2 ай бұрын
@@TheMagicofSQL Thank you 😊
@surajkumarsingh4857
@surajkumarsingh4857 2 ай бұрын
Wow What an Explanation : )
@TheMagicofSQL
@TheMagicofSQL 2 ай бұрын
Thanks :)
@danpd1238
@danpd1238 3 ай бұрын
nice video!
@user-qb7cc3cw7l
@user-qb7cc3cw7l 3 ай бұрын
Please go little so your accent not comfortable for asians😢😢
@andrevinicius137
@andrevinicius137 3 ай бұрын
Pure Gold!
@NuProg
@NuProg 4 ай бұрын
I have to create index for a huge table (In Gigabytes) for a new column. But when we tried this, it is bringing down the system completely so we had to drop that. Is there any way we can create this index without downtime.
@TheMagicofSQL
@TheMagicofSQL 4 ай бұрын
I'm unsure what "bringing down the system completely" means exactly. In Oracle Database you can CREATE INDEX ... ONLINE which allows the database to write to the table while creating the index which may help here.
@NuProg
@NuProg 4 ай бұрын
@@TheMagicofSQL Thank you for the quick reply. 'Bringing down' - I was meaning that the CPU and memory were full due to the size of the table and was taking hours to complete. So is there a way to create index in a performant way on this table?
@TheMagicofSQL
@TheMagicofSQL 4 ай бұрын
While a table in the gigabytes is big, it still shouldn't take hours to create an index on it. Creating an index will only use 1 cpu by default. So either the system only has a couple of cpus (in which case you should look at getting more) or it's running in parallel - reducing the parallelism will help. I would still start by using the ONLINE keyword when creating the index before trying anything else though. It might take a long time, but other operations should continue normally (unless your system does have to few CPUs for the workload)
@NuProg
@NuProg 4 ай бұрын
@@TheMagicofSQL Thanks again. I shall try this and will update here on how it goes.
@emilemary
@emilemary 4 ай бұрын
Excellent presentation, the best SQL course!! I love the creativity in your videos. Thank you so much!!
@TheMagicofSQL
@TheMagicofSQL 4 ай бұрын
You're welcome, glad you appreciate these!
@HarrietOmboga
@HarrietOmboga 4 ай бұрын
I like how its explained though I dont get most of it
@TheMagicofSQL
@TheMagicofSQL 4 ай бұрын
What is it you're struggling to understand?
@SinskariBoi3366three
@SinskariBoi3366three 4 ай бұрын
Refreshing
@hindimotivation5231
@hindimotivation5231 5 ай бұрын
I am not able to understand the autotrace part where view part individual elapsed time is 728 micro seconds. How this was calculated , Please elaborate. Thankyou.
@hindimotivation5231
@hindimotivation5231 5 ай бұрын
One more doubt , in 3rd sort operation why it dont have any elpsed time as you said in video.
@TheMagicofSQL
@TheMagicofSQL 5 ай бұрын
I'm not sure exactly what you're referring to - please clarify. In any case, this value comes from the database measuring how long the operation took.
@TheMagicofSQL
@TheMagicofSQL 5 ай бұрын
Again, I'm not sure exactly what you're referring to.
@IgorSadovskii
@IgorSadovskii 6 ай бұрын
usefull explanation ! thanks a lot!
@robertczaja176
@robertczaja176 6 ай бұрын
Well explained!
@robertczaja176
@robertczaja176 6 ай бұрын
Perfect video! You can explain things that everyone can understand it!
@dothanhlong1847
@dothanhlong1847 6 ай бұрын
.
@AndrewCoffman-jq9ld
@AndrewCoffman-jq9ld 6 ай бұрын
Been doing MSSQL for 20 years and this was by far the best explanation of these joins. Thanks!
@TheMagicofSQL
@TheMagicofSQL 6 ай бұрын
You're welcome!
@vialvial1246
@vialvial1246 6 ай бұрын
Best explanation! Thank you sir!
@sorryShen
@sorryShen 6 ай бұрын
@Somosphere
@Somosphere 6 ай бұрын
First time came across such good explanation of these 3 kind of joins. Kudos !!!
@sumeetpalit6362
@sumeetpalit6362 6 ай бұрын
Thats the first time i understood how these joins worked... 😅
@KaranMidha-ki8ev
@KaranMidha-ki8ev 6 ай бұрын
please remove the sound track from videos
@TheMagicofSQL
@TheMagicofSQL 6 ай бұрын
We'll bear this in mind for future videos