Skip to content

Commit d56df3f

Browse files
authored
pull base content,head:MicrosoftDocs:main,into:wwlpublishsync
2 parents d3f8706 + c778327 commit d56df3f

File tree

95 files changed

+489
-462
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

95 files changed

+489
-462
lines changed

learn-pr/azure-databases/postgresql/basic-sql-aggregate-functions-grouping/includes/2-sample-database-overview.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ Foreign keys are a concept in relational databases, used to establish and enforc
2323

2424
## Sample database creation script
2525

26+
To create the sales database, insert the following script into a query, and run it.
27+
Select Refresh to ensure the Explorer panel is up to date.
28+
Note that this can take a minute.
29+
2630
<details>
2731
<summary>Select to expand</summary>
2832

2933
```sql
34+
--DROP SCHEMA IF EXISTS sales CASCADE;
3035
CREATE SCHEMA sales;
3136

3237
create table sales.categories (

learn-pr/azure-databases/postgresql/basic-sql-aggregate-functions-grouping/includes/3-aggregate-functions.md

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@ Examples of aggregate functions include `COUNT` to count rows, `SUM` to calculat
99
`COUNT` is commonly used to quickly get an overview of the volume of data in a table, such as the total number of orders placed in a `sales` dataset.
1010

1111
```sql
12-
SELECT COUNT(*) FROM sales.orders;
12+
SELECT COUNT(*)
13+
FROM sales.orders;
1314
```
1415

1516
The result of this query is a single numeric value representing the total number of orders (or rows) present in the `sales.orders` table.
1617

1718
```sql
18-
SELECT COUNT(DISTINCT country) FROM sales.customers;
19+
SELECT COUNT(DISTINCT country)
20+
FROM sales.customers;
1921
```
2022

2123
This SQL query uses the `COUNT` function along with the `DISTINCT` keyword to determine the number of unique countries present in the `country` column of the `sales.customers` table. Essentially, it counts each distinct `country` only once, providing a numerical result that represents the total number of different countries in the dataset.
@@ -25,7 +27,8 @@ This SQL query uses the `COUNT` function along with the `DISTINCT` keyword to de
2527
`SUM` is a versatile aggregate function widely used for calculating the total sum of values in a numeric column. Whether you're analyzing financial data or evaluating inventory quantities, `SUM` provides a straightforward way to aggregate numbers across multiple rows in a table.
2628

2729
```sql
28-
SELECT SUM(price) FROM sales.products;
30+
SELECT SUM(price)
31+
FROM sales.products;
2932
```
3033

3134
This query calculates the total sum of all values in the `price` column of the `sales.products` table. It aggregates the prices of multiple rows into a single numeric result, representing the total cost of all products.
@@ -35,7 +38,8 @@ This query calculates the total sum of all values in the `price` column of the `
3538
The `AVG` function is an essential SQL aggregate function designed to calculate the arithmetic mean of numeric values within a column. Whether you're dealing with product prices, employee salaries, or exam scores, `AVG` enables you to summarize data efficiently by returning a single value that represents the average of all rows in the specified dataset.
3639

3740
```sql
38-
SELECT AVG(price) FROM sales.products;
41+
SELECT AVG(price)
42+
FROM sales.products;
3943
```
4044

4145
This query is designed to calculate the average `price` of all products listed in the `sales.products` table. By using the `AVG` function, it computes the arithmetic mean of the values in the `price` column, effectively summarizing the dataset into a single representative value.
@@ -45,7 +49,8 @@ This query is designed to calculate the average `price` of all products listed i
4549
The `MAX` and `MIN` functions are aggregate functions used to identify the highest and lowest numeric values within a column.
4650

4751
```sql
48-
SELECT MAX(price), MIN(price) FROM sales.products;
52+
SELECT MAX(price), MIN(price)
53+
FROM sales.products;
4954
```
5055

5156
This query retrieves two values: the highest `price` and the lowest `price` among all products listed in the `sales.products` table.

learn-pr/azure-databases/postgresql/basic-sql-join-tables/includes/2-sample-database-overview.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ Foreign keys are a concept in relational databases, used to establish and enforc
2323

2424
## Sample database creation script
2525

26+
To create the sales database, insert the following script into a query, and run it.
27+
Select Refresh to ensure the Explorer panel is up to date.
28+
Note that this can take a minute.
29+
2630
<details>
2731
<summary>Select to expand</summary>
2832

2933
```sql
34+
--DROP SCHEMA IF EXISTS sales CASCADE;
3035
CREATE SCHEMA sales;
3136

3237
create table sales.categories (

learn-pr/azure-databases/postgresql/basic-sql-limit-offset-order-by/includes/2-sample-database-overview.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ Foreign keys are a concept in relational databases, used to establish and enforc
2323

2424
## Sample database creation script
2525

26+
To create the sales database, insert the following script into a query, and run it.
27+
Select Refresh to ensure the Explorer panel is up to date.
28+
Note that this can take a minute.
29+
2630
<details>
2731
<summary>Select to expand</summary>
2832

2933
```sql
34+
--DROP SCHEMA IF EXISTS sales CASCADE;
3035
CREATE SCHEMA sales;
3136

