0% found this document useful (0 votes)
62 views

Querying Using SELECT - Installation Instructions

This document provides instructions on installing Microsoft SQL Server 2019 Express Edition and SQL Server Management Studio (SSMS) on a system. It also describes how to attach the AdventureWorksLT2019 sample database to a SQL Server instance using SSMS. The instructions are presented in 8 steps for installing SQL Server, 2 steps for installing SSMS, and 5 steps for attaching the sample database.

Uploaded by

riteshjain12345
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
62 views

Querying Using SELECT - Installation Instructions

This document provides instructions on installing Microsoft SQL Server 2019 Express Edition and SQL Server Management Studio (SSMS) on a system. It also describes how to attach the AdventureWorksLT2019 sample database to a SQL Server instance using SSMS. The instructions are presented in 8 steps for installing SQL Server, 2 steps for installing SSMS, and 5 steps for attaching the sample database.

Uploaded by

riteshjain12345
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

ABSTRACT

This handout describes the steps of installing a MS


SQL Server and SQL Server Management Studio, as
also instructions to attach AdventureWorks sample
database to Server.
Konstantinos (Kostas) Tsitoumis
Introduction to Querying relational databases using
the SELECT statement.

INSTALLATION
INSTRUCTIONS
Microsoft DBMS to use with queries
How to install SQL Server 2019 Express
Edition

1. Double click on SQL2019-SSEI-Expr.exe.


SQL Server 2019 Express is a free edition of SQL Server, ideal for development and
production for desktop, web, and small server applications.
Navigate here https://www.microsoft.com/en-us/sql-server/sql-server-downloads and
select the express edition: https://go.microsoft.com/fwlink/?linkid=866658

2. Select Basic installation type and accept the license terms:


3. Specify an installation location, or leave it to default:
4. Click on “Next”. Packages would start downloading and the installation will begin:
5. When done, you will see a window like this one:

You have several options as described in the buttons at the bottom of this window.

Connect Now: Opens a console to query the server. You haven’t any database
attached to it yet, but feel free to try it.
Customize: Sets up the features of the SQL Server. This is where we continue next.
Install SSMS: Opens your default browser to https://docs.microsoft.com/en-
us/sql/ssms/download-sql-server-management-studio-
ssms?redirectedfrom=MSDN&view=sql-server-ver15 in order to download and install
SQL Server Management Studio. Think of it as a graphical interface for managing SQL
Servers.
6. Click on “Customize” button. This window pops up:

7. Click “Next” until completion, unless you want to setup some specific functionality
– and you do.

For example, you would need to select “Default instance” in “Instance configuration”
screen and also, in “Server Configuration” screen, in “Collation” tab, pick:
“SQL_Latin1_General_CP1_CI_AS”.

In “Database Engine Configuration” screen, you’d need to enter a password for the SA
(system administrator of SQL server) in order to log in both ways as a SA and with
Windows authentication. So pick “Mixed Mode”.
Your setup should look like that:
8. If all goes well, you will see something like this:

If not, then check the installation log files for any errors and google them.

Your MS SQL Server is up and running:

You are now good to close the setup window. Next step would be to install SSMS.
How to install SQL Server Management
Studio (SSMS)
1. Double click on SSMS-Setup-ENU.exe.
SQL Server Management Studio (SSMS) is an integrated environment for managing any
SQL infrastructure, from SQL Server to Azure SQL Database. SSMS provides tools to
configure, monitor, and administer instances of SQL Server and databases.
Navigate here https://docs.microsoft.com/en-us/sql/ssms/download-sql-server-
management-studio-ssms?view=sql-server-ver15 and select the latest general
availability (GA) version: https://aka.ms/ssmsfullsetup

2. Feel free to change the installation location. Click “Install”:


3. As with SQL Server, packages are downloaded and installation runs:

A restart might be needed after the end of the installation.

You may find SSMS by clicking on the windows icon (start menu). It is the program
Ssms.exe under <Drive/Path where it was installed>\Microsoft SQL Server
Management Studio 18\Common7\IDE.

Open it.
Depending on how you installed the SQL Server, you will be asked for credentials:

If you picked “Mixed Mode” in “Database Engine Configuration” screen during the Server
installation, you will be able to log in either as a System Administrator or using Windows
Authentication. Pick the latter and click on “Connect” button.

You may notice on the “Object Explorer” pane that there are no databases in our Server
apart from the default/system ones. It’s time to attach a demo database to SQL Server.
How to attach AdventureWorks sample
database to SQL Server
1. Navigate to “AdventureWorks sample databases” https://docs.microsoft.com/en-
us/sql/samples/adventureworks-install-configure?view=sql-server-
ver15&tabs=ssms Then, download the Lightweight back up file
AdventureWorksLT2019.bak : https://github.com/Microsoft/sql-server-
samples/releases/download/adventureworks/AdventureWorksLT2019.bak

2. Open SSMS in case it is not opened. Follow the steps as described in the section
“Restore to SQL Server” of “AdventureWorks sample databases” page.

3. If all goes well, you will see something like this:


4. Now we are ready to use it.
Click Connect → Database Engine on the “Object Explorer” left pane:
5. Click on “New Query” button in the top toolbar.
SQL Server connects automatically to the “master” database, which is a system one.
You may either type the command “use AdventureWorksLT2019” and click “Execute”
button, or pick the database we attached through the interface:

At this point, we are ready to do queries.


If you expand the “Tables” section on the left pane you will be able to see the tables of
the database:
To query the Product table for example, you may

- Either type the Select command as such:

- Or right click on the table in the left pane and select Script Table as > SELECT
To > New Query Editor Window.

A new editor window will automatically open and then you will have the same results by
clicking on the “Execute” button.

Have fun with your queries!


Annex; AdventureWorks db schema

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy