-- journaux_td2.sql

DROP TABLE JOURNAL;
CREATE TABLE JOURNAL( 
  CODE_J  integer,
  TITRE   varchar2(14),
  PRIX    float,
  TYPE    varchar2(7),
  PERIODE varchar2(9),
  ADR_J   varchar2(9));
 
DROP TABLE DEPOT;
CREATE TABLE DEPOT(
  N_DEP   integer,
  NOM_DEP varchar2(16),
  ADR     varchar2(9));
 
DROP TABLE LIVRAISON;
CREATE TABLE LIVRAISON(
  N_DEP   integer,
  CODE_J  integer,
  DATE_L  date,
  QTE_L   integer,
  QTE_R   integer);

INSERT INTO JOURNAL values (115, 'LIBERATION',      4.5, 'INFO',    'QUOTIDIEN', 'PARIS');
INSERT INTO JOURNAL values (110, 'LE MONDE',        4.5, 'INFO',    'QUOTIDIEN', 'PARIS');
INSERT INTO JOURNAL values (120, 'LA RECHERCHE',   32.0, 'SCIENCE', 'MENSUEL',   'PARIS');
INSERT INTO JOURNAL values (160, 'ELLE',           15.0, 'FEMININ', 'HEBDO',     'MONTROUGE');
INSERT INTO JOURNAL values (165, 'LE POINT',       20.0, 'INFO',    'HEBDO',     'PARIS');
INSERT INTO JOURNAL values (156, 'SCIENCE ET VIE', 20.0, 'SCIENCE', 'MENSUEL',   'PARIS');
INSERT INTO JOURNAL values (184, 'LE NOUVEL OBS',  20.0, 'INFO',    'HEBDO',     'PARIS');
INSERT INTO JOURNAL values (194, 'MARIE CLAIRE',   15.0, 'FEMININ', 'MENSUEL',   'MONTROUGE');
INSERT INTO JOURNAL values (142, 'TELERAMA',       15.0, 'TELE',    'HEBDO',     'MONTROUGE');
INSERT INTO JOURNAL values (145, 'TELE 7 JOURS',   15.0, 'TELE',    'HEBDO',     'PARIS ');
INSERT INTO JOURNAL values (147, 'LE FIGARO',       5.0, 'INFO',    'QUOTIDIEN', 'PARIS');
INSERT INTO JOURNAL values (153, 'LE CANARD',      20.0,  NULL ,    'HEBDO',     'MONTROUGE');
INSERT INTO JOURNAL values (149, 'L EXPRESS',      20.0, 'INFO',    'HEBDO',     'PARIS');
 
INSERT INTO  DEPOT values (345, 'CAFE LE FONTENAY', 'BURES');
INSERT INTO  DEPOT values (328, 'LE MOZARD',        'PARIS');
INSERT INTO  DEPOT values (310, 'CAFE DE LA GARE',  'BURES');
INSERT INTO  DEPOT values (325, 'CAFE DU COMMERCE', 'ORSAY');
INSERT INTO  DEPOT values (378, 'TABAC DU CENTRE',  'LIMOURS');
INSERT INTO  DEPOT values (311, 'CAFE DE PARIS',    'ARCUEIL');
INSERT INTO  DEPOT values (324, 'PRESSE_CITY',      'PARIS');
INSERT INTO  DEPOT values (365, 'CAFE DES AMIS',    'PARIS');
INSERT INTO  DEPOT values (357, 'CAFE DE LA GARE',  'PARIS');
INSERT INTO  DEPOT values (379, 'LES BRASSEURS',    'PARIS');
INSERT INTO  DEPOT values (381, 'L''AVENTURE',      'BREUILLET');
 
INSERT INTO  LIVRAISON values (345, 115, to_date(124,'DDD'), 40,  2);
INSERT INTO  LIVRAISON values (345, 110, to_date(125,'DDD'), 48,  1);
INSERT INTO  LIVRAISON values (345, 165, to_date(125,'DDD'), 10,  2);
INSERT INTO  LIVRAISON values (328, 115, to_date(126,'DDD'), 10,  1);
INSERT INTO  LIVRAISON values (328, 110, to_date(125,'DDD'), 20,  0);
INSERT INTO  LIVRAISON values (310, 165, to_date(121,'DDD'), 24,  3);
INSERT INTO  LIVRAISON values (310, 142, to_date(121,'DDD'), 50,  5);
INSERT INTO  LIVRAISON values (379, 165, to_date(100,'DDD'), 100, 4);
INSERT INTO  LIVRAISON values (328, 110, to_date(100,'DDD'), 30,  1);
INSERT INTO  LIVRAISON values (310, 165, to_date(100,'DDD'), 50,  5);
INSERT INTO  LIVRAISON values (379, 115, to_date(116,'DDD'), 44,  0);
INSERT INTO  LIVRAISON values (379, 110, to_date(110,'DDD'), 40,  0);
INSERT INTO  LIVRAISON values (379, 165, to_date(121,'DDD'), 80,  0);
INSERT INTO  LIVRAISON values (328, 110, to_date(102,'DDD'), 30,  3);
INSERT INTO  LIVRAISON values (328, 194, to_date(025,'DDD'), 12,  1);
INSERT INTO  LIVRAISON values (324, 194, to_date(054,'DDD'), 10,  2);
INSERT INTO  LIVRAISON values (365, 194, to_date(064,'DDD'), 25,  0);
INSERT INTO  LIVRAISON values (357, 194, to_date(067,'DDD'), 18,  3);
INSERT INTO  LIVRAISON values (379, 194, to_date(098,'DDD'), 15,  4);
INSERT INTO  LIVRAISON values (381, 115, to_date(024,'DDD'), 20,  0);
INSERT INTO  LIVRAISON values (381, 120, to_date(025,'DDD'), 25,  0);
INSERT INTO  LIVRAISON values (381, 160, to_date(026,'DDD'), 24,  0);
INSERT INTO  LIVRAISON values (381, 165, to_date(023,'DDD'), 20,  0);
INSERT INTO  LIVRAISON values (381, 156, to_date(025,'DDD'), 25,  0);
INSERT INTO  LIVRAISON values (381, 184, to_date(098,'DDD'), 30,  1);
INSERT INTO  LIVRAISON values (381, 194, to_date(024,'DDD'), 10,  0);
INSERT INTO  LIVRAISON values (381, 142, to_date(053,'DDD'), 50,  4);
INSERT INTO  LIVRAISON values (381, 145, to_date(029,'DDD'), 10,  0);
INSERT INTO  LIVRAISON values (381, 147, to_date(023,'DDD'), 20,  0);
INSERT INTO  LIVRAISON values (381, 153, to_date(023,'DDD'), 20,  0);
INSERT INTO  LIVRAISON values (381, 149, to_date(053,'DDD'), 40,  4);
INSERT INTO  LIVRAISON values (381, 110, to_date(023,'DDD'), 20,  0);

