Files
sql/README.md

34 lines
928 B
Markdown
Raw Normal View History

2025-08-28 10:38:03 +02:00
### Construire l'image
2025-08-26 07:55:29 +02:00
2025-08-28 10:38:03 +02:00
```shell
2025-10-06 22:08:23 +02:00
docker build -t iut/pgsql:2025-12 .
2025-08-26 07:55:29 +02:00
```
2025-08-28 10:38:03 +02:00
## Données
2025-08-26 07:55:29 +02:00
2025-09-01 07:56:13 +02:00
### Conventions de nommage
Le nom des tables est au singulier et en minuscule
2025-08-28 10:38:03 +02:00
### Schéma
2025-08-26 07:55:29 +02:00
2025-09-01 07:56:13 +02:00
table |colonnes
--- |---
adherent | id, nom, prenom, genre, naissance, codepostal
2025-09-12 12:54:16 +02:00
famille | code, famille, code_parent, arborescence (ltree), gauche, droite
2025-09-01 07:56:13 +02:00
article | code, article, famille_code, factpoids, prix
ticket | id, date_ticket, adherent_id, mode_rglt
ligne | id, ticket_id, article_code, prix_unitaire, quantite
2025-08-29 22:12:55 +02:00
### Export
```shell
psql -h 127.0.0.1 -d sql -U sql -c "\copy (select * from ligne order by id) to './ligne.csv' with csv header"
2025-09-06 06:42:27 +02:00
psql -h 127.0.0.1 -d sql -U sql -c "\copy (select id, source, target, cost, reverse_cost, ST_AsText(geom) from route order by id) to './route.csv' with csv header"
2025-08-29 22:12:55 +02:00
```
2025-09-14 17:46:21 +02:00
### Jeux de données
- https://www.kaggle.com/datasets/alexandrelemercier/food-detailed-nutritional-content