Learn T-SQL From Scratch
US$ 19.95
The publisher has enabled DRM protection, which means that you need to use the BookFusion iOS, Android or Web app to read this eBook. This eBook cannot be used outside of the BookFusion platform.
Description
Contents
Reviews
Language
English
ISBN
9789391392413
Cover Page
Title Page
Copyright Page
Forewords
Dedication Page
About the Author
About the Reviewers
Acknowledgement
Preface
Errata
1. Getting Started
Structure
Objectives
Database
Table, row, and column
DBMS
RDBMS
De-normalization
Normalization
Entity Relationship (ER)
Constraints
Primary Key
Foreign key
Trigger
ACID
Transaction
Atomicity (A)
Consistency (C)
Isolation (I)
Durability (D)
T-SQL
SQL
T-SQL commands
Data Definition Language (DDL)
Data Manipulation Language (DML)
Transaction Control Language (TCL)
Data Control Language (DCL)
SQL Server physical architecture
Quick summary of SQL Server physical architecture
SQL Server version and editions
SQL Server download and installation
SQL Server Management Studio (SSMS)
Getting started with SSMS
Object Explorer
Query editor
Parse (Ctrl + F5)
Execute (F5)
Results to Text (Ctrl + T)
Results to Grid (Ctrl + D)
Results to File (Ctrl + F)
Comment out the selected lines (Ctrl + K + C)
Uncomment out the selected lines (Ctrl + K + U)
Increase indent
Decrease indent
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
2. Tables
Structure
CREATE DATABASE
USE DATABASE
CREATE SCHEMA
Data types
String
Binary
Numeric (non-decimal values)
Numeric (decimal values)
Approximate floating point numeric data types
Date and time
Boolean
More on data types
CREATE TABLE
Three-part naming
ALTER TABLE
DROP TABLE
What is NULL?
Primary Key constraint
NOT NULL constraint
UNIQUE constraint
Primary Key versus UNIQUE constraint
DEFAULT constraint
CHECK constraint
Foreign Key constraint
CASCADING in Foreign Key
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
3. Index
Structure
Objective
Index
Rowstore indexes
Clustered index
Non-clustered index
Covering index
Filtered index
Unique index
Columnstore indexes
Clustered columnstore index
Non-clustered columnstore index
Filtered columnstore index
DROP INDEX
Indexes in practical
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
4. DML
Structure
Objective
INSERT statement
SELECT statement
SELECT *
SELECT-specific columns
Filtering
Wildcard search
Range search
Sorting
Paging
TOP
UPDATE statement
DELETE statement
TRUNCATE statement
Magic tables (inserted and deleted tables)
OUTPUT clause with INSERT statement
OUTPUT clause with DELETE statement
OUTPUT clause with UPDATE statement
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
5. Built-In Functions - Part 1
Structure
Objective
Aggregate functions
GROUP BY
HAVING
SUM ()
COUNT ()
COUNT (<column name>)
COUNT (*)
COUNT (DISTINCT <column name>)
AVG ()
MIN ()
MAX ()
Aggregate functions with INSERT
String functions
LEFT ()
RIGHT ()
SUBSTRING ()
REPLACE ()
LEN ()
LTRIM ()
RTRIM ()
LOWER ()
UPPER ()
SPACE ()
REPLICATE ()
REVERSE ()
CHARINDEX ()
QUOTENAME ()
STRING_SPLIT ()
Numeric functions
ABS ()
ISNUMERIC ()
ROUND ()
FLOOR () and CEILING ()
POWER ()
RAND ()
Date functions
GETDATE ()
ISDATE ()
DATEPART ()
DATEADD ()
DATEDIFF ()
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
6. Join, Apply, and Subquery
Structure
Objective
JOIN
VLOOKUP in Excel vs JOIN
INNER JOIN
One-to-one relationship
One-to-many relationship
Many-to-many relationship
OUTER JOIN
LEFT OUTER JOIN
RIGHT OUTER JOIN
FULL OUTER JOIN
APPLY
CROSS APPLY
OUTER APPLY
Subquery
Types of subqueries
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
7. Built-In Functions – Part 2
Structure
Objective
Window functions
Aggregate functions
T-SQL example of aggregate windowing functions
Ranking functions
ROW_NUMBER ()
RANK ()
DENSE_RANK ()
NTILE ()
T-SQL example of ranking functions
Analytic functions
T-SQL example of analytic functions
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
8. Dealing with XML and JSON
Structure
Objective
Dealing with XML data
XQuery
Filtering data using XQuery
Other XQuery methods
OPENXML
Table to XML
Dealing with JSON data
OPENJSON
Other JSON functions
Table to JSON
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
9. Variables and Control Flow Statements
Structure
Objective
Variables
Declaring the variables
Assigning values to the variables
Reading values from the variables
Tiny, yet powerful keywords
BEGIN … END
Semicolon (;)
RETURN
GOTO
WAITFOR
CASE statement
IF statement
WHILE loop
BREAK
CONTINUE
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
10. Temporary Tables, CTE, and MERGE Statement
Structure
Objective
Temporary tables
Common Table Expression (CTE)
MERGE command
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
11. Error Handling and Transaction Management
Structure
Objective
Error handling
TRY … CATCH
Retrieving error information
@@ERROR
Transaction management
@@TRANCOUNT
XACT_STATE()
Implementing explicit transaction
Conclusion
Points to remember
Multiple choice question
Answers
Questions
Key terms
12. Data Conversion, Cross-Database, and Cross-Server Data Access
Structure
Objective
Data conversion
CAST and CONVERT
PARSE
TRY_CAST, TRY_CONVERT, and TRY_PARSE
Cross-database data access
Cross-server data access
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
13. Programmability
Structure
Objective
Dealing with NULL values
ISNULL
COALESCE
NULLIF
Dealing with IDENTITY value
@@IDENTITY
IDENT_CURRENT (<table_name>)
SCOPE_IDENTITY ()
Dynamic SQL
SET NOCOUNT {ON | OFF}
IS and IS NOT
EXISTS and NOT EXISTS
EXISTS
NOT EXISTS
Programmability objects
Views
User-defined functions
Scalar user-defined functions
Table-valued user-defined functions
Stored procedures
Stored procedures with output parameters
Stored procedures with the default parameters
Getting hands dirty with stored procedures
Triggers
DDL triggers
DML triggers
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
14. Deployment
Structure
Objective
Deployment
Different methods of deployment
Generating and executing script
Generating Scripts
Backup and Restore
Conclusion
Points to remember
Multiple choice questions
Answers
Questions
Key terms
Index
The book hasn't received reviews yet.