This commit is contained in:
2025-11-08 13:10:09 +01:00
parent a556cf3657
commit 1bd6f6e6ec

View File

@@ -389,8 +389,8 @@ erDiagram
account_holder ||--|{ account : hold
currency ||--|{ account : tenu
exchange_rate }o--|| currency : a
transaction }o--|| operation : contient
operation }o--|| account : concerne
transaction ||--|{ operation : a
operation }o--|| account : a
```
---
@@ -403,6 +403,33 @@ Voir la syntaxe de [postgreSQL](syntaxe.md)
### 1. Titulaires
Création de la table `holder`.
```sql
create table holder (
"id" bigint primary key generated always as identity,
"type" text,
"created_at" timestamp
);
```
- entier sur 64 bits : `bigint`
- clé primaire : `primary key`
- incrément automatique : `generated always as identity`
Création de la table `person`.
```sql
create table person (
"id" bigint primary key references holder(id),
"firstname" text,
"lastname" text,
"birthdate" date
);
```
- Créer un compte individuel pour _Françoise Zanetti_, née le 12 avril 1995.
- Créer une entreprise nommée _Boulangerie de Valorgue_, créée le 19 août 2014, numéro dimmatriculation FR19803269968.
- Ajouter un nouveau titulaire : _Justin Hébrard_ né le 11/03/1993.