From the course: Querying Microsoft SQL Server 2019

Download the sample database - SQL Server Tutorial

From the course: Querying Microsoft SQL Server 2019

Start my 1-month free trial

Download the sample database

- [Instructor] In order to learn about queries in SQL Server, we need to have a database with some interesting information that we can review. For this course, I'm going to use a sample database for a fictional company called AdventureWorks. You can find the download link to the database from the Microsoft GitHub page at this URL. On this page I'll scroll down until I find the section for the AdventureWorks full database backups and the file that I want is this one here, called AdventureWorks2017.bak. Let's go ahead and click on that and it'll download to my computer. Once the download's complete, we can go ahead and install it on our computer. There is the file there in my Downloads folder and I'm going to right click on it and choose Cut and then I need to move it into the SQL Server Backup folder and I can find that on my C drive inside of Program Files, Microsoft SQL Server, then a folder that represents the server instance that you're working with. I'm working with SQL Server version 15 and my server instance is called MSSQL Server. Yours might be a different folder here. Then I'll go inside of that folder and find MSSQL and then finally the Backup folder. The first time you try and go in here you might get this message that says you don't have permissions to go into the folder. Just press the Continue button and that'll let you in. Then I can right click and paste in the database backup file. Now I need to install it on my SQL Server instance and for that we'll go into Management Studio. First, I'll log into my server here. Then I'll right click on the Databases folder and choose Restore Database. I'll choose to pull the source from a device. I'll use that button there and press the ellipses button over here on the right. My backup media type is a file. I'll press the Add button here. And then I'll select the AdventureWorks2017.bak file and press Okay. I'll press Okay on this window and press Okay one more time to restore the database. Once the restoration process completes successfully, you can press Okay and dismiss that window. Finally, we can open up the Databases folder and we should see the database right here. This'll give us all the information that we can use when we're working with queries in SQL Server.

Contents