SlideShare a Scribd company logo
SQL for Azure Data Engineers
with Databricks
Presented by: [Your Name]
Team: [Your Team Name]
Date: [Presentation Date]
What is SQL?
• Structured Query Language used to manage relational databases.
• Core for querying Azure SQL, Synapse Analytics, and Databricks.
SQL SELECT Statement
• Used to retrieve data from a table.
• Example:
• SELECT FirstName, LastName FROM Employees;
SQL WHERE Clause
• Filters rows based on a condition.
• Example:
• SELECT * FROM Sales WHERE Region = 'West';
SQL JOINs
• Used to combine rows from two or more tables.
• Example:
• SELECT o.OrderID, c.CustomerName FROM Orders o
• JOIN Customers c ON o.CustomerID = c.CustomerID;
SQL GROUP BY and HAVING
• GROUP BY aggregates data.
• HAVING filters aggregated results.
• Example:
• SELECT Region, COUNT(*) FROM Sales GROUP BY Region HAVING COUNT(*) > 10;
SQL INSERT, UPDATE, DELETE
• INSERT INTO Employees (Name, Role) VALUES ('Alex', 'Analyst');
• UPDATE Employees SET Role = 'Manager' WHERE Name = 'Alex';
• DELETE FROM Employees WHERE Name = 'Alex';
SQL Window Functions
• Useful for analytical queries in Databricks and Synapse.
• Example:
• SELECT Name, Salary, RANK() OVER (ORDER BY Salary DESC) AS Rank FROM
Employees;
SQL with Azure Databricks
• Use `%sql` magic for SQL cells.
• Query Delta tables stored in ADLS:
• %sql SELECT * FROM delta.`/mnt/data/sales`;
Common Use Cases in Azure
• - Ingest and validate data using SQL in ADF data flows.
• - Run batch queries in Synapse and Databricks.
• - Use SQL in Power BI for dashboards.
• - Implement SCD (Slowly Changing Dimensions) using SQL.
Data Types in SQL
• INT, VARCHAR, FLOAT, DATE, BOOLEAN
• Example:
• CREATE TABLE Customers (ID INT, Name VARCHAR(100), SignupDate DATE);
Creating and Altering Tables
• CREATE TABLE Orders (ID INT, Amount FLOAT);
• ALTER TABLE Orders ADD COLUMN OrderDate DATE;
Working with NULLs
• IS NULL and IS NOT NULL
• COALESCE to replace NULLs
• Example:
• SELECT COALESCE(CreditScore, 0) FROM Customers;
CTEs and Temp Tables
• CTE Example:
• WITH TopSales AS (SELECT * FROM Sales ORDER BY Amount DESC LIMIT 10)
• SELECT * FROM TopSales;
SQL Best Practices for Azure
Engineers
• - Use parameterized queries in notebooks.
• - Avoid SELECT * in production.
• - Optimize joins and indexes in Azure SQL.
• - Use Delta Lake for ACID and schema enforcement.

More Related Content

PPTX
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
PPTX
SQL_and_Databricks_Presentation_from_basic
PDF
Top SQL Questions to Crack Data Interviews Easily
PDF
DP-900.pdf
PPTX
3 CityNetConf - sql+c#=u-sql
PPTX
SQL-Demystified-A-Beginners-Guide-to-Database-Mastery.pptx
PPTX
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
PDF
SQL-for-Data-Analytics-Top-10-Queries-Every-Analyst-Should-Know
Introduction to Azure Data Lake and U-SQL for SQL users (SQL Saturday 635)
SQL_and_Databricks_Presentation_from_basic
Top SQL Questions to Crack Data Interviews Easily
DP-900.pdf
3 CityNetConf - sql+c#=u-sql
SQL-Demystified-A-Beginners-Guide-to-Database-Mastery.pptx
Taming the Data Science Monster with A New ‘Sword’ – U-SQL
SQL-for-Data-Analytics-Top-10-Queries-Every-Analyst-Should-Know

Similar to SQL_for_Azure_Data_Engineer_basic_to_adv (20)

PPTX
Introducing U-SQL (SQLPASS 2016)
PDF
Azure Fundamentals.pdf
PPTX
U-SQL - Azure Data Lake Analytics for Developers
PPTX
Declarative Database Development with SQL Server Data Tools
PDF
advance-sqaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal.pdf
PDF
SQL command for daily use ddl dml dcl dql
PDF
MODULE 1.pdf foundations of data science for final
PDF
Wrangling data like a boss
PDF
DP080_Lecture_1 SQL lecture document .pdf
PDF
RDBMS SQL Basics
PPTX
SQL Query
PPTX
Career Options for SQL DBA : ETL Adminstrator
PPT
INTRODUCTION TO SQL QUERIES REALTED BRIEF
PDF
USQ Landdemos Azure Data Lake
PPT
Presentation1
PPTX
Structured Query Language powerpoint presentation
PDF
Building Lakehouses on Delta Lake with SQL Analytics Primer
PPTX
Azure Data Fundamentals DP 900 Full Course
PPTX
SQL_Basics_For_Data analysis_Analysts.pptx
PDF
MIS5101 WK10 Outcome Measures
Introducing U-SQL (SQLPASS 2016)
Azure Fundamentals.pdf
U-SQL - Azure Data Lake Analytics for Developers
Declarative Database Development with SQL Server Data Tools
advance-sqaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaal.pdf
SQL command for daily use ddl dml dcl dql
MODULE 1.pdf foundations of data science for final
Wrangling data like a boss
DP080_Lecture_1 SQL lecture document .pdf
RDBMS SQL Basics
SQL Query
Career Options for SQL DBA : ETL Adminstrator
INTRODUCTION TO SQL QUERIES REALTED BRIEF
USQ Landdemos Azure Data Lake
Presentation1
Structured Query Language powerpoint presentation
Building Lakehouses on Delta Lake with SQL Analytics Primer
Azure Data Fundamentals DP 900 Full Course
SQL_Basics_For_Data analysis_Analysts.pptx
MIS5101 WK10 Outcome Measures
Ad

