SQL Tutorial - Creating a sample of data

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

In this video I talk about how to create a sample set of data to work in Microsoft SQL Server. Creating a sample set of data can be extremely beneficial for development or testing, there is no need to wait minutes or hours for queries to run.

The techniques explored in this SQL Server Tutorial are:
Or for a full tutorial on CTEs check out this playlist:
SELECT * INTO

SQL Queries in the video:
WITH Number
AS
(
SELECT
CustomerId
, NTILE(1000) OVER(ORDER BY CustomerId) AS N
FROM dbo.Customers
)
,
TopCustomer
AS
(
SELECT
MAX(CustomerId) AS CustId
FROM Number
GROUP BY N
)

SELECT
C2.*
INTO dbo.CustomersSample
FROM TopCustomer AS C1
INNER JOIN dbo.Customers AS C2
ON C1.CustId = C2.CustomerId

SELECT * FROM dbo.CustomersSample

Please feel free to post comments.
Рекомендации по теме
Комментарии
Автор

Another great video, you make everything look easy to learn, Tks!

fernandocamargo
Автор

Your explanation racks dude.. In every video.
Can you do a video on the topics to learn in SQL, in order, for a beginner, a good learning journey to follow for sql kindof thing....

sk____
Автор

you are doing a great job.Please consider doing some videos on the analysis you do as part of your daily BI job...What are the tips and tricks to become a descent BI developer

anirvancool
Автор

great video. Thanks. Can you please paste the query in comments if you can for reference

deepakmodu
Автор

It would be great to have a tutorial on SSAS using your teaching skills, not many tutorials on youtube, and usually they are too complicated, I believe it is because of the methodology used by the others ones.

fernandocamargo
Автор

is torder by required in the over clause?

erinbai
Автор

Same as SELECT TOP(x) * FROM MyFile ORDER BY NEWID() ??? Not sure, just asking

iandavies
join shbcf.ru