Download presentation
Presentation is loading. Please wait.
Published byStephany Stephens Modified over 8 years ago
1
Intro to SQL Management Studio
2
Please Be Sure!! Make sure that your access is read only. If it isn’t, you have the potential to change data within your database. There is NO undo button!!
3
Accessing Your Database Opening Management Studio Connecting to database Credentials Structure –Database -> Folders ->Tables ->Columns
4
Changing User Settings Updating font sizes
5
Changing User Settings Displaying line numbers if they aren’t already
6
Changing User Settings Turning on IntelliSense –As you begin your query, IntelliSense will provide you with a dropdown list of options that are similar to what you’ve begun to type. This is similar to how Autofill works in Excel.
7
Changing User Settings Updating query run times. –Can shorten the amount of time it takes for your query to come back if the table contains a large data set.
8
Important Buttons New Query Execute Stopping a Query
9
Basic Selections Select * From [Table]; This will select all columns from the named table Select [Column], [Column] From [Table]; This will select the listed columns from the named table Note: Columns with spaces, dashes or other special characters in their name must be enclosed in a brackets due to naming conventions of SQL Server. Otherwise the brackets are optional.
10
Select using “where” Select * From [Table] where [Column] ‘text string’; This will select all columns of data from the named table if the named column data matches the operator and text string you entered (ex: [Company] = ‘Sample Company’) Operators = (Equals) <> (Not equal) < (Less than) > (Greater than) <= (Less than or equal to) >= (Greater than or equal to)
11
Aggregate Functions Sum ( [Column] ) Will add every value in the particular column Count ( [Column] ) Will give the total number of fields that are not null. If you want to count the number of rows use count * Max ( [Column] ) Min ( [Column] ) Avg ( [Column] ) These will give you the max, min, or average of the data.
12
Using Group by When using the aggregate functions in a select statement, all fields that are not being aggregated must be included in a group by clause. Select [Column1], [Column2] From [Table] Group by [Column1];
13
Caution! If you are selecting multiple tables you should be using a “join” statement in order to limit the amount of time a query takes to run.
14
Intro Joins Joins –Link two tables together on a named column that both tables share Inner Join –Returns the data set of records in the first table that have a related record in the second table.
15
Intro Joins Left Outer Join –Returns the entire dataset of the first table. If there is a not a related record in the second table it returns “NULL”
16
Questions?
17
More Info If you are looking for further instruction, please follow the link below to some videos that may be of assistance http://www.davisware.com/supporttraining/GE/GE%205 %20Training%20Videos/
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.