Database by Doug
Database by Doug
  • Видео 53
  • Просмотров 1 219 062
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
Просмотров: 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
String Expressions in SQL
Просмотров 1,7 тыс.5 лет назад
String Expressions in SQL
Numeric Expressions in SQL
Просмотров 1,3 тыс.5 лет назад
Numeric Expressions in SQL
The SQL FROM Clause
Просмотров 2,3 тыс.6 лет назад
The SQL FROM Clause
Structuring Data
Просмотров 1,1 тыс.6 лет назад
Structuring Data
Tables and their parts
Просмотров 1,3 тыс.6 лет назад
Tables and their parts
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?
Clustered Indexes and DB Caching
Просмотров 2,9 тыс.8 лет назад
Clustered Indexes and DB Caching
SQL Server Caching
Просмотров 10 тыс.8 лет назад
SQL Server Caching
Simple Indexing Intro
Просмотров 5878 лет назад
Simple Indexing Intro
The bit data type in SQL Server
Просмотров 14 тыс.8 лет назад
The bit data type in SQL Server
Simple Recursion in SQL
Просмотров 95 тыс.8 лет назад
Simple Recursion in SQL

Комментарии

  • @iulianciobanu6824
    @iulianciobanu6824 6 дней назад

    great video :)

  • @kilic652
    @kilic652 20 дней назад

    Thanks man thanks. Good. Thank you. Good luck

  • @NforNatalie
    @NforNatalie Месяц назад

    I’m subscribing. This video taught better than Dataquest 😂

  • @jaskiratrattu9060
    @jaskiratrattu9060 Месяц назад

    Where we get tables ??

  • @poonamvarkhedi1016
    @poonamvarkhedi1016 Месяц назад

    Come back to this video every time I need a recap. Quick and with easy to follow examples. Thank you!

  • @vishnupriyaarora
    @vishnupriyaarora Месяц назад

    Hi Doug, what's the best way to reach you?

    • @DatabasebyDoug
      @DatabasebyDoug Месяц назад

      How about LinkedIn? www.linkedin.com/in/douglaskline/ send me a connection request, then we can message directly.

  • @FailMachineInc
    @FailMachineInc 2 месяца назад

    ty

  • @danielomondionyango7163
    @danielomondionyango7163 2 месяца назад

    great demo Thanks a lot

  • @sandeepkotha413
    @sandeepkotha413 2 месяца назад

    simple and straight to the point. Thank you!

  • @lamarmohsen9582
    @lamarmohsen9582 2 месяца назад

    Thanks man!

  • @jerichaux9219
    @jerichaux9219 2 месяца назад

    The return of The King with the SQL Schwing!

  • @jerichaux9219
    @jerichaux9219 2 месяца назад

    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!

    • @DatabasebyDoug
      @DatabasebyDoug 2 месяца назад

      Wow, thanks for the positive feedback! Any topic I could cover that would help you out?

  • @rajatgupta8736
    @rajatgupta8736 2 месяца назад

    Amazing... good to see you back

  • @ahmadluthfi4111
    @ahmadluthfi4111 2 месяца назад

    Thank you so much, I like your approach, Im new to complex SQL Queries and having problems to read complex query

    • @ahmadluthfi4111
      @ahmadluthfi4111 2 месяца назад

      And this video so helpfull, Maybe do you also have approach to read and understand complex Query?

    • @DatabasebyDoug
      @DatabasebyDoug 2 месяца назад

      My first step in understanding code is to format it clearly.

  • @VISHNUKUMAR-bh8uj
    @VISHNUKUMAR-bh8uj 2 месяца назад

    Thank you very much sir

  • @codeforbreakfast
    @codeforbreakfast 3 месяца назад

    Great explantations, Hands down

  • @strzaskanyalf2928
    @strzaskanyalf2928 3 месяца назад

    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.

  • @rajatgupta8736
    @rajatgupta8736 3 месяца назад

    Great explanation. You are the master of sql

  • @rajatgupta8736
    @rajatgupta8736 3 месяца назад

    Great explanation

  • @rajatgupta8736
    @rajatgupta8736 3 месяца назад

    Amazing explanation of the concepts. Thanks lot.

  • @grupomexcomer
    @grupomexcomer 3 месяца назад

    Hi, do you know if its possbiel to install SQL server on M1,M2 or M3 inside Windows ARM running on Parallels?

    • @DatabasebyDoug
      @DatabasebyDoug 3 месяца назад

      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.

    • @grupomexcomer
      @grupomexcomer 3 месяца назад

      @@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

    • @blessingmukabeta3019
      @blessingmukabeta3019 2 месяца назад

      @@grupomexcomer you can only do that on UTM running on M chips but the perfomance is a bit compromised

  • @agermoune
    @agermoune 3 месяца назад

    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!

    • @agermoune
      @agermoune 3 месяца назад

      Do you have any other Chanel or platform where you post more videos?

    • @DatabasebyDoug
      @DatabasebyDoug 3 месяца назад

      @@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!😀

    • @agermoune
      @agermoune 3 месяца назад

      ​@@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!

  • @JoosephLr
    @JoosephLr 3 месяца назад

    Thanks so much, helped a lot!!

  • @gamesplay74
    @gamesplay74 3 месяца назад

    GOOD THINK

  • @mattjb9983
    @mattjb9983 3 месяца назад

    Brilliant. Thank you Doug!

  • @faaizhaque8415
    @faaizhaque8415 3 месяца назад

    Great video Doug, very clear easy to follow guide with a step-by-step simple approach to solve a complex problem

  • @mohammedawwalmensah5531
    @mohammedawwalmensah5531 3 месяца назад

    Great work!

  • @user-xf4ht5uc1p
    @user-xf4ht5uc1p 3 месяца назад

    is 'NOT CategoryId IN' the same as 'CategoryId NOT IN' ? I've never seen the first option...

    • @DatabasebyDoug
      @DatabasebyDoug 3 месяца назад

      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)

  • @daimzumara8115
    @daimzumara8115 4 месяца назад

    This breakdown really helped me understand how to go about an exercise im currently working on. Thank you

  • @supermnabil
    @supermnabil 4 месяца назад

    amazing explanation , thank you!

  • @ExpatGypsie
    @ExpatGypsie 4 месяца назад

    Hello, Great video like your approach. Can you do more like this? I am learning SQL but having trouble applying the language...

    • @DatabasebyDoug
      @DatabasebyDoug 3 месяца назад

      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.

  • @mohamedely3987
    @mohamedely3987 4 месяца назад

    well done, great job!

  • @sonalishinde5030
    @sonalishinde5030 4 месяца назад

    I was missing out on this. Thank you so much for this explanation

  • @mihirpandya6835
    @mihirpandya6835 4 месяца назад

    why bro is not my clg dbms teacher

  • @yeoshuabenzaken7736
    @yeoshuabenzaken7736 4 месяца назад

    hi the order by clause sometimes goes a total running count instead of just ordering it like rank in your case why is that?

    • @DatabasebyDoug
      @DatabasebyDoug 3 месяца назад

      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*.

    • @yeoshuabenzaken7736
      @yeoshuabenzaken7736 3 месяца назад

      @@DatabasebyDoug when you use sum it does a running count instead of ordering it

  • @abhishekloni7863
    @abhishekloni7863 4 месяца назад

    Very well explained. Thank you

  • @prajwaltawade528
    @prajwaltawade528 4 месяца назад

    Short and simple.Thanks for saving my time. I have my interview tomorrow.

  • @akashsarkar781
    @akashsarkar781 5 месяцев назад

    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

  • @TheBaBaLand
    @TheBaBaLand 5 месяцев назад

    Finallyy!! someone explains this so clearly! <3

  • @jpsama7817
    @jpsama7817 5 месяцев назад

    If partioned by some column say like dept row number Nd rank would give same result right

  • @yeoshuabenzaken7736
    @yeoshuabenzaken7736 6 месяцев назад

    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?

    • @DatabasebyDoug
      @DatabasebyDoug 3 месяца назад

      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!

  • @mukeshpatil1159
    @mukeshpatil1159 6 месяцев назад

    Easy to understand, with examples and comparisons, agree that this is how every video should be made. Thanks Doug.

  • @osmane888
    @osmane888 6 месяцев назад

    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 !

  • @ggggggg0000
    @ggggggg0000 7 месяцев назад

    on point!

  • @mannymorales7913
    @mannymorales7913 7 месяцев назад

    Great video, thank you for producing and sharing!

  • @supa.scoopa
    @supa.scoopa 7 месяцев назад

    Now I get it! Thank you so much!

  • @adrianb8832
    @adrianb8832 7 месяцев назад

    Thank you, this is amazing! Great quality content! Now i finnally understand!!! Thank you !!!

  • @hadiyousefpour8768
    @hadiyousefpour8768 7 месяцев назад

    Thanks for easy to understand and helpful video.

  • @williamnguyen5771
    @williamnguyen5771 8 месяцев назад

    That’s what I’m talking about Doug

  • @rohampourmehr2275
    @rohampourmehr2275 8 месяцев назад

    Thank you, Doug.