SlideShare a Scribd company logo
Chapter - 1
TSQL - SELECTION
CustomerID Name Country Age Registration_date
1 Daniel USA 42 11-Nov-2018
2 Martin USA 42 1-Jan-2019
3 Amitabh India 34 NULL
4 Amit India 18 1-Jan-2019
5 Dilip India NULL 24-Feb-2019
6 Advik India 11 12-Dec-2018
7 Avit NULL NULL NULL
8 Agrim India 4 NULL
CustomerID Name Country Age Registration_date
1 Daniel USA 42 11-Nov-2018
2 Martin USA 42 1-Jan-2019
3 Amitabh India 34 NULL
4 Amit India 18 1-Jan-2019
5 Dilip India NULL 24-Feb-2019
6 Advik India 11 12-Dec-2018
7 Avit NULL NULL NULL
8 Agrim India 4 NULL
Customer Table Expected Output
1. Question and Expected Output
Solution and Query Execution Result
Concept Generalization
Query Solution
Customer Table Expected Output
2. Question and Expected Output
Name
Advik
Agrim
Amit
Amitabh
Avit
Daniel
Dilip
Martin
CustomerID Name Country Age Registration_date
1 Daniel USA 42 11-Nov-2018
2 Martin USA 42 1-Jan-2019
3 Amitabh India 34 NULL
4 Amit India 18 1-Jan-2019
5 Dilip India NULL 24-Feb-2019
6 Advik India 11 12-Dec-2018
7 Avit NULL NULL NULL
8 Agrim India 4 NULL
Solution and Query Execution Result
Concept Generalization
Query Solution
Customer Table Expected Output
3. Question and Expected Output
Name Age
Daniel 42
Martin 42
Amitabh 34
Amit 18
Dilip NULL
Advik 11
Avit NULL
Agrim 4
CustomerID Name Country Age Registration_date
1 Daniel USA 42 11-Nov-2018
2 Martin USA 42 1-Jan-2019
3 Amitabh India 34 NULL
4 Amit India 18 1-Jan-2019
5 Dilip India NULL 24-Feb-2019
6 Advik India 11 12-Dec-2018
7 Avit NULL NULL NULL
8 Agrim India 4 NULL
Solution and Query Execution Result
Concept Generalization
Query Solution
CustomerName Customer Age
Daniel 42
Martin 42
Amitabh 34
Amit 18
Dilip NULL
Advik 11
Avit NULL
Agrim 4
CustomerID Name Country Age Registration_date
1 Daniel USA 42 11-Nov-2018
2 Martin USA 42 1-Jan-2019
3 Amitabh India 34 NULL
4 Amit India 18 1-Jan-2019
5 Dilip India NULL 24-Feb-2019
6 Advik India 11 12-Dec-2018
7 Avit NULL NULL NULL
8 Agrim India 4 NULL
Customer Table Expected Output
4. Question and Expected Output
Solution and Query Execution Result
Concept Generalization
Query Solution
Name
Advik
Agrim
Amit
Amitabh
Avit
Daniel
Dilip
Martin
CustomerID Name Country Age Registration_date
1 Daniel USA 42 11-Nov-2018
2 Martin USA 42 1-Jan-2019
3 Amitabh India 34 NULL
4 Amit India 18 1-Jan-2019
5 Dilip India NULL 24-Feb-2019
6 Advik India 11 12-Dec-2018
7 Avit NULL NULL NULL
8 Agrim India 4 NULL
Customer Table Expected Output
5. Question and Expected Output
Solution and Query Execution Result
Concept Generalization
Query Solution
Author is M.Tech. from BITS Pilani in software
systems. He is currently working as
Associate Technical Architect in CMM Level 5
company and have more than 15 years of
experience in software development and
practices.
Please reach out to Author at
ars.sqb@gmail.com if you have any query /
suggestion / details which you would like to
share.
About the Author
Why to Read Book
Who can Read Book
Features of the Book
How to buy the Book and benefit after purchase
Want to learn more about
our 30 hours training
program
30 Hours Training Schedule for SQL Server 2017
Serial # Agenda Duration
(Hours)
Agenda Detail
1 Installation of Microsoft SQL Server 2017 1.0  We will make sure installation done on
every machine
2 TSQL-Selection 2.0  Record Selection
 Record Alias
 Record Ordering
 Select Top N record
 Record Distinct
3 TSQL-Filter 2.0  Record filter on Numeric column
 Record filter on Date column
 Record filter on String column
4 TSQL-Multiple Filter 1.5  Record filter using AND operator
 Record filter using OR operator
 Record filter using NOT operator
