/*
CREATE DATABASE DB_TEST_LIVRE_SQL_SYNTHESE;
GO

USE DB_TEST_LIVRE_SQL_SYNTHESE;;
GO

CREATE SCHEMA S_PRS;
GO
*/

CREATE TABLE S_PRS.T_PERSONNE_GENERIQUE_PSG
(PSG_ID              INTEGER PRIMARY KEY,
 PSG_DATE_CREATION   DATE NOT NULL);

CREATE TABLE S_PRS.T_PERSONNE_PHYSIQUE_PSP
(PSG_ID              INTEGER PRIMARY KEY 
    REFERENCES S_PRS.T_PERSONNE_GENERIQUE_PSG(PSG_ID),
 PSP_NOM             VARCHAR(32) NOT NULL,
 PSP_PRENOM          VARCHAR(25),
 PSP_DATE_NAISSANCE  DATE);

CREATE TABLE S_PRS.T_PERSONNE_MORALE_PSM
(PSG_ID              INTEGER PRIMARY KEY 
    REFERENCES S_PRS.T_PERSONNE_GENERIQUE_PSG(PSG_ID),
 PSM_RAISON_SOCIALE  VARCHAR(256) NOT NULL,
 PSM_ENSEIGNE        VARCHAR(64),
 PSM_SIRET           CHAR(14) NOT NULL UNIQUE);
