> For the complete documentation index, see [llms.txt](https://fanny.gitbook.io/server-postgresql-cda/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://fanny.gitbook.io/server-postgresql-cda/readme.md).

# SQL

Exercices PostgreSQL 18 réalisés dans le cadre de la formation **Simplon CDA**, par **Fanny Saez**.

Commandes psql essentielles : voir [aide-memoire/README.md](/server-postgresql-cda/aide-memoire.md).

Mémo complet de toutes les commandes utilisées (pourquoi, à quoi ça sert, sur quoi/qui) : voir [aide-memoire/memo-commandes.md](/server-postgresql-cda/aide-memoire/memo-commandes.md).

Trame pour présenter les 4 exercices à l'oral : voir [PRESENTATION.md](/server-postgresql-cda/presentation.md).

Documentation officielle PostgreSQL (référence, hors exercices) : voir [docs/05-documentation.md](/server-postgresql-cda/docs/05-documentation.md).

***

## Installation de PostgreSQL 18 (Windows)

| #  | Étape                                                                     | Contenu                                                                          |
| -- | ------------------------------------------------------------------------- | -------------------------------------------------------------------------------- |
| 01 | [Téléchargement](/server-postgresql-cda/docs/01-telechargement.md)        | Sources officielles (EDB, postgresql.org, docs.postgresql.fr), fichier à choisir |
| 02 | [Installation](/server-postgresql-cda/docs/02-installation.md)            | Assistant d'installation, première connexion SQL Shell (psql)                    |
| 03 | [Configuration](/server-postgresql-cda/docs/03-configuration.md)          | Commandes de repérage, chargement des scripts, erreurs fréquentes                |
| 04 | [Aide-mémoire des commandes](/server-postgresql-cda/docs/04-commandes.md) | Récap complet des commandes SQL Shell (psql) utilisées dans ce projet            |
| 05 | [Pour aller plus loin](/server-postgresql-cda/docs/05-documentation.md)   | Documentation officielle, support, suite du projet                               |

***

## Structure du projet

```
PostgreSQL/
├── aide-memoire/
│   ├── README.md
│   ├── glossaire.md
│   └── memo-commandes.md
├── docs/
│   ├── 01-telechargement.md
│   ├── 02-installation.md
│   ├── 03-configuration.md
│   ├── 04-commandes.md
│   ├── 05-documentation.md
│   └── img/
│       ├── installeur-postgresql-18.png
│       └── variables-environnement-path.webp
├── exercice1/
│   ├── README.md
│   └── sauvegarde_historique.sql
├── exercice2/
│   ├── README.md
│   ├── dictionnaires.sql
│   ├── donnees.sql
│   └── img/
│       ├── exercice2.png
│       ├── exercice2-verification.png
│       └── exercice2-test-cascade.png
├── exercice3/
│   ├── README.md
│   ├── fanny_data.sql
│   └── test_data.sql
├── exercice4/
│   ├── README.md
│   └── permissions.sql
├── PRESENTATION.md
└── README.md
```

***

## Exercices SQL

| # | Exercice                                                           | Contenu                                                         |
| - | ------------------------------------------------------------------ | --------------------------------------------------------------- |
| 1 | [Sauvegarde de la base](/server-postgresql-cda/exercice1.md)       | Dump `pg_dump` complet, restauration avec `\i`                  |
| 2 | [Clés étrangères + CASCADE](/server-postgresql-cda/exercice2.md)   | Ajout des clés étrangères, `ON DELETE CASCADE`, test complet    |
| 3 | [Jeu de données personnalisé](/server-postgresql-cda/exercice3.md) | 100 entrées par table, ID réservés (1 à 999), chargement propre |
| 4 | [Utilisateurs et permissions](/server-postgresql-cda/exercice4.md) | `CREATE USER`, `GRANT`/`REVOKE`, `DROP USER`, `\du`             |

***

<p align="center"><a href="/pages/5tiZg26tPgDVCEEh4lv8"><img src="https://img.shields.io/badge/-COMMENCER-0d8f91?style=for-the-badge" alt="Commencer"></a></p>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://fanny.gitbook.io/server-postgresql-cda/readme.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
