Download presentation
Presentation is loading. Please wait.
Published byAngel Charles Modified over 9 years ago
1
Said Salomon Unitrin Direct Insurance timelord@timelordshangout.com T-SQL for Beginners Said Salomon CODE CAMP 2009.2
2
I have over 25 year experience IT. I have a vast array of abilities in the field in the areas of Network, Desktop Support, DBA, Staff Project Management, Application Software Development, Business Analysis and Quality Assurance. I have Microsoft certifications as MCTS, MCPS, and MCNPS, and multiple certifications from the Insurance Institute of America.
4
What does the T stand for? Transact Structured Query Language SQL is a database computer language designed for managing data in database management systems
5
A way to organize large amounts of data A collation of spreadsheets A database is a collations a Tables A server is a collation of databases
6
A Table is a collations of fields (columns). Tables have rows and each rows has columns Tables are connected together logically with keys and or indexes.
7
Basics of Microsoft SQL Management Studio How to connect to a server How to explore a database on the server Basic of how to use the interface to run SQL scripts Create, Drop Insert, Update Select, Join
9
INNER Join – Result will contain matching records from both tables LEFT Join – Result will contain all records from the “left” table even if the join-condition does not find any matching record in the “right” table RIGHT Join – Result will contain all records from the “right” table even if the join-condition does not find any matching record in the “left” table FULL Join – Result will contain all records from both tables, and fill in NULLs for missing matches on either side CROSS Join – Result will contain returns the cartesian product of the sets of records from the two joined tables (Dangerous with large tables)
10
SELECT [ ALL | DISTINCT ] [ TOP ( expression ) [ PERCENT ] [ WITH TIES ] ] ::= { * | { table_name | view_name | table_alias }.* | { [ { table_name | view_name | table_alias }. ] { column_name | $IDENTITY | $ROWGUID } | udt_column_name [ {. | :: } { { property_name | field_name } | method_name ( argument [,...n] ) } ] | expression [ [ AS ] column_alias ] } | column_alias = expression } [,...n ]
11
[ WITH [,...n ] ] INSERT [ TOP ( expression ) [ PERCENT ] ] [ INTO ] { | rowset_function_limited [ WITH ( [...n ] ) ] } { [ ( column_list ) ] [ ] { VALUES ( { DEFAULT | NULL | expression } [,...n ] ) [,...n ] | derived_table | execute_statement | | DEFAULT VALUES } } [; ] ::= { [ server_name. database_name. schema_name. | database_name.[ schema_name ]. | schema_name. ] table_or_view_name } ::= SELECT FROM ( ) [AS] table_alias [ ( column_alias [,...n ] ) ] [ WHERE ] [ OPTION ( [,...n ] ) ]
12
[ WITH [...n] ] UPDATE [ TOP ( expression ) [ PERCENT ] ] { | rowset_function_limited [ WITH ( [...n ] ) ] } SET { column_name = { expression | DEFAULT | NULL } | { udt_column_name.{ { property_name = expression | field_name = expression } | method_name ( argument [,...n ] ) } } | column_name {.WRITE ( expression, @Offset, @Length ) } | @variable = expression | @variable = column = expression | column_name { += | -= | *= | /= | %= | &= | ^= | |= } expression | @variable { += | -= | *= | /= | %= | &= | ^= | |= } expression | @variable = column { += | -= | *= | /= | %= | &= | ^= | |= } expression } [,...n ] [ ] [ FROM{ } [,...n ] ] [ WHERE { | { [ CURRENT OF { { [ GLOBAL ] cursor_name } | cursor_variable_name } ] } } ] [ OPTION ( [,...n ] ) ] [ ; ] ::= { [ server_name. database_name. schema_name. | database_name.[ schema_name ]. | schema_name. ] table_or_view_name}
13
Sample databases http://msftdbprodsamples.codeplex.com/ http://msftdbprodsamples.codeplex.com/ Intro course http://sqlcourse.com/intro.html http://sqlcourse.com/intro.html SQL Server 2008, Dev Edition http://bit.ly/L2hJQ http://bit.ly/L2hJQ My Twitter SaidSalomon
Similar presentations
© 2025 SlidePlayer.com. Inc.
All rights reserved.