5 TSQL-Grouping 1.5  Count, Count Distinct, Min, Max, Sum,
Average On Table
 Record Grouping and then Count, Min,
Max, Sum, Average On Table
 Record Grouping and then Count, Min,
Max, Sum, Average On Table and
Finally Filter
6 TSQL-Joining 2.0  Record Join (Left join, Right join, Full
join, Cross join, Cross Apply and Outer
Apply)
 Using Exists and Not Exists
30 Hours Training Schedule for SQL Server 2017
Serial # Agenda Duration
(Hours)
Agenda Detail
7 TSQL -Various Operation 3.0  Working with Date
 String Operation
 Using ISNULL
 Using Case
 Using IIF
 Converting column value to other Data
Type
 Sequencing on Table records
8 Working with two result sets 1.5  Using Intersect
 Using Except
 Using Union All
 Using Union
9 DDL-Operations 2.0  Working on Database
 Working on Table
 Working on Various Keys
 Working on Index
10 DML-Operations 2.0  Record Insertion
 Record Insertion using Select INTO
 Record Update
 Record Delete
 Truncate Table
30 Hours Training Schedule for SQL Server 2017
Serial # Agenda Duration
(Hours)
Agenda Detail
11 Stored Procedure 4.0  Working with Variable
 Create Stored Procedure
 Alter Stored Procedure
 Using Temporary Table/ Table Variable
 Using If Else
 Loop Handling
 Exception Handling
 Transaction Management
12 Function 1.5  Scalar Function
 Inline Table Valued Function
 Multi-Statement Table Valued Function
13 Trigger 2.5  After Trigger: INSERT
 After Trigger: UPDATE
 After Trigger: DELETE
 After Trigger: Magic Tables
 Instead of Trigger: INSERT
 Instead of Trigger: UPDATE
 Instead Of Trigger: DELETE
14 View 1.0  Create View
 Alter View
15 Troubleshooting and Performance 2.5  Basic Troubleshooting
 Stored Procedure Debugging
 Function Debugging
 Query Performance
 Query Performance tool
Total 30

More Related Content

PPTX
Chapter 4 TSQL-Grouping
PPTX
Chapter 7 Working with two result sets
PPTX
Chapter 12 Trigger
PPT
Adp scrum multiple product logs
PPTX
Chapter 10 Stored Procedure
PPTX
data_analytics_using_caat_tool_idea.pptx
PPTX
Chapter 14 Troubleshooting and Performance
PPTX
Chapter 9 DML-Operations
Chapter 4 TSQL-Grouping
Chapter 7 Working with two result sets
Chapter 12 Trigger
Adp scrum multiple product logs
Chapter 10 Stored Procedure
data_analytics_using_caat_tool_idea.pptx
Chapter 14 Troubleshooting and Performance
Chapter 9 DML-Operations

Similar to Chapter 1 TSQL - SELECTION (20)

PDF
IT_Specialist Foundation_Jyotirmay
PPTX
MODULE4_20221212_rev1.pptx
DOCX
Bcom bba nmims june 2021 solved assignment
PDF
Projectofifb01 120705211913-phpapp01
PDF
Project on IFB by Ranbir Singh (ranbirism2011@gmail.com)
PPTX
Mind The Gap - Refinements to DMN 1.1 Suggested by Real-World Experience
PDF
SIP Report
PDF
Estimating in Software Development: No Silver Bullets Allowed
PPTX
MongoDB.Live 2020 - Advanced Schema Design Patterns
PPTX
Paper and Packaging Industry in India: Growth and Investment Opportunities
PPT
Higher isdd revision presentation
PDF
Top 20 Big Data Companies 2014
PDF
Erp market in india2011
PPT
Lead generation process
PPTX
HOW TO SAVE PILEs of $$$ BY CREATING THE BEST DATA MODEL THE FIRST TIME (Ksc...
PDF
Silicon systems testimonial template for tally customers rathi group
PDF
1 babok2 chapter1 webinar_v01
PPTX
JPIERE-0111:Simple Input Window
PPTX
Whats New in Postgres 12
 
PDF
Chap 5.2 Collect requirements
IT_Specialist Foundation_Jyotirmay
MODULE4_20221212_rev1.pptx
Bcom bba nmims june 2021 solved assignment
Projectofifb01 120705211913-phpapp01
Project on IFB by Ranbir Singh (ranbirism2011@gmail.com)
Mind The Gap - Refinements to DMN 1.1 Suggested by Real-World Experience
SIP Report
Estimating in Software Development: No Silver Bullets Allowed
MongoDB.Live 2020 - Advanced Schema Design Patterns
Paper and Packaging Industry in India: Growth and Investment Opportunities
Higher isdd revision presentation
Top 20 Big Data Companies 2014
Erp market in india2011
Lead generation process
HOW TO SAVE PILEs of $$$ BY CREATING THE BEST DATA MODEL THE FIRST TIME (Ksc...
Silicon systems testimonial template for tally customers rathi group
1 babok2 chapter1 webinar_v01
JPIERE-0111:Simple Input Window
Whats New in Postgres 12
 
Chap 5.2 Collect requirements
Ad

Recently uploaded (20)

PPTX
bas. eng. economics group 4 presentation 1.pptx
PPTX
additive manufacturing of ss316l using mig welding
PPTX
Foundation to blockchain - A guide to Blockchain Tech
PPTX
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
DOCX
573137875-Attendance-Management-System-original
PPTX
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
PPTX
web development for engineering and engineering
PPTX
CYBER-CRIMES AND SECURITY A guide to understanding
PDF
Embodied AI: Ushering in the Next Era of Intelligent Systems
PDF
737-MAX_SRG.pdf student reference guides
PDF
Model Code of Practice - Construction Work - 21102022 .pdf
PPTX
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
PDF
Automation-in-Manufacturing-Chapter-Introduction.pdf
PPTX
Internet of Things (IOT) - A guide to understanding
PDF
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
PPTX
Sustainable Sites - Green Building Construction
PDF
Operating System & Kernel Study Guide-1 - converted.pdf
PPTX
Current and future trends in Computer Vision.pptx
PPTX
UNIT 4 Total Quality Management .pptx
PPTX
Geodesy 1.pptx...............................................
bas. eng. economics group 4 presentation 1.pptx
additive manufacturing of ss316l using mig welding
Foundation to blockchain - A guide to Blockchain Tech
MET 305 2019 SCHEME MODULE 2 COMPLETE.pptx
573137875-Attendance-Management-System-original
FINAL REVIEW FOR COPD DIANOSIS FOR PULMONARY DISEASE.pptx
web development for engineering and engineering
CYBER-CRIMES AND SECURITY A guide to understanding
Embodied AI: Ushering in the Next Era of Intelligent Systems
737-MAX_SRG.pdf student reference guides
Model Code of Practice - Construction Work - 21102022 .pdf
Engineering Ethics, Safety and Environment [Autosaved] (1).pptx
Automation-in-Manufacturing-Chapter-Introduction.pdf
Internet of Things (IOT) - A guide to understanding
PREDICTION OF DIABETES FROM ELECTRONIC HEALTH RECORDS
Sustainable Sites - Green Building Construction
Operating System & Kernel Study Guide-1 - converted.pdf
Current and future trends in Computer Vision.pptx
UNIT 4 Total Quality Management .pptx
Geodesy 1.pptx...............................................
Ad

Chapter 1 TSQL - SELECTION

  • 1. Chapter - 1 TSQL - SELECTION
  • 2. CustomerID Name Country Age Registration_date 1 Daniel USA 42 11-Nov-2018 2 Martin USA 42 1-Jan-2019 3 Amitabh India 34 NULL 4 Amit India 18 1-Jan-2019 5 Dilip India NULL 24-Feb-2019 6 Advik India 11 12-Dec-2018 7 Avit NULL NULL NULL 8 Agrim India 4 NULL CustomerID Name Country Age Registration_date 1 Daniel USA 42 11-Nov-2018 2 Martin USA 42 1-Jan-2019 3 Amitabh India 34 NULL 4 Amit India 18 1-Jan-2019 5 Dilip India NULL 24-Feb-2019 6 Advik India 11 12-Dec-2018 7 Avit NULL NULL NULL 8 Agrim India 4 NULL Customer Table Expected Output 1. Question and Expected Output
  • 3. Solution and Query Execution Result
  • 5. Customer Table Expected Output 2. Question and Expected Output Name Advik Agrim Amit Amitabh Avit Daniel Dilip Martin CustomerID Name Country Age Registration_date 1 Daniel USA 42 11-Nov-2018 2 Martin USA 42 1-Jan-2019 3 Amitabh India 34 NULL 4 Amit India 18 1-Jan-2019 5 Dilip India NULL 24-Feb-2019 6 Advik India 11 12-Dec-2018 7 Avit NULL NULL NULL 8 Agrim India 4 NULL
  • 6. Solution and Query Execution Result
  • 8. Customer Table Expected Output 3. Question and Expected Output Name Age Daniel 42 Martin 42 Amitabh 34 Amit 18 Dilip NULL Advik 11 Avit NULL Agrim 4 CustomerID Name Country Age Registration_date 1 Daniel USA 42 11-Nov-2018 2 Martin USA 42 1-Jan-2019 3 Amitabh India 34 NULL 4 Amit India 18 1-Jan-2019 5 Dilip India NULL 24-Feb-2019 6 Advik India 11 12-Dec-2018 7 Avit NULL NULL NULL 8 Agrim India 4 NULL
  • 9. Solution and Query Execution Result
  • 11. CustomerName Customer Age Daniel 42 Martin 42 Amitabh 34 Amit 18 Dilip NULL Advik 11 Avit NULL Agrim 4 CustomerID Name Country Age Registration_date 1 Daniel USA 42 11-Nov-2018 2 Martin USA 42 1-Jan-2019 3 Amitabh India 34 NULL 4 Amit India 18 1-Jan-2019 5 Dilip India NULL 24-Feb-2019 6 Advik India 11 12-Dec-2018 7 Avit NULL NULL NULL 8 Agrim India 4 NULL Customer Table Expected Output 4. Question and Expected Output
  • 12. Solution and Query Execution Result
  • 14. Name Advik Agrim Amit Amitabh Avit Daniel Dilip Martin CustomerID Name Country Age Registration_date 1 Daniel USA 42 11-Nov-2018 2 Martin USA 42 1-Jan-2019 3 Amitabh India 34 NULL 4 Amit India 18 1-Jan-2019 5 Dilip India NULL 24-Feb-2019 6 Advik India 11 12-Dec-2018 7 Avit NULL NULL NULL 8 Agrim India 4 NULL Customer Table Expected Output 5. Question and Expected Output
  • 15. Solution and Query Execution Result
  • 17. Author is M.Tech. from BITS Pilani in software systems. He is currently working as Associate Technical Architect in CMM Level 5 company and have more than 15 years of experience in software development and practices. Please reach out to Author at ars.sqb@gmail.com if you have any query / suggestion / details which you would like to share. About the Author
  • 18. Why to Read Book Who can Read Book
  • 20. How to buy the Book and benefit after purchase
  • 21. Want to learn more about our 30 hours training program
  • 22. 30 Hours Training Schedule for SQL Server 2017 Serial # Agenda Duration (Hours) Agenda Detail 1 Installation of Microsoft SQL Server 2017 1.0  We will make sure installation done on every machine 2 TSQL-Selection 2.0  Record Selection  Record Alias  Record Ordering  Select Top N record  Record Distinct 3 TSQL-Filter 2.0  Record filter on Numeric column  Record filter on Date column  Record filter on String column 4 TSQL-Multiple Filter 1.5  Record filter using AND operator  Record filter using OR operator  Record filter using NOT operator 5 TSQL-Grouping 1.5  Count, Count Distinct, Min, Max, Sum, Average On Table  Record Grouping and then Count, Min, Max, Sum, Average On Table  Record Grouping and then Count, Min, Max, Sum, Average On Table and Finally Filter 6 TSQL-Joining 2.0  Record Join (Left join, Right join, Full join, Cross join, Cross Apply and Outer Apply)  Using Exists and Not Exists
  • 23. 30 Hours Training Schedule for SQL Server 2017 Serial # Agenda Duration (Hours) Agenda Detail 7 TSQL -Various Operation 3.0  Working with Date  String Operation  Using ISNULL  Using Case  Using IIF  Converting column value to other Data Type  Sequencing on Table records 8 Working with two result sets 1.5  Using Intersect  Using Except  Using Union All  Using Union 9 DDL-Operations 2.0  Working on Database  Working on Table  Working on Various Keys  Working on Index 10 DML-Operations 2.0  Record Insertion  Record Insertion using Select INTO  Record Update  Record Delete  Truncate Table
  • 24. 30 Hours Training Schedule for SQL Server 2017 Serial # Agenda Duration (Hours) Agenda Detail 11 Stored Procedure 4.0  Working with Variable  Create Stored Procedure  Alter Stored Procedure  Using Temporary Table/ Table Variable  Using If Else  Loop Handling  Exception Handling  Transaction Management 12 Function 1.5  Scalar Function  Inline Table Valued Function  Multi-Statement Table Valued Function 13 Trigger 2.5  After Trigger: INSERT  After Trigger: UPDATE  After Trigger: DELETE  After Trigger: Magic Tables  Instead of Trigger: INSERT  Instead of Trigger: UPDATE  Instead Of Trigger: DELETE 14 View 1.0  Create View  Alter View 15 Troubleshooting and Performance 2.5  Basic Troubleshooting  Stored Procedure Debugging  Function Debugging  Query Performance  Query Performance tool Total 30