--- Vincent Hamel, hamv2701 14 162 988



Similar documents
--Nom: Laurent Senécal-Léonard

constraint PKnbrVol primary key (No_vol) ); DROP TABLE segmentdevol CASCADE CONSTRAINTS; CREATE TABLE segmentdevol( numeric(9) NOT NULL,

Modifier le texte d'un élément d'un feuillet, en le spécifiant par son numéro d'index:

A basic create statement for a simple student table would look like the following.

!"# $ %& '( ! %& $ ' &)* + ! * $, $ (, ( '! -,) (# *&23. mysql> select * from from clienti;

Extracting META information from Interbase/Firebird SQL (INFORMATION_SCHEMA)

RAPPORT FINANCIER ANNUEL PORTANT SUR LES COMPTES 2014

SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO";! SET time_zone = "+00:00";!

Oracle PL/SQL Language. CIS 331: Introduction to Database Systems

Oracle 10g PL/SQL Training

Corrigés des exercices SQL pour MySQL

Programming Database lectures for mathema

How To Create A Table In Sql (Ahem)

Programming with SQL

5.1 Database Schema Schema Generation in SQL

Using SQL Server Management Studio

Oracle Database 12c: Introduction to SQL Ed 1.1

CURRICULUM VITAE. York University, professional diploma in business valuation, 1st in Canada in the corporate finance course ( )

Oracle Database: SQL and PL/SQL Fundamentals

Unifying the Global Data Space using DDS and SQL

Database Management Systems Comparative Study: Performances of Microsoft SQL Server Versus Oracle

Oracle Database 10g Express

CSI 2132 Lab 3. Outline 09/02/2012. More on SQL. Destroying and Altering Relations. Exercise: DROP TABLE ALTER TABLE SELECT

VIREMENTS BANCAIRES INTERNATIONAUX

Chapter 5 More SQL: Complex Queries, Triggers, Views, and Schema Modification

Oracle Database 10g: Introduction to SQL

Privacy and Security Risk Management Framework

Oracle Database: SQL and PL/SQL Fundamentals NEW

11520 Alberta CALGARY Nova Scotia / Nouvelle-Écosse HALIFAX Quebec / Québec MONTREAL Ontario OTTAWA

Advance DBMS. Structured Query Language (SQL)

Conventional Files versus the Database. Files versus Database. Pros and Cons of Conventional Files. Pros and Cons of Databases. Fields (continued)

CSC 443 Data Base Management Systems. Basic SQL

TP JSP : déployer chaque TP sous forme d'archive war

SQL Programming. CS145 Lecture Notes #10. Motivation. Oracle PL/SQL. Basics. Example schema:

VIREMENTS BANCAIRES INTERNATIONAUX

Product / Produit Description Duration /Days Total / Total

5. CHANGING STRUCTURE AND DATA

SQL Databases Course. by Applied Technology Research Center. This course provides training for MySQL, Oracle, SQL Server and PostgreSQL databases.

PL/SQL (Cont d) Let s start with the mail_order database, shown here:

Optimizing the Performance of the Oracle BI Applications using Oracle Datawarehousing Features and Oracle DAC

If you have not multiplexed your online redo logs, then you are only left with incomplete recovery. Your steps are as follows:

SQL NULL s, Constraints, Triggers

In This Lecture. SQL Data Definition SQL SQL. Notes. Non-Procedural Programming. Database Systems Lecture 5 Natasha Alechina

MENDELSSOHN CUSTOMS AND TRANSPORTATION SERVICES MENDELSSOHN SERVICES EN DOUANE ET EN TRANSPORT

SQL Server An Overview

PostGIS Integration Tips

Schema Evolution in SQL-99 and Commercial (Object-)Relational DBMS

Linas Virbalas Continuent, Inc.

OBJECT ORIENTED EXTENSIONS TO SQL

Thursday, February 7, DOM via PHP

Travel information. The link to the complete bus map of Nice is

Database Extensions Visual Walkthrough. PowerSchool Student Information System

TREATIES AND OTHER INTERNATIONAL ACTS SERIES Agreement Between the UNITED STATES OF AMERICA and CONGO

Chapter 6: Physical Database Design and Performance. Database Development Process. Physical Design Process. Physical Database Design

ISO NEWSLETTER VI-12

Below is a table called raw_search_log containing details of search queries. user_id INTEGER ID of the user that made the search.

Database Migration from MySQL to RDM Server

MANITOBA TRADE AND INVESTMENT CORPORATION ANNUAL REPORT 2012/13 SOCIÉTÉ DU COMMERCE ET DE L'INVESTISSEMENT DU MANITOBA RAPPORT ANNUEL 2012/13

Measuring Firebird Disc I/O

Oracle Database: Introduction to SQL

4 Simple Database Features

Guide to SQL Programming: SQL:1999 and Oracle Rdb V7.1

Garden City Public Schools Garden City, New York

«Object-Oriented Multi-Methods in Cecil» Craig Chambers (Cours IFT6310, H08)

Guide to Upsizing from Access to SQL Server

Oracle Database: Introduction to SQL

Sun Enterprise Optional Power Sequencer Installation Guide

K 4 Science References References

Retrieving Data Using the SQL SELECT Statement. Copyright 2006, Oracle. All rights reserved.

Enter a world class network WORLD TRADE CENTER LYON WORLD TRADE CENTER LYON WORLD TRADE CENTER LYON

N INDICES EURONEXT PARIS EURONEXT PARIS INDEXES

Oracle 12c New Features For Developers

Transactional Updates to Enterprise GIS data sets. Presented by: Kelly Ratchinsky PBC Countywide GIS Coordinator

TIM 50 - Business Information Systems

Copyright 2013 wolfssl Inc. All rights reserved. 2

MAURICE S PUBLISHED WORKS. (not a definitive list) (*indicates written with others ; **indicates adaptation of a speech)

Sun Management Center Change Manager Release Notes

Oracle 11g PL/SQL training


Note concernant votre accord de souscription au service «Trusted Certificate Service» (TCS)

Once the schema has been designed, it can be implemented in the RDBMS.

NOTES POUR L ALLOCUTION DE M

Solaris 10 Documentation README

Systèmes d'information et Management

Hubert de LA BRUSLERIE

Note: The where clause of the SUBSET statement is sent "as is" to Oracle, so it must contain correct Oracle syntax.

ORACLE 9I / 10G / 11G / PL/SQL COURSE CONTENT

Enterprise Informa/on Modeling: An Integrated Way to Track and Measure Asset Performance

Transcription:

--- Vincent Hamel, hamv2701 14 162 988 ------------------------------------------------- drop table Aeroport cascade constraints; create table Aeroport ( codeaeroport varchar(20), ville varchar(20), etat varchar(20), nom varchar(20), constraint idaeroport primary key (codeaeroport), constraint idnom unique (nom) ); ------------------------------------------------- drop table Vol cascade constraints; create table Vol ( novol varchar(20), TypeDeVol varchar(20) check (TypeDeVol in ( régulier, nolisé )), constraint idnovol primary key (novol) ); ------------------------------------------------- drop table Classe cascade constraints; create table Classe( noclasse smallint not null, description varchar(20), constraint idnoclasse primary key (noclasse) ); ------------------------------------------------- drop table Avion cascade constraints; create table Avion ( noavion smallint not null, nomodele varchar(20), dateachat date, --- pas de time en oracle constraint idnoavion primary key (noavion) );

------------------------------------------------- drop table ClasseVol cascade constraints; create table ClasseVol ( noclasse smallint not null, novol varchar(20), prix numeric(9,2) not null, constraint idclassevol primary key (noclasse,novol), constraint prixnonneg check (prix>0 or prix=0), constraint novol_fk_vol foreign key (novol) references Vol, constraint noclasse_fk_noclasse foreign key (noclasse) references Classe ); ------------------------------------------------- drop table SegmentsDeVol cascade constraints; create table SegmentsDeVol ( novol varchar(20), nosegment integer not null, codeaeroportdepart varchar(20), codeaeroportarrivee varchar(20), dateheureprevuedepart timestamp, --- pas de time en oracle dateheureprevuearrivee timestamp, --- pas de time en oracle constraint idsegmentsdevol primary key (novol,nosegment), constraint novol_fk_vol2 foreign key (novol) references Vol, constraint codeaerodepart_fk_aeroport foreign key (codeaeroportdepart) references Aeroport, constraint codeaeroarrivee_fk_aeroport foreign key (codeaeroportarrivee) references Aeroport ); --constraint Depart_Avant_Arrivee check (dateheureprevuedepart > dateheureprevuearrivee) syntaxe? ------------------------------------------------- drop table AvionVol cascade constraints; create table AvionVol ( no_vol varchar(20), noavion smallint not null, constraint idavionvol primary key (no_vol,noavion), constraint novol_fk_vol3 foreign key (no_vol) references Vol, constraint noavion_fk_avion foreign key (noavion) references Avion );

------------------------------------------------- --- parti 3.1 insérer les valeur dans les tables insert into Aeroport (codeaeroport, ville, etat, nom) values ( YUL, Montreal, QC, Trudeau ); insert into Aeroport (codeaeroport, ville, etat, nom) values ( YYZ, Toronto, ON, Pearson ); insert into Aeroport (codeaeroport, ville, etat, nom) values ( CDG, Paris, FR, Charles-de-Gaulle ); insert into Avion (noavion, nomodele, dateachat) values (1, Boeing747,date 2010-09-08 ); insert into Avion (noavion, nomodele, dateachat) values (2, Airbus A380,date 2011-09-01 ); insert into Avion (noavion, nomodele, dateachat) values (3, Airbus A340, date 2012-08-01 ); insert into Vol (novol, typedevol) values ( AC2001, régulier ); insert into Vol (novol, typedevol) values ( AC2002, nolisé ); insert into SegmentsDeVol (novol,nosegment,codeaeroportdepart,codeaeroportarrivee,dateheureprevuedepart,dateheurepr evuearrivee) values ( AC2001,1, YUL, YYZ,timestamp 2014-01-02 13:00:00,timestamp 2014-01-02 14:00:00 ); insert into SegmentsDeVol (novol,nosegment,codeaeroportdepart,codeaeroportarrivee,dateheureprevuedepart,dateheurepr evuearrivee) values ( AC2001,2, YYZ, CDG,timestamp 2014-01-02 14:00:00,timestamp 2014-01-03 07:00:00 ); insert into Classe (noclasse,description) values (1, affaires ); insert into Classe (noclasse,description) values (2, économique ); insert into classevol (noclasse,novol,prix) values (1, AC2001,1010.02); insert into classevol (noclasse,novol,prix) values (2, AC2001,300.03); insert into avionvol (no_vol,noavion) values ( AC2001,1); insert into avionvol (no_vol,noavion) values ( AC2002,2); --- Parti 3.2 change la province QC pour QUEBEC dans tous les aéroports update Aeroport set etat= Quebec where etat= QC ; --- Parti 3.3 double le prix des vols en classe Affaires update ClasseVol set prix=prix2 where noclasse=1;

--- Parti 3.4 Supprime les avions contenant Airbus A340 dans leur modele Delete from Avion where nomodele= Airbus A340 ; SQLPlus: Release 11.2.0.2.0 Production on Mon Sep 29 11:21:19 2014 Copyright (c) 1982, 2010, Oracle. All rights reserved. Connected to: Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options début de test-tp1.sql PL/SQL procedure successfully completed. drop table Aeroport cascade constraints drop table Vol cascade constraints drop table Classe cascade constraints

drop table Avion cascade constraints drop table ClasseVol cascade constraints drop table SegmentsDeVol cascade constraints drop table AvionVol cascade constraints

1 row updated.

1 row updated. 1 row deleted. Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options