Tag: Structured Query Language

Identify common Structured Query Language (SQL) statements (DP-900 Exam Prep)

This post is a part of the DP-900: Microsoft Azure Data Fundamentals Exam Prep Hub. 
This topic falls under these sections:
Identify considerations for relational data on Azure (20–25%)
--> Describe relational concepts
--> Identify common Structured Query Language (SQL) statements


Note that there are 10 practice questions (with answers and explanations) for each section to help you solidify your knowledge of the material. Also, there are 2 practice tests with 60 questions each available on the hub below the exam topics section.

Understanding basic SQL statements is essential for working with relational data and is a key requirement for the DP-900 exam. You are not expected to be an advanced SQL developer, but you should recognize common SQL commands, their purpose, and when they are used.


What Is SQL?

Structured Query Language (SQL) is the standard language used to:

  • Query data
  • Insert new data
  • Update existing data
  • Delete data
  • Define database structures

SQL is used across relational database systems, including Azure services like:

  • Azure SQL Database
  • Azure Database for PostgreSQL
  • Azure Database for MySQL

Categories of SQL Statements

SQL statements are typically grouped into categories:

CategoryPurpose
DDL (Data Definition Language)Define and modify database structures
DML (Data Manipulation Language)Work with data in tables
DQL (Data Query Language)Retrieve data
DCL (Data Control Language)Manage permissions

For DP-900, focus primarily on DDL, DML, and DQL.


1. Data Query Language (DQL)


SELECT

Used to retrieve data from a table.

SELECT Name, City
FROM Customers;

You can filter results:

SELECT Name
FROM Customers
WHERE City = 'Seattle';

πŸ’‘ Key Points:

  • Most commonly used SQL statement
  • Can include filtering, sorting, and grouping

2. Data Manipulation Language (DML)


INSERT

Adds new rows to a table.

INSERT INTO Customers (Name, City)
VALUES ('John', 'Seattle');

UPDATE

Modifies existing data.

UPDATE Customers
SET City = 'Austin'
WHERE Name = 'John';

DELETE

Removes rows from a table.

DELETE FROM Customers
WHERE Name = 'John';

πŸ’‘ Important:
Always use a WHERE clause with UPDATE and DELETE to avoid affecting all rows.


3. Data Definition Language (DDL)


CREATE

Creates new database objects such as tables.

CREATE TABLE Customers (
CustomerID INT PRIMARY KEY,
Name VARCHAR(100),
City VARCHAR(50)
);

ALTER

Modifies an existing table.

ALTER TABLE Customers
ADD Email VARCHAR(100);

DROP

Deletes a table or database object.

DROP TABLE Customers;

πŸ’‘ Warning:
DROP permanently removes the object and its data.


4. Additional Common SQL Clauses


WHERE

Filters rows:

SELECT * FROM Orders
WHERE Amount > 100;

ORDER BY

Sorts results:

SELECT * FROM Orders
ORDER BY Amount DESC;

GROUP BY

Aggregates data:

SELECT City, COUNT(*)
FROM Customers
GROUP BY City;

JOIN

Combines data from multiple tables:

SELECT Orders.OrderID, Customers.Name
FROM Orders
JOIN Customers
ON Orders.CustomerID = Customers.CustomerID;

πŸ’‘ DP-900 Tip:
You don’t need deep JOIN knowledge β€” just understand that JOINs combine related tables.


SQL in Azure

SQL is used across many Azure services:


Azure SQL Database

  • Fully managed relational database
  • Uses T-SQL (Microsoft’s SQL variant)

Azure Synapse Analytics

  • Used for analytical queries on large datasets

Azure Database for PostgreSQL

  • Uses PostgreSQL SQL dialect

Why This Matters for DP-900

On the exam, you may be asked to:

  • Identify what a SQL statement does
  • Match commands to their purpose (SELECT, INSERT, etc.)
  • Recognize DDL vs DML
  • Understand basic query concepts like filtering and sorting

Summary β€” Exam-Relevant Takeaways

βœ” SELECT β†’ Retrieve data
βœ” INSERT β†’ Add new data
βœ” UPDATE β†’ Modify existing data
βœ” DELETE β†’ Remove data

βœ” CREATE / ALTER / DROP β†’ Define and modify structures
βœ” WHERE β†’ Filter results
βœ” ORDER BY β†’ Sort data
βœ” GROUP BY β†’ Aggregate data
βœ” JOIN β†’ Combine tables

βœ” SQL is the standard language for relational databases


Go to the Practice Exam Questions for this topic.

Go to the Additional Practice Questions for this topic.

Go to the DP-900 Exam Prep Hub main page.

Practice Questions: Identify common Structured Query Language (SQL) statements (DP-900 Exam Prep)

Practice Questions


Question 1

Which SQL statement is used to retrieve data from a database?

A. INSERT
B. SELECT
C. UPDATE
D. DELETE

βœ… Answer: B

Explanation:
The SELECT statement is used to query and retrieve data from tables.


Question 2

Which SQL statement adds new rows to a table?

A. INSERT
B. CREATE
C. ALTER
D. SELECT

βœ… Answer: A

Explanation:
INSERT is used to add new records to a table.


Question 3

Which SQL statement modifies existing data in a table?

A. UPDATE
B. DELETE
C. SELECT
D. DROP

βœ… Answer: A

Explanation:
UPDATE changes existing values in one or more rows.


Question 4

Which SQL statement removes rows from a table?

A. DROP
B. DELETE
C. ALTER
D. TRUNCATE

βœ… Answer: B

Explanation:
DELETE removes specific rows based on a condition.


Question 5

Which SQL statement creates a new table?

A. ALTER
B. CREATE
C. INSERT
D. SELECT

βœ… Answer: B

Explanation:
CREATE is used to define new database objects such as tables.


Question 6

Which clause is used to filter rows in a SQL query?

A. ORDER BY
B. GROUP BY
C. WHERE
D. HAVING

βœ… Answer: C

Explanation:
WHERE filters rows based on conditions.


Question 7

Which SQL clause is used to sort query results?

A. ORDER BY
B. GROUP BY
C. WHERE
D. JOIN

βœ… Answer: A

Explanation:
ORDER BY sorts results in ascending or descending order.


Question 8

Which SQL statement permanently removes a table and its structure?

A. DELETE
B. DROP
C. REMOVE
D. CLEAR

βœ… Answer: B

Explanation:
DROP deletes the table and its structure completely.


Question 9

Which SQL operation is used to combine data from two related tables?

A. GROUP BY
B. JOIN
C. UNION
D. FILTER

βœ… Answer: B

Explanation:
JOIN combines rows from multiple tables based on related columns.


Question 10

Which category of SQL statements is used to define or modify database structures?

A. DML
B. DQL
C. DDL
D. DCL

βœ… Answer: C

Explanation:
DDL (Data Definition Language) includes CREATE, ALTER, and DROP.


βœ… Quick Exam Takeaways

For DP-900, remember:

βœ” SELECT β†’ retrieve data
βœ” INSERT β†’ add data
βœ” UPDATE β†’ modify data
βœ” DELETE β†’ remove data
βœ” CREATE / ALTER / DROP β†’ manage structure
βœ” WHERE β†’ filter results
βœ” ORDER BY β†’ sort results
βœ” JOIN β†’ combine tables
βœ” SQL categories: DDL, DML, DQL


Go to the DP-900 Exam Prep Hub main page.