3237
create table sales.categories (

learn-pr/azure-databases/postgresql/basic-sql-limit-offset-order-by/includes/3-order-by.md

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@ This is essential for organizing data in a way that makes it easier to interpret
55
## Sorting in ascending order (default)
66

77
```sql
8-
SELECT * FROM sales.products
8+
SELECT *
9+
FROM sales.products
910
ORDER BY price;
1011
```
1112

@@ -17,7 +18,8 @@ To change the order, you need to indicate that explicitly, as demonstrated in th
1718
## Sorting in descending order
1819

1920
```sql
20-
SELECT * FROM sales.products
21+
SELECT *
22+
FROM sales.products
2123
ORDER BY price DESC;
2224
```
2325

@@ -26,7 +28,8 @@ This query retrieves products sorted by price in descending order.
2628
## Sorting by multiple columns
2729

2830
```sql
29-
SELECT * FROM sales.customers
31+
SELECT *
32+
FROM sales.customers
3033
ORDER BY country, city;
3134
```
3235

@@ -39,7 +42,8 @@ In essence, this query provides a customer list that is organized primarily by `
3942
Additionally, combining this approach with `ASC` or `DESC` modifiers allows full control over the sorting direction for each column.
4043

4144
```sql
42-
SELECT * FROM sales.customers
45+
SELECT *
46+
FROM sales.customers
4347
ORDER BY country ASC, city DESC;
4448
```
4549

learn-pr/azure-databases/postgresql/basic-sql-limit-offset-order-by/includes/4-limit-offset.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ The `LIMIT` clause allows you to specify the maximum number of rows to return, p
77
## Limiting the number of rows returned
88

99
```sql
10-
SELECT product_name, price FROM sales.products
10+
SELECT product_name, price
11+
FROM sales.products
1112
LIMIT 10;
1213
```
1314

@@ -17,7 +18,8 @@ The `LIMIT` clause in SQL is a powerful tool for controlling the number of recor
1718
## Using OFFSET to skip rows
1819

1920
```sql
20-
SELECT * FROM sales.products
21+
SELECT *
22+
FROM sales.products
2123
LIMIT 10 OFFSET 20;
2224
```
2325

learn-pr/azure-databases/postgresql/basic-sql-simple-select/includes/2-sample-database-overview.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ Foreign keys are a concept in relational databases, used to establish and enforc
2323

2424
## Sample Database Creation Script
2525

26+
To create the sales database, insert the following script into a query, and run it.
27+
Select Refresh to ensure the Explorer panel is up to date.
28+
Note that this can take a minute.
29+
2630
<details>
2731
<summary>Select to expand</summary>
2832

2933
```sql
34+
--DROP SCHEMA IF EXISTS sales CASCADE;
3035
CREATE SCHEMA sales;
3136

3237
create table sales.categories (

learn-pr/azure-databases/postgresql/basic-sql-simple-select/includes/3-querying-columns-distinct.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
## Querying all columns from a table
22

33
```sql
4-
SELECT * FROM sales.customers;
4+
SELECT *
5+
FROM sales.customers;
56
```
67

78
This query retrieves all rows and columns from the `sales.customers` table. However, querying all columns isn't required and is a costly operation. For best performance, only select the necessary columns.
@@ -11,15 +12,17 @@ Selecting specific columns is more efficient because it reduces the amount of da
1112
## Querying specific columns
1213

1314
```sql
14-
SELECT customer_name, city, country FROM sales.customers;
15+
SELECT customer_name, city, country
16+
FROM sales.customers;
1517
```
1618

1719
This query retrieves only the `customer_name`, `city`, and `country` columns from the `sales.customers` table.
1820

1921
## Querying distinct values
2022

2123
```sql
22-
SELECT DISTINCT country FROM sales.customers;
24+
SELECT DISTINCT country
25+
FROM sales.customers;
2326
```
2427

2528
The `DISTINCT` keyword in SQL is used to ensure that the result of a query contains only unique values for a specified column or combination of columns, eliminating any duplicate entries.

learn-pr/azure-databases/postgresql/basic-sql-where-clause-subqueries/includes/2-sample-database-overview.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,15 @@ Foreign keys are a concept in relational databases, used to establish and enforc
2323

2424
## Sample database creation script
2525

26+
To create the sales database, insert the following script into a query, and run it.
27+
Select Refresh to ensure the Explorer panel is up to date.
28+
Note that this can take a minute.
29+
2630
<details>
2731
<summary>Select to expand</summary>
2832

2933
```sql
34+
--DROP SCHEMA IF EXISTS sales CASCADE;
3035
CREATE SCHEMA sales;
3136

3237
create table sales.categories (

learn-pr/azure/analyze-costs-create-budgets-azure-cost-management/1-introduction.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ metadata:
66
title: Introduction
77
description: Introduction
88
ms.date: 10/22/2024
9-
author: bandersmsft
10-
ms.author: banders
9+
author: tonyafehr
10+
ms.author: tfehr
1111
ms.topic: unit
1212

1313
durationInMinutes: 2

0 commit comments

Comments
 (0)