From the course: Program Databases with Transact-SQL

Using the exercise files - SQL Server Tutorial

From the course: Program Databases with Transact-SQL

Start my 1-month free trial

Using the exercise files

- [Instructor] All of the scripts that I'll be executing throughout this course can be downloaded from the course's overview page, so that you can follow along. Just look for the link for the exercise files. I've gone ahead and downloaded them and placed them here on my desktop, and inside of that folder is a folder for each chapter of the course, and inside of there are the individual scripts that we'll execute throughout each movie. Now these are SQL files. You can open them up in any sort of text editor, such as Notepad or you can open up directly inside of Management Studio. This will allow us to execute the scripts against our databases. Now the one thing you notice here on the screen is that I have line numbers turned on on my system, and that'll help you follow along. If you want to turn on line numbers on your system, just go up to the tools menu, come down to options, then we'll go into the text editor settings. Then transact SQL, general, and you'll find a checkbox here to turn on line numbers. The other thing that we need is a database to execute our scripts against. And we're going to be using a sample database from Microsoft called Wide World Importers. Now I've already got it installed on my system, but I'll show you how to get it. First, we need to go out to Microsoft's GitHub page at this URL. Here, you'll find a link for the WideWorldImporters-Full.bak file. Go ahead and download that, that's a database backup file, and we'll install it on our SQL server instance. Once it's done downloading we can go ahead and find it inside of our downloads folder on our computer. It's right here, I'll go ahead and right click on it and choose Cut. Then we'll go into the SQL server backup folder, which you can find on your C Drive typically. Inside of program files, Microsoft SQL server, the folder that corresponds to your server name and version number, and mine is MSSQL15.MSSQL SERVER. We'll go inside of there, then inside of the MSSQL folder, and finally backup. Now at this point you might get a message saying that you don't have permission to enter this folder. And you can just press the continue button, and you should be let in. Then, just right click and paste a copy of that backup file there. Next, we'll go back inside of Management Studio. From here, we'll right click on the databases folder in the Object Explorer window and choose restore database. Then, we're going to pull our restore from a device. We'll turn on this button here, and press the ellipses button over on the far right. We'll press the add button on this window and that should bring us into that backup folder where we can choose our backup file that we just downloaded. Go ahead and select it, press okay, okay again, and okay one more time to restore that backup onto your system. Once you're done, you should have the Wide World Importers database here inside of your Object Explorer window. You might need to right click databases and choose refresh if you don't see it automatically. And this will give us all the data that we need to explore programmability features inside a SQL server.

Contents