SQL Basics - Querying (learn how to write queries in 30 minutes)

preview_player
Показать описание
Another video brought to you by BeardedDev, bringing you tutorials on Data Engineering, Business Intelligence, T-SQL Programming and Data Analysis.

Prerequisites

Have you ever thought "how do I get started with SQL?", "how do I find out if SQL is for me?" then this video aims to answer those questions, it will allow you to start writing SQL queries straight away.

In this video we cover how to write SELECT statements, how to filter data using a WHERE clause, how to return only unique values and how different data types work in SQL Server.
After just 30 minutes you will become competent in writing SQL queries and I encourage you to try out other queries on your own.

This tutorial is going to be part of a short series that aims to get you up and running straight away, writing queries and potentially hungry to learn more.

Whether you are a data analyst look to develop your skillset or a front end developer curious about how databases work or a recent graduate then I'm sure you will find something here that will help.

If you have any difficulties setting up the environment of would like me to produce a tutorial then please let me know in the comments below.

Code Samples - this is not complete but you can copy and paste and change as necessary
Replace any words with [] with symbols, cannot add angle brackets in description

-- return all columns
SELECT
*
FROM Sales.SalesOrderHeader;

-- return specific columns
SELECT
SalesOrderID,
OrderDate,
SalesOrderNumber,
CustomerID,
TotalDue
FROM Sales.SalesOrderHeader;

-- filter by customerid
SELECT
SalesOrderID,
OrderDate,
SalesOrderNumber,
CustomerID,
TotalDue
FROM Sales.SalesOrderHeader
WHERE CustomerID = 11091;

-- filter by totaldue greater than equal to
SELECT
SalesOrderID,
OrderDate,
SalesOrderNumber,
CustomerID,
TotalDue
FROM Sales.SalesOrderHeader
WHERE TotalDue [greater than]= 1000;

-- filter by orderdate less than
SELECT
SalesOrderID,
OrderDate,
SalesOrderNumber,
CustomerID,
TotalDue
FROM Sales.SalesOrderHeader
WHERE OrderDate [less than] '20140101';

-- multiple filters
SELECT
SalesOrderID,
OrderDate,
SalesOrderNumber,
CustomerID,
TotalDue
FROM Sales.SalesOrderHeader
WHERE CustomerID = 11091
AND TotalDue [greater than]= 1000;

-- return unique customerid
SELECT DISTINCT
CustomerID
FROM Sales.SalesOrderHeader;
Рекомендации по теме
Комментарии
Автор

Been binging on all your videos today, gotta say they are by far the best SQL tutorials I've seen on YouTube . Thanks man keep up the great work 👍

briandennehy
Автор

Great Video!!! I would definitely enjoy a video how to update the version of adventure works 2019👍🏾.

terrences
Автор

You generate awesome videos, but the real value added will come when you post a link with downloadable databases, so that we can access them and work with your pace simultaneously.

humblenessnpowah
visit shbcf.ru