From 1bd6f6e6ecaf7fb792186d6e5555358635517328 Mon Sep 17 00:00:00 2001 From: medina5 Date: Sat, 8 Nov 2025 13:10:09 +0100 Subject: [PATCH] p --- banque.md | 31 +++++++++++++++++++++++++++++-- 1 file changed, 29 insertions(+), 2 deletions(-) diff --git a/banque.md b/banque.md index 263605b..f61e7ba 100644 --- a/banque.md +++ b/banque.md @@ -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 d’immatriculation FR19803269968. - Ajouter un nouveau titulaire : _Justin Hébrard_ né le 11/03/1993.