Presentation is loading. Please wait.

Presentation is loading. Please wait.

Navigating SSMS Primer for Beginners

Similar presentations


Presentation on theme: "Navigating SSMS Primer for Beginners"— Presentation transcript:

1 Navigating SSMS Primer for Beginners
Harvey Hyman “the database whisperer” Contact:

2 Hyman Bio Senior Chief USCG, OIF, Katrina, Harvey PhD, 2012
Georgia Southern, 2013 – 2014 Florida Polytechnic, 2014 – 2015 New College of Florida, 2015 – 2016 Library of Congress, 2016 Moffitt Cancer Center, 2017 Muma College of Business at University of South Florida, since 2018.

3 Contact and Materials https://github.com/hymanphd-database-whisperer
whisperer/shared_invite/enQtNzczMjk1MDU0OTY3LWIyOTU1Yzk2NjM1N2YwNzdmNT c5NTNkODExOTZjMTFmNTc1ZGYxZDE0NzA4YTQ4Y2FlYjZiZDU3ZTlkMTFmZTI

4 Topics Covered Getting Started with SSMS (downloading, installing)
Developer versus Express Creating an Azure SQL Server Instance Registered Servers Basic and Interesting Features of 17.9 Navigating the Object Explorer Panel Using the Database Diagram feature Building Tables and Columns Checks, Rules, Defaults Creating Views Simple Query Operators and SPROCs Joins: inner, right, left, cross, full

5 Sources for Helpful Hints and Tricks
SSMS Tips and Tricks Productivity Driven Development: Pod Casts: Brent Ozar “SQL Server 101” Hit or Miss

6 SSMS Tips Here is a link to some productivity Tips and short cuts to navigate SSMS: productivity/ Setting color bar for your different servers Clipboard ring Vertical Block Select Web Browser tricks-mo01/ Other interesting features and customization options

7 SSMS Tips (Split windows)

8 Vertical Split Windows Horizontal Split Windows

9 If you are starting completely from scratch
SQL Server Engine Express versus Developer SSMS versus SQLCMD Where to find it Downloading Installing Don’t forget SSMS download also

10 Tour of Basic Features 17.9 versus 18 (dropped support for Database Diagram) Navigating the Object Explorer Panel: Folders Databases (where you will spend most of your time) Security (roles, setting logins) Server Objects (server level triggers) – Programmability folder Using Database Diagram functionality mapping an existing database, create new database drag and drop, modify an existing database drag and drop Using Table Designer, column properties window “Right clicking your way to happiness” Table level design versus modify column

11 Creating a database from scratch
Entities and their relations (ERDs) Attributes (columns, fields) Hopefully you have a RS and a well documented DD PK (selecting data type, identity, seed, increment) Selecting your FK – PK relationships Checks, Rules, Defaults (constraints)

12 Let’s build some tables
Things to know before you start: Create, attach, detach database DATA folder Tools  Options Designer (uncheck ‘the box’)

13 Creating Tables Items to consider:
Setting PK, Identity, Seed, Increment Column Data Types, Size Or do you want to create your own user defined data type

14 Setting Relations Between Tables
Adding Column FK in the foreign table. Linking FK in foreign table to PK in primary table.

15 Indexes: Cluster or Non-cluster
Default is PK is indexed as clustered Only one clustered index per table. I recommend setting PK as non-cluster. Index conventions: AK, UN, IX

16 Views What are views? How we can use them to: Test View: Hide columns
Hide rows “Pre-join” columns from multiple tables Can bind to schema for dynamic updates Test View: Select top 10 * table Select * table_vw Use Vertical Window

17 SQL Codes create view MaryBrown_vw as select * from Employee
where empno = '1012' CREATE VIEW Employee_vw AS SELECT EmpNo, FirstName, LastName, JobTitle, HireDate, MgrNo, DeptNo FROM Employee

18 Constraints Checks Rules Defaults Triggers

19 Queries Select From Where Order by Wild cards: %, *
Comparisons: Like, =

20 SPROCs – Stored Procedure A query wrapped as an executable
Practical Uses: Reusable query Embedded in the database Avoid the need to open .sql file More Advanced: @parameter (Increase flexibility of your SPROC) Your DBA will thank you.

21 Join Types Inner Left / Right “outer” Full Cross
Operation: exclusive, most common Purpose: Include only matching rows from tables on both sides of join command. Left / Right “outer” Operation: inclusive matching Purpose: Include all from inclusive side (left or right), and only the matching rows from other side. Full Operation: shows all rows from both tables. Good way to find missing matches. Purpose: Include matching rows, and rows that don’t have a match from left and rows that don’t have a match from right. Cross Cartesian: Good way to get a distribution across matches. Left Right

22 Harvey Hyman “the database whisperer” Any questions?


Download ppt "Navigating SSMS Primer for Beginners"

Similar presentations


Ads by Google