Introduction to SQL Server and Database Architecture
What is a Database?
SQL Server: The Basics
SQL vs. T-SQL
SQL Server Instances
Databases within an Instance
Schemas: Organizing Objects
Tables: Data Storage
Views: Simplified Data Access
Stored Procedures: Reusable Code
Indexes: Speeding Up Queries
Dev, Test, Prod Environments
SQL Server Management Studio
Connecting to a Database
Your First Query Window
Retrieving Data with SELECT and Basic Filtering
What is T-SQL?
The SELECT Statement
Selecting Specific Columns
Column Aliases
Eliminating Duplicates
The WHERE Clause
Comparison Operators
Logical Operators: AND
Logical Operators: OR
Logical Operators: NOT
Sorting with ORDER BY
Sorting by Multiple Columns
Limiting Results with TOP
TOP with TIES
Putting It All Together
Working with T-SQL Data Types and NULL Values
What are Data Types?
Numbers: INT, DECIMAL
Text: VARCHAR, NVARCHAR
Dates & Times: DATETIME
Other Types: BIT, UNIQUEID
What is NULL?
Filtering with IS NULL
NULLs in Calculations
Handling NULLs with ISNULL
Handling NULLs with COALESCE
Why Convert Data Types?
CAST Function
CONVERT Function
TRY_CAST and TRY_CONVERT
Common Conversion Issues
Data Manipulation Language (DML) Essentials
What is DML?
Adding Your First Row
Inserting All Columns
Inserting NULLs and Defaults
Inserting Multiple Rows
Updating a Single Column
Updating Multiple Columns
The Critical WHERE Clause
Updating with Expressions
Updating from Other Tables
Deleting Specific Rows
Deleting All Rows
DELETE vs. TRUNCATE
DELETE with JOINs
DML Best Practices
Leveraging Built-in T-SQL Functions
Counting Your Records
Summing Up Numeric Data
Averaging Your Values
Finding Min and Max Values
Aggregates with DISTINCT
Measuring String Length
Extracting Substrings
Combining Text
Trimming and Replacing Text
Changing Case and Finding Text
Getting Current Date/Time
Adding and Subtracting Dates
Calculating Date Differences
Extracting Date Parts
Formatting Dates
Combining Data with JOINs
Why Combine Data?
Relational Database Basics
What is a JOIN?
INNER JOIN Fundamentals
INNER JOIN Syntax & Aliases
Joining Multiple Tables
LEFT OUTER JOIN
RIGHT OUTER JOIN
FULL OUTER JOIN
Self-JOINs
CROSS JOIN
JOIN vs. WHERE
Common JOIN Mistakes
Performance & Best Practices
Real-World Scenarios
Advanced Filtering and Grouping Data
Filtering with IN
Filtering with BETWEEN
Pattern Matching with LIKE
Advanced LIKE Patterns
Combining Advanced Filters
Intro to GROUP BY
Grouping by Single Column
Grouping by Multiple Columns
GROUP BY and NULLs
GROUP BY with Expressions
Intro to HAVING
HAVING vs. WHERE
HAVING with Aggregates
HAVING with Multiple Conditions
Full Query Order
Troubleshooting and Performance Basics
What's an Error Message?
Common Syntax Errors
Data Type Mismatch Errors
Constraint Violation Errors
Permissions & Object Errors
Why Performance Matters
Reading Execution Plans
Impact of WHERE Clauses
JOINs and Performance
Sorting and Grouping Costs
Selecting Only What's Needed
Filtering Early and Often
Using TOP/OFFSET-FETCH
Minimizing Subqueries
Best Practices Summary