Edw Or Lab.docx

  • November 2019
  • PDF

This document was uploaded by user and they confirmed that they have the permission to share it. If you are author or own the copyright of this book, please report to us by using this DMCA report form. Report DMCA


Overview

Download & View Edw Or Lab.docx as PDF for free.

More details

  • Words: 381
  • Pages: 3
drop table fact ; drop table Region; drop table TimePeriod ; drop table CarCode ; CREATE TABLE Region ( StateName varchar(30), RegionName varchar(30) not null, CONSTRAINT pk1 PRIMARY KEY (StateName) ); INSERT INTO Region VALUES ('Casa','OUEST'); INSERT INTO Region VALUES ('Rabat','OUEST'); INSERT INTO Region VALUES ('Oujda','EST'); INSERT INTO Region VALUES ('Marrakech','South'); INSERT INTO Region VALUES ('Tanger','North');

CREATE TABLE TimePeriod ( datee date, CONSTRAINT pk2 PRIMARY KEY(datee) );

INSERT INTO TimePeriod VALUES ('10-02-2012'); INSERT INTO TimePeriod VALUES ('02-03-2013'); INSERT INTO TimePeriod VALUES ('12-02-2013'); INSERT INTO TimePeriod VALUES ('10-06-2012'); INSERT INTO TimePeriod VALUES ('03-03-2013'); INSERT INTO TimePeriod VALUES ('12-02-2012'); INSERT INTO TimePeriod VALUES ('10-02-2013'); INSERT INTO TimePeriod VALUES ('02-07-2013'); INSERT INTO TimePeriod VALUES ('12-09-2012'); INSERT INTO TimePeriod VALUES ('11-02-2012'); INSERT INTO TimePeriod VALUES ('02-04-2013');

INSERT INTO TimePeriod VALUES ('12-01-2012'); INSERT INTO TimePeriod VALUES ('10-10-2012'); INSERT INTO TimePeriod VALUES ('02-11-2012'); INSERT INTO TimePeriod VALUES ('11-02-2013');

CREATE TABLE CarCode ( CarCode varchar(30) not null, CarName varchar(30) not null, CaraType varchar(30) not null, CONSTRAINT pk3 PRIMARY KEY (CarCode) ); INSERT INTO CarCode VALUES (1, 'Peugeot', 'Diesel'); INSERT INTO CarCode VALUES (2, 'Peugeot', 'Essence'); INSERT INTO CarCode VALUES (3, 'Dacia', 'Diesel'); INSERT INTO CarCode VALUES (4, 'Dacia', 'Essence'); INSERT INTO CarCode VALUES (5, 'Hundai', 'Essence'); CREATE TABLE Fact( idFact int NOT NULL, CarCode varchar(30) not null, YearName date not null, stateName varchar(30) not null, nmbre int not null, CONSTRAINT pk4 PRIMARY KEY (idFact), CONSTRAINT fk1 FOREIGN KEY (CarCode) REFERENCES CarCode(CarCode), CONSTRAINT fk2 FOREIGN KEY (YearName) REFERENCES TimePeriod(datee), CONSTRAINT fk3 FOREIGN KEY (StateName) REFERENCES Region(StateName) ); insert into Fact Values (1,1, '10-02-2012','Oujda' ,100 ) ; insert into Fact Values (2,3, '02-03-2013','Rabat' ,39 ) ; insert into Fact Values (3,4, '12-02-2013','Casa' ,91) ; insert into Fact Values (4,2, '10-06-2012','Tanger' ,22 ) ;

insert into Fact Values (5,3, '03-03-2013','Tanger' ,54 ) ; insert into Fact Values (6,5, '12-02-2012','Oujda' ,35 ) ; insert into Fact Values (7,4, '10-02-2013','Rabat' ,29 ) ; insert into Fact Values (8,2, '02-07-2013','Casa' ,19 ) ; insert into Fact Values (9,1, '12-09-2012','Tanger' ,55 ) ; insert into Fact Values (10,2,'10-02-2012','Marrakech' ,66 ) ; insert into Fact Values (11,1, '02-04-2013','Oujda' ,77 ) ; insert into Fact Values (12,2, '12-01-2012','Rabat' ,32 ) ; insert into Fact Values (13,3, '10-10-2012','Casa' ,43 ) ; insert into Fact Values (14,4, '02-11-2012','Tanger' ,52 ) ; insert into Fact Values (15,4,'11-02-2013','Marrakech' ,47 ) ;

Related Documents

Edw Or Lab.docx
November 2019 0
Edw-bi
April 2020 7
Cimatron Disegno Edw
June 2020 3
Edw Pou Zoume
July 2020 2
Or
October 2019 36
Or
June 2020 11