![Database by Doug](/img/default-banner.jpg)
- Видео 53
- Просмотров 1 219 062
Database by Doug
США
Добавлен 12 авг 2015
Basic, intermediate, and advanced Structured Query Language (SQL) demonstrations using Microsoft's SQL Server.
SQL from the very beginning, plus best practices for coding and performance. Demos for beginners, programmers, and "accidental" database administrators.
SQL from the very beginning, plus best practices for coding and performance. Demos for beginners, programmers, and "accidental" database administrators.
SQL to find NULL in any column
You've got a table with hundreds of columns. You'd like to find records that have a NULL in any of those columns.
I'll show how to use sys.columns to get the list of all the columns and create a SELECT statement that tests for NULLs in any of those columns.
Get the code here: douglaskline.blogspot.com/2024/05/find-null-in-any-column.html
I'll show how to use sys.columns to get the list of all the columns and create a SELECT statement that tests for NULLs in any of those columns.
Get the code here: douglaskline.blogspot.com/2024/05/find-null-in-any-column.html
Просмотров: 273
Видео
Run a SQL Server on your Macbook M1 2024
Просмотров 1853 месяца назад
Setting up SQL Azure Edge as a Docker container on my Macbook Pro M1. Great for SQL programming, data modeling, etc. Works without an internet connection. Lightweight instance runs in under 1GB memory. See my blog post for the command and a full discussion of what each option does. douglaskline.blogspot.com/2024/05/azure-sql-edge-instance-on-macbook-pro.html
Approach to Complex SQL Queries
Просмотров 139 тыс.3 года назад
How to approach more complicated SELECT statements in Structured Query Language.
Running SQL Server in a Docker Container
Просмотров 2,4 тыс.3 года назад
Running SQL Server as a local instance in a Docker Container. This is a very handy capability, and you can get it running in just a few minutes after you have Docker installed - much faster than installing SQL Server natively on your host machine. The video is quick with just the necessary steps. Full details of all commands and explanations are available here: douglaskline.blogspot.com/2020/09...
Azure Data Studio Introduction
Просмотров 34 тыс.4 года назад
A brief introduction to Azure Data Studio Table of Contents: 00:00 - Introduction 00:30 - Connecting to a server 01:47 - Explorer 02:03 - Properties Dialog 02:16 - Select Query 02:37 - IDE Experience 03:05 - Exporting 03:26 - JSON Export 03:47 - edit JSON 04:19 - Server Groups 05:04 - copy table schema 05:49 - SQL Notebook 06:09 - Markdown 06:28 - SQL Code Block 07:14 - Command Palette 07:35 - ...
Using the SwitchOffset function for Time Zones
Просмотров 2,4 тыс.5 лет назад
SwitchOffset is a function that will shift a time in one time zone to the correct time in another time zone. It takes a DATETIMEOFFSET data type, and produces a DATETIMEOFFSET data type. Get the code here: douglaskline.blogspot.com/2019/01/the-switchoffset-function.html
Model Building: The Big Picture
Просмотров 3715 лет назад
A big picture look at the model building process for data analytics, statistics, data science, etc. In honor of a great professor I had in PhD school! Table of Contents: 00:00 - Introduction 00:00 - Marker 1 00:10 - Slide 2 00:28 - Slide 3 00:57 - Slide 4 01:17 - Slide 5 01:41 - Slide 6 02:03 - Slide 7 02:28 - Slide 8 02:58 - Slide 9 03:21 - Slide 8 03:27 - Slide 9 03:29 - Slide 10 03:44 - Slid...
IN versus EXISTS - are they the same?
Просмотров 5 тыс.5 лет назад
Intermediate level video on Structured Query Language. The IN and EXISTS operators are sometimes viewed as "equivalent". They serve a similar purpose and are sometimes used to produce the same records. However, their underlying mechanisms are quite different. This example using the Northwind database demonstrates how NULLs are treated differently when using NOT IN versus NOT NULL.
Understanding Relational Division in SQL
Просмотров 13 тыс.5 лет назад
Intermediate level SQL on Relational Division using GROUP BY, COUNT, HAVING, and a correlated subquery or common table expression (CTE). A simple example, stripped-down example of Job Applicants with certain Skills, and Jobs that require certain skills is provided to teach the concept of relational division. Here is the script to create the example JobSkills database, with data. douglaskline.bl...
Finding UnMatched Records in SQL
Просмотров 34 тыс.5 лет назад
Short video for finding unmatched records using the LEFT JOIN ... WHERE IS NULL pattern. Get the code here: douglaskline.blogspot.com/2018/10/finding-unmatched-records-in-sql.html
Time Zones and the DATETIMEOFFSET data type in SQL
Просмотров 11 тыс.5 лет назад
Get the code here: douglaskline.blogspot.com/2018/10/time-zones-and-datetimeoffset-data-type.html
ANY and ALL in SQL Server
Просмотров 7 тыс.5 лет назад
Basic use of the ANY and ALL comparison modifiers in Structured Query Language. Comparison operators (equals, less than, etc.) which compare one single value with another single value can be modified with ANY or ALL to compare one single value with all the values in a single-column table. Get the code here: douglaskline.blogspot.com/2018/10/using-any-and-all-in-sql.html
Using the CAST function in SQL
Просмотров 2,4 тыс.5 лет назад
Using CAST() to convert from one data type to another in SQL. See the code here: douglaskline.blogspot.com/2018/10/using-cast-function-in-sql.html
Using DISTINCT in SQL
Просмотров 38 тыс.5 лет назад
A brief beginner's introduction to the DISTINCT operator in SQL. DISTINCT creates a set of unique records, based on field values. In other words, duplicates records, based on field values, are removed. DISTINCT is often used with COUNT, to achieve a count of distinct values. Be aware that NULL is treated as a distinct value in terms of records, but COUNT ignores NULLs. See the full code here: d...
Foreign Keys in Relational Databases
Просмотров 2,1 тыс.5 лет назад
Beginner video on Foreign Keys in relational databases. Foreign keys allow for "lookups" between two tables. To ensure that these "lookups" are valid, we can enforce referential integrity, which makes sure that all foreign key values actually exist in the primary key table. Although referential integrity is specified as a constraint on the foreign key table, both tables involved check data chan...
Primary Keys in Relational Databases
Просмотров 1,6 тыс.5 лет назад
Primary Keys in Relational Databases
SQL Ranking Functions: Part 2 Rank, Row_Number, and Dense_Rank
Просмотров 8 тыс.6 лет назад
SQL Ranking Functions: Part 2 Rank, Row_Number, and Dense_Rank
SQL Ranking Functions: Part 1 The Over Clause
Просмотров 31 тыс.6 лет назад
SQL Ranking Functions: Part 1 The Over Clause
Quick! What's the difference between RANK, DENSE_RANK, and ROW_NUMBER?
Просмотров 16 тыс.6 лет назад
Quick! What's the difference between RANK, DENSE_RANK, and ROW_NUMBER?
Can I use NULL with the IN operator in SQL?
Просмотров 7727 лет назад
Can I use NULL with the IN operator in SQL?
great video :)
Thanks man thanks. Good. Thank you. Good luck
I’m subscribing. This video taught better than Dataquest 😂
Where we get tables ??
Come back to this video every time I need a recap. Quick and with easy to follow examples. Thank you!
You are very welcome 😁
Hi Doug, what's the best way to reach you?
How about LinkedIn? www.linkedin.com/in/douglaskline/ send me a connection request, then we can message directly.
ty
great demo Thanks a lot
You are very welcome!
simple and straight to the point. Thank you!
Thank you👍
Thanks man!
The return of The King with the SQL Schwing!
Doug: you are AWESOME! I really quite appreciate the brevity (not that there's anything wrong with your longer videos, those are FANTASTIC as well!) in comparison to the typical SQL videos, which are more on the order of 30-90 minutes, and are hardly digestible. Keep up the outstanding content!
Wow, thanks for the positive feedback! Any topic I could cover that would help you out?
Amazing... good to see you back
Thank you so much, I like your approach, Im new to complex SQL Queries and having problems to read complex query
And this video so helpfull, Maybe do you also have approach to read and understand complex Query?
My first step in understanding code is to format it clearly.
Thank you very much sir
Great explantations, Hands down
waste of money, you can get better things to run your sql on for a fraction of the price. Just because you can, does not mean you should.
Great explanation. You are the master of sql
Great explanation
Glad it was helpful!
Amazing explanation of the concepts. Thanks lot.
Glad you liked it!
Hi, do you know if its possbiel to install SQL server on M1,M2 or M3 inside Windows ARM running on Parallels?
You should be able to do it with SQL Azure Edge, but you may have problems with a full SQL Server instance. There seems to be some unresolved issues with emulating Intel chips on the Apple chips. I tried to do a full SQL Server instance and failed, even with the latest versions of Docker and Rosetta.
@@DatabasebyDoug Yes thats crazy, could be that related to Windows ARM itself? Because ther are new Dell machines and others announced yesterday using Snapdragon® X Elite that suppose to be 58% faster than M3 but if that is ARM and same thing with SQL server issues then makes no sense for me to change from Intel processor
@@grupomexcomer you can only do that on UTM running on M chips but the perfomance is a bit compromised
Thanks Doug for the Not in explanation, I don’t know how only your video made me grasp the reason why we don’t get result set. Again Thank you!
Do you have any other Chanel or platform where you post more videos?
@@agermoune Hi, and thanks for asking! I'm going to start working on this channel again. Stay tuned, and let me know if you have any good video ideas that would help you!😀
@@DatabasebyDoug@DatabasebyDoug I'm looking forward to your upcoming content (already subscribed!). I'm especially interested in videos covering: Inner Join vs. Left Join: when filtering should occur (ON vs. WHERE clause). Best practices for SQL syntax and formatting: any additional tips beyond what you've already shared would be great. Advanced SQL case scenarios I'm happy to pay for your content and would love to know if you offer any Udemy or LinkedIn courses. Thanks for your excellent teaching style!
Thanks so much, helped a lot!!
GOOD THINK
Brilliant. Thank you Doug!
Great video Doug, very clear easy to follow guide with a step-by-step simple approach to solve a complex problem
Glad you liked it
Great work!
is 'NOT CategoryId IN' the same as 'CategoryId NOT IN' ? I've never seen the first option...
Yes, they are the same. I had to try some examples to make sure that NULL handling was the same. But you might *need* to move the NOT away from the IN to do something like WHERE NOT (CategoryID IN (1,2,3) OR another_condition)
This breakdown really helped me understand how to go about an exercise im currently working on. Thank you
amazing explanation , thank you!
Hello, Great video like your approach. Can you do more like this? I am learning SQL but having trouble applying the language...
Thanks for the positive comments. I'm starting back to working on the channel, after life got in the way for a few years :-) Stay tuned, and let me know if you have any questions I can answer with a video.
well done, great job!
I was missing out on this. Thank you so much for this explanation
why bro is not my clg dbms teacher
hi the order by clause sometimes goes a total running count instead of just ordering it like rank in your case why is that?
I'm not sure I understand your question, but... The ORDER BY in the OVER clause has a different purpose than the ORDER BY for the whole SELECT query. The ORDER BY in the OVER is describing how to calculate RANK/ROW_NUMBER/DENSE_RANK. The ORDER BY at the end of the SELECT statement describes how to order the *results*.
@@DatabasebyDoug when you use sum it does a running count instead of ordering it
Very well explained. Thank you
Short and simple.Thanks for saving my time. I have my interview tomorrow.
Man, I can't thank you enough for this simple-no-bs explanation. I initially used BigQuery so i needed this to get to know SSMS
Glad it helped!
Finallyy!! someone explains this so clearly! <3
If partioned by some column say like dept row number Nd rank would give same result right
in the first example (select 17) the exists is acting like a Boolean since the subquery is true so it brings everything in the outer query but in the 2nd example (the correlated query) exists is acting like "in" . how is that?
Sorry for the delayed response. You are right EXISTS is an operator that returns a boolean value. In the first "trivial" example, SELECT 17 always returns exactly one record, so EXISTS (SELECT 17) is always True. In the second example (correlated subquery), the subquery's results change based on a record in the outer query. So EXISTS() returns true or false, based on a record in the outer query, i.e., it is *correlated* with the outer query. You can phrase the same intended result using IN. In English, you could say "Categories where a Product exists in that category" or "Categories that are in a Category list drawn from the Products table". Both end up with the same result. I hope that helps!
Easy to understand, with examples and comparisons, agree that this is how every video should be made. Thanks Doug.
Thanks a lot, i've been struggling to graps the logic behind using one or another, especially in my class where there is that querry as example that i struggled to understand until i watched the video, it really helped me "visualize" how it works. Thanks again !
on point!
Great video, thank you for producing and sharing!
Now I get it! Thank you so much!
Thank you, this is amazing! Great quality content! Now i finnally understand!!! Thank you !!!
Thanks for easy to understand and helpful video.
That’s what I’m talking about Doug
Thank you, Doug.