Recently uploaded (20)

PDF
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
PPTX
A Presentation on Artificial Intelligence
PDF
Empathic Computing: Creating Shared Understanding
PDF
Approach and Philosophy of On baking technology
PDF
Per capita expenditure prediction using model stacking based on satellite ima...
PDF
Agricultural_Statistics_at_a_Glance_2022_0.pdf
PDF
Unlocking AI with Model Context Protocol (MCP)
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Encapsulation theory and applications.pdf
PDF
Review of recent advances in non-invasive hemoglobin estimation
PPTX
Digital-Transformation-Roadmap-for-Companies.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
Programs and apps: productivity, graphics, security and other tools
PPTX
MYSQL Presentation for SQL database connectivity
PDF
NewMind AI Weekly Chronicles - August'25-Week II
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Big Data Technologies - Introduction.pptx
PDF
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
Optimiser vos workloads AI/ML sur Amazon EC2 et AWS Graviton
A Presentation on Artificial Intelligence
Empathic Computing: Creating Shared Understanding
Approach and Philosophy of On baking technology
Per capita expenditure prediction using model stacking based on satellite ima...
Agricultural_Statistics_at_a_Glance_2022_0.pdf
Unlocking AI with Model Context Protocol (MCP)
The AUB Centre for AI in Media Proposal.docx
Encapsulation theory and applications.pdf
Review of recent advances in non-invasive hemoglobin estimation
Digital-Transformation-Roadmap-for-Companies.pptx
Encapsulation_ Review paper, used for researhc scholars
Programs and apps: productivity, graphics, security and other tools
MYSQL Presentation for SQL database connectivity
NewMind AI Weekly Chronicles - August'25-Week II
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
Profit Center Accounting in SAP S/4HANA, S4F28 Col11
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Advanced methodologies resolving dimensionality complications for autism neur...
Ad

SQL_for_Azure_Data_Engineer_basic_to_adv

  • 1. SQL for Azure Data Engineers with Databricks Presented by: [Your Name] Team: [Your Team Name] Date: [Presentation Date]
  • 2. What is SQL? • Structured Query Language used to manage relational databases. • Core for querying Azure SQL, Synapse Analytics, and Databricks.
  • 3. SQL SELECT Statement • Used to retrieve data from a table. • Example: • SELECT FirstName, LastName FROM Employees;
  • 4. SQL WHERE Clause • Filters rows based on a condition. • Example: • SELECT * FROM Sales WHERE Region = 'West';
  • 5. SQL JOINs • Used to combine rows from two or more tables. • Example: • SELECT o.OrderID, c.CustomerName FROM Orders o • JOIN Customers c ON o.CustomerID = c.CustomerID;
  • 6. SQL GROUP BY and HAVING • GROUP BY aggregates data. • HAVING filters aggregated results. • Example: • SELECT Region, COUNT(*) FROM Sales GROUP BY Region HAVING COUNT(*) > 10;
  • 7. SQL INSERT, UPDATE, DELETE • INSERT INTO Employees (Name, Role) VALUES ('Alex', 'Analyst'); • UPDATE Employees SET Role = 'Manager' WHERE Name = 'Alex'; • DELETE FROM Employees WHERE Name = 'Alex';
  • 8. SQL Window Functions • Useful for analytical queries in Databricks and Synapse. • Example: • SELECT Name, Salary, RANK() OVER (ORDER BY Salary DESC) AS Rank FROM Employees;
  • 9. SQL with Azure Databricks • Use `%sql` magic for SQL cells. • Query Delta tables stored in ADLS: • %sql SELECT * FROM delta.`/mnt/data/sales`;
  • 10. Common Use Cases in Azure • - Ingest and validate data using SQL in ADF data flows. • - Run batch queries in Synapse and Databricks. • - Use SQL in Power BI for dashboards. • - Implement SCD (Slowly Changing Dimensions) using SQL.
  • 11. Data Types in SQL • INT, VARCHAR, FLOAT, DATE, BOOLEAN • Example: • CREATE TABLE Customers (ID INT, Name VARCHAR(100), SignupDate DATE);
  • 12. Creating and Altering Tables • CREATE TABLE Orders (ID INT, Amount FLOAT); • ALTER TABLE Orders ADD COLUMN OrderDate DATE;
  • 13. Working with NULLs • IS NULL and IS NOT NULL • COALESCE to replace NULLs • Example: • SELECT COALESCE(CreditScore, 0) FROM Customers;
  • 14. CTEs and Temp Tables • CTE Example: • WITH TopSales AS (SELECT * FROM Sales ORDER BY Amount DESC LIMIT 10) • SELECT * FROM TopSales;
  • 15. SQL Best Practices for Azure Engineers • - Use parameterized queries in notebooks. • - Avoid SELECT * in production. • - Optimize joins and indexes in Azure SQL. • - Use Delta Lake for ACID and schema enforcement.