Microsoft produces sample databases for SQL Server that are commonly used in training courses and tutorials. In this video, database expert Adam Wilbert shows how to obtain the newest sample database, Wide World Importers. After downloading the required file, installation of the database is handled through the backup mechanism in SQL Server Management Studio.
- View Offline
- [Voiceover] Microsoft produce sample databases for SQL Server, that are commonly used in training courses and tutorials that you're sure to come across in your journey towards becoming a database administrator. One of the most popular is a database called AdventureWorks which follows a fictitious bicycle manufacturer. You can download and explore the AdventureWorks database by visiting its website at this URL. On the middle of the page, you'll see download link and if I click on this, it'll take me to a page where I can download the full database backup for AdventureWorks. This database can be useful, since a large number of people have access to it and regularly refer to it in order to explain concepts or illustrate techniques.
Now, unfortunately, for the fictional employees in AdventureWorks though, it seems like their time is coming to an end. The AdventureWorks example database is being replaced by a new example database, called WideWorldImporters. WideWorldImporters is a new fictitious company that imports and distributes novelty gifts. If I go back to the main AdventureWorks web page, we'll see a link here at the top, that says, WideWorldImporters sample databases for SQL Server 2016. When I click on that, that'll take me to the new page for the new example database. We can click on this link in order to get to get to the documentation for the database, or find the actual database which is currently stored in a GitHub repository.
On the GitHub page, for the WideWorldImporters database, if we were to click on this button, that says Clone or Download, and then download a zip, it's going to download all of the example files, including any scripts and additional files for this repository. Instead, what I want to do is just download the database. In order to do that, I'll press this button that says Releases. Then, I'll scroll down on the page, until I find the release for the WideWorldImporters sample database, Version 1.0. If you see a newer version number, feel free to use that one instead. A little further down the page, I'll see the link to the SQL Server Standard Edition, which is going to be the database that'll work with our version of SQL Server, and I'll just click on this file to download the backup of the database.
That'll place a copy of this backup file into our default downloads folder. While it's downloading, you might also review the documentation for this database. When the download completes, it's time to import that database into our SQL Server instance and we can do that back in Management Studio. In Management Studio I'll right-click on the database's folder and choose restore database, since we're restoring the database from our backup. I'll choose the source of the database. It's coming from a device, which is a location on my computer, then I'll press this button with the three dots, or the ellipsis mark. We could choose where our file is gonna come from.
In this case it's coming from a file, not a URL. I'll press the add button, in order to choose my backup media. Note that SQL Server, only has access to very specific folders inside of our computer. Right now, it's expecting to find the backups inside of our program files folder, Microsoft SQL Server and if we scroll across we can see the name or version number of SQL Server that we're using, followed by the name of the server instance, the MSSQL folder, and then a folder called Backup, only to make sure that our backup file gets placed into this particular location. I'm going to go ahead and press cancel here, and cancel, and then cancel one more time.
Then, we'll go onto Windows Explorer and move that backup file, into the proper location. Inside of my download folder, I'll find the WideWorldImporters standard backup database file, and right-click on it and cut it to my clipboard. Then we'll browse into our computer. On the C-drive, I'll find the folder for Program files, then we'll go into the SQL Server folder, the name of our SQL Server instance, the MSSQL folder, and finally the backup folder. When I go into the backup folder, I'll get a message saying that I don't currently have permission to access this folder, but I can click on continue in order to permanently get access to this folder.
I'll press the continue button, and that'll let me in, then I'll simply right-click and choose paste to paste in a copy of that backup database. Now that this is in position, we can go back into Management Studio, and finish the installation process. Once again, I'll right-click on databases, choose restore database. We'll choose our source as a device, and we'll click on the ellipsis button. We're going to choose a backup media type of a file, not a URL, and we'll add in a new backup location. I'll go into the backup folder and here is the backup file that we just downloaded.
I'll press okay, and then press okay again, to add that in here to the backup sets to restore section. Finally, I'll press the okay button and SQL Server Management Studio will restore the database backup file. After it completes, we'll get this message that it was restored successfully, and I can press okay, and that dismisses the installation window. Now, I can expand my databases folder to see the WideWorldImporters database that we just imported. If I expand that, I can see all the different components of this database, including the tables. I'll expand the tables folder to see all the different tables within the database and I wanna take a look at this one here, called Purchasing.PurchaseOrderLines.
I'll right-click on it, and choose select top 1000 rows, to see the data within. In this data table we can see that Purchase Order Number One, included three line items for a variety of action figures. So feel free to dig in to some of the other data tables to see the kinds of information that they store. I'd also recommend downloading and installing the AdventureWorks 2014 sample database. Even though it's older, and in the process of being depreciated. The installation process will be identical to the WideWorldImporters database, but because these are the official example databases from Microsoft, you'll be all set to use them when tackling some of the tutorials found in the technical documentation.
This course introduces the most important features of SQL Server 2016, and is designed to act as the student's very first look at how the server operates. Adam Wilbert shows how to install a local copy of SQL Server; demonstrates the working environment, SQL Server Management Studio; and walks students through their first hour creating tables, defining relationships, and writing and running queries with Transact-SQL commands. Everything you need to accomplish to create your first database is covered in just 80 minutes. Start watching to get up and running with this professional-grade database management system.
- What is SQL Server?
- Configuring the server
- Creating a new database and data tables
- Joining tables with keys
- Creating a SELECT statement
- Writing an UPDATE statement
- Adding data with the INSERT statement