Download presentation
Presentation is loading. Please wait.
1
Introduction to Microsoft SQL Server 2016
20761A 1: Introduction to Microsoft SQL Server 2016 Module 1 Introduction to Microsoft SQL Server 2016
2
Getting Started with SQL Server Management Studio
Module Overview 1: Introduction to Microsoft SQL Server 2016 Getting Started with SQL Server Management Studio This module introduces students to SQL Server 2016, giving them a broad understanding of SQL Server without going into too much detail. We have designed this module to introduce students to information they might not otherwise encounter. For example, understanding the differences between SQL Server editions might help them to plan a new deployment.
3
Lesson 1: The Basic Architecture of SQL Server
1: Introduction to Microsoft SQL Server 2016 Queries
4
SQL Server is a relational database management system
Relational Databases 1: Introduction to Microsoft SQL Server 2016 SQL Server is a relational database management system Databases contain objects and data Each database has multiple tables Tables are joined together to extract meaningful information Many people think that a relational database refers to the fact that tables are related to one another. This is not true—a relational database is based on mathematical relational theory, which itself is based on two mathematical concepts called set theory and predicate logic. Although you do not need to know too much about set theory or predicate logic, having some understanding can be helpful when learning SQL Server. Microsoft SQL Server 2012 T-SQL Fundamentals by Itzik Ben-Gan has an introductory chapter, which gives a good explanation of these two areas and how they relate to working with SQL Server. If you are interested in learning more, it is worth a read.
5
About the Course Sample Database
1: Introduction to Microsoft SQL Server 2016 TSQL Database
6
Client Server Databases
1: Introduction to Microsoft SQL Server 2016 The client software is separate from the server database engine Client/Server refers to the separation of functionality—not where the software is actually located Client software and server database engine can be on the same machine Databases can access data in other databases over a network
7
T-SQL is a set-based language
Queries 1: Introduction to Microsoft SQL Server 2016 T-SQL is a set-based language T-SQL is written in scripts with .sql extension GO keyword separates batches Use the example on the slide to illustrate the GO statement that separates a script into batches. Do not go into the details of the CREATE or INSERT commands, which will be described later in the course. Sharp-eyed students may notice the additional apostrophe needed to insert O’Neil and the N to denote Unicode characters. CREATE TABLE dbo.Employees ( EmployeeID int PRIMARY KEY, LastName nvarchar(25), FirstName nvarchar(25) ); GO INSERT INTO dbo.Employees (EmployeeID, LastName, FirstName) VALUES (121, N'O''Neil', N'Carlene');
8
Lesson 2: SQL Server Editions and Versions
1: Introduction to Microsoft SQL Server 2016 SQL Server Editions
9
SQL Server Versions SQL Server Versions Version Release Year 2016 2014
1: Introduction to Microsoft SQL Server 2016 SQL Server Versions Version Release Year 2016 2014 2008 R2 2010 2008 2005 2000 7.0 1998 6.5 1996 6.0 1995 4.2.1 1994 4.2 1992 1.1 1991 1.0 1989 Question Which version of SQL Server are you currently working with? Have you worked with any earlier versions? Answer Answers will vary.
10
SQL Server Editions SQL Server Editions Main Editions Other Editions
1: Introduction to Microsoft SQL Server 2016 SQL Server Editions Main Editions Other Editions Enterprise Developer Standard Express Business Intelligence Compact Azure SQL Database Question You have founded a new company with two friends. Your new application (app) uses a SQL Server database to store information. You are unsure whether your app will be successful but if it is, you will need both high performance and space for large volumes of data. However, you have not yet launched, so are unsure how many people will use your app. Which edition of SQL Server 2016 should you use for this system? ( )Option 1: Azure SQL Database ( )Option 2: Enterprise Edition ( )Option 3: Express Edition ( )Option 4: Business Intelligence Edition ( )Option 5: Any edition is appropriate for these requirements Answer Azure SQL Database allows you to start small, and scale up as required. As a startup, using Azure SQL Database also means you do not need to buy server hardware to run SQL Server. Because Azure SQL Database is Software as a Service (SaaS), you pay for what you use, without high upfront costs.
11
Lesson 3: Getting Started with SQL Server Management Studio
1: Introduction to Microsoft SQL Server 2016 Demonstration: Introducing Microsoft SQL Server 2016
12
Launch SSMS from the Windows Start screen
Starting SSMS 1: Introduction to Microsoft SQL Server 2016 Launch SSMS from the Windows Start screen Or type SSMS into the Search Programs and Files box Connect to an SQL Server instance Or work disconnected Settings available in Tools, Options include: Fonts and colors, line numbering, and word wrap Which windows open when SSMS is launched Useful windows include: Query Editor Object Explorer Solution Explorer Point out that SSMS is the client tool for SQL Server; it is not SQL Server itself. SSMS sends commands to the SQL Server database engine. Organizations normally install SSMS on a different machine to the one where SQL Server is installed. The classroom virtual machine may obscure that distinction.
13
Connecting to SQL Server
20761A Connecting to SQL Server 1: Introduction to Microsoft SQL Server 2016 Connecting to SQL Server requires three items: Instance name Use the form host/instance, except for the default instance Database name A default database can be assigned to a logon Authentication Windows Authentication or SQL Server Authentication Account must be provisioned by a database administrator Question In your organization, which authentication method do you use to log on to SQL Server? Answer Either Windows Authentication or SQL Server Authentication.
14
Working with Object Explorer
20761A Working with Object Explorer 1: Introduction to Microsoft SQL Server 2016 Object Explorer is a hierarchical, graphical view of SQL Server objects Explore objects in the default instance, and additional named instances Right-click for context-sensitive menu with frequently used commands Create T-SQL scripts of object definitions, and send to the query window, clipboard or a file Start a new query window by right-clicking a database Changing the selected object does not change the existing connection If Object Explorer is not visible, click the F8 keyboard shortcut to display it.
15
Script Files and Projects
1: Introduction to Microsoft SQL Server 2016 T-SQL scripts are text files with a .sql extension SSMS can open, edit, and execute code in script files SSMS allows you to organize script files into: Solutions (*.ssmssln) Projects (*.ssmssqlproj) Opening a solution is a convenient way to open all relevant files You will use projects on this course
16
To execute queries in SSMS:
20761A Executing Queries 1: Introduction to Microsoft SQL Server 2016 To execute queries in SSMS: Open a saved script, or write a new query Three ways to execute the query: From the Query menu, select Execute Press F5 Click the Execute toolbar button Point out to students that the green triangle starts the T-SQL Debugger and is not the button for executing a query. Students who have worked with other query tools might think the green triangle executes queries. The workbook also refers to the use of Alt-X and Ctrl-E shortcuts to execute a query, in addition to F5. Note that Ctrl-Shift-T has changed in SQL Server It used to be Ctrl-Shift-F.
17
Using SQL Server 2016 Technical Documentation
1: Introduction to Microsoft SQL Server 2016 Books Online (BOL) is the product documentation for SQL Server In SQL Server 2016, Books Online does not ship with the SQL Server installation media Configure Help to display content from MSDN or download Help Collections to a local computer Once configured, Help is available from: SSMS query window (context-sensitive when you highlight a keyword) SSMS Help menu Windows Start menu
18
Demonstration: Introducing Microsoft SQL Server 2016
1: Introduction to Microsoft SQL Server 2016 In this demonstration you will see how to: Use SSMS to connect to an on-premises instance of SQL Server 2016 Explore databases and other objects Work with T-SQL scripts Preparation Steps Start the 20761A-MIA-DC and 20761A-MIA-SQL virtual machines. Demonstration Steps Use SSMS to connect to an on-premises instance of SQL Server 2016 Ensure that the 20761A-MIA-DC and 20761A-MIA-SQL virtual machines are running. Log on to 20761A-MIA-SQL as ADVENTUREWORKS\Student with the password Pa$$w0rd. In the D:\Demofiles\Mod01\Setup.cmd folder, right-click Setup.cmd, and then click Run as administrator. Click Yes when you are prompted to confirm that you want to run the command file, press y when prompted, and then press Enter. Start SQL Server Management Studio and connect to the MIA-SQL database engine instance using Windows authentication. Explore database and other objects If the Object Explorer pane is not visible, on the View menu, click Object Explorer. In Object Explorer, expand the Databases folder to see a list of databases. Expand the TSQL database. Expand the Tables folder. Expand the Sales.Customers table. Expand the Columns folders. View the list of columns, and the data type information for each column. Note the data type for the CompanyName column. Work with T-SQL scripts If the Solution Explorer pane is not visible, click View and click Solution Explorer. Initially, it will be empty. On the File menu, point to New, and then click Project. (More notes on the next slide)
19
Lab: Working with SQL Server 2016 Tools
1: Introduction to Microsoft SQL Server 2016 Exercise 3: Using SQL Server 2016 Technical Documentation Exercise 1: Working with SQL Server Management Studio You have been tasked with writing queries for SQL Server. Initially, you want to become familiar with the development environment. You have therefore decided to explore SQL Server Management Studio and configure the editor for your use. Exercise 2: Creating and Organizing T-SQL Scripts You have decided to organize your T-SQL scripts in a project folder. In this lab, you will practice how to create a project and add query files to it. Exercise 3: Using SQL Server 2016 Technical Documentation To be effective in your upcoming training and exercises, you will practice using SQL Server Technical Documentation to check T-SQL syntax. Instructor Note: If there is no Internet access, students will not be able to complete this lab. It is still important, however, to explain the steps involved so that students are effective in using SQL Server Technical Documentation after completing the course. Logon Information Virtual machine: 20761A-MIA-SQL User name: ADVENTUREWORKS\Student Password: Pa$$w0rd Estimated Time: 30 minutes
20
20761A Lab Scenario 1: Introduction to Microsoft SQL Server 2016 The Adventure Works Cycles Bicycle Manufacturing Company has adopted SQL Server as its relational database management system. You need to retrieve business data from several SQL Server databases. In the lab, you will begin to explore the new environment, and become acquainted with the tools for querying SQL Server.
21
Module Review and Takeaways
1: Introduction to Microsoft SQL Server 2016 Review Question(s) Review Question(s) Question Can an SQL Server database be stored across multiple instances? Answer No. A database is completely contained within a single instance. If no T-SQL code is selected in a query window, which code lines will be run when you click the Execute button? All statements in the script will be executed. What does an SQL Server Management Studio solution contain? Projects.
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.