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



Similar documents
--- Vincent Hamel, hamv

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

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

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

Oracle Database 10g Express

Oracle 10g PL/SQL Training

5. CHANGING STRUCTURE AND DATA

Using SQL Server Management Studio

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

Programming with SQL

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

SQL DATA DEFINITION: KEY CONSTRAINTS. CS121: Introduction to Relational Database Systems Fall 2015 Lecture 7

How To Create A Table In Sql (Ahem)

Extracting META information from Interbase/Firebird SQL (INFORMATION_SCHEMA)

OLH: Oracle Loader for Hadoop OSCH: Oracle SQL Connector for Hadoop Distributed File System (HDFS)

SQL NULL s, Constraints, Triggers

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

EECS 647: Introduction to Database Systems

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

The Relational Model. Why Study the Relational Model?

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

The Relational Model. Why Study the Relational Model? Relational Database: Definitions

Oracle Database 10g: Introduction to SQL

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

Handling Exceptions. Copyright 2006, Oracle. All rights reserved. Oracle Database 10g: PL/SQL Fundamentals 8-1

Oracle Database 12c: Introduction to SQL Ed 1.1

Handling Exceptions. Schedule: Timing Topic. 45 minutes Lecture 20 minutes Practice 65 minutes Total

Review your answers, feedback, and question scores below. An asterisk (*) indicates a correct answer.

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

AUTHENTICATION... 2 Step 1:Set up your LDAP server... 2 Step 2: Set up your username... 4 WRITEBACK REPORT... 8 Step 1: Table structures...

Costing In Oracle HRMS CONCEPTS

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

Topics Advanced PL/SQL, Integration with PROIV SuperLayer and use within Glovia

Oracle Database: SQL and PL/SQL Fundamentals

Oracle For Beginners Page : 1

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

Oracle For Beginners Page : 1

Oracle PL/SQL Parameters, Variables, and Views

StreamServe Persuasion SP5 Oracle Database

Oracle Database: SQL and PL/SQL Fundamentals NEW

Monitoring Audit Trails Using Enterprise Manager

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

When an exception occur a message which explains its cause is received. PL/SQL Exception message consists of three parts.

5.1 Database Schema Schema Generation in SQL

Procedural Extension to SQL using Triggers. SS Chung

Table Backup and Recovery using SQL*Plus

Lecture 6. SQL, Logical DB Design

3.GETTING STARTED WITH ORACLE8i

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

VARRAY AND NESTED TABLE

Handling Exceptions. Copyright 2008, Oracle. All rights reserved.

Duration Vendor Audience 5 Days Oracle End Users, Developers, Technical Consultants and Support Staff

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

SQL Server An Overview


OBJECT ORIENTED EXTENSIONS TO SQL

1 Changes in this release

The Relational Model. Ramakrishnan&Gehrke, Chapter 3 CS4320 1

Oracle Data Miner (Extension of SQL Developer 4.0)

Recognizing PL/SQL Lexical Units. Copyright 2007, Oracle. All rights reserved.

Programming Database lectures for mathema

Normal Form vs. Non-First Normal Form

Physical Database Design Process. Physical Database Design Process. Major Inputs to Physical Database. Components of Physical Database Design

Review: Participation Constraints

CSC 443 Data Base Management Systems. Basic SQL

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

Data Modeling. Database Systems: The Complete Book Ch ,

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

Databasesystemer, forår 2005 IT Universitetet i København. Forelæsning 3: Business rules, constraints & triggers. 3. marts 2005

TIM 50 - Business Information Systems

Instant SQL Programming

HP Quality Center. Upgrade Preparation Guide

The Relational Model. Why Study the Relational Model? Relational Database: Definitions. Chapter 3

Databases What the Specification Says

Oracle Database: Introduction to SQL

COMS20700 DATABASES 13 PL/SQL. COMS20700 Databases Dr. Essam Ghadafi

Oracle. Brief Course Content This course can be done in modular form as per the detail below. ORA-1 Oracle Database 10g: SQL 4 Weeks 4000/-

14 Triggers / Embedded SQL

Oracle Database: Introduction to SQL

SQL Object Level Recovery Native 1.1

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

Graham Kemp (telephone , room 6475 EDIT) The examiner will visit the exam room at 15:00 and 17:00.

ORACLE 10g Lab Guide

Faculty of Engineering and Architecture. Computer Engineering Department DATABASE MANAGEMENT SYSTEMS POSTLAB #3 SOLUTION

HOUG Konferencia Oracle TimesTen In-Memory Database and TimesTen Application-Tier Database Cache. A few facts in 10 minutes

1. INTRODUCTION TO RDBMS

Virtual Private Database Features in Oracle 10g.

MySQL for Beginners Ed 3

Oracle For Beginners Page : 1

Managing Objects with Data Dictionary Views. Copyright 2006, Oracle. All rights reserved.

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

Database Design and Implementation

Writing Control Structures

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

Performance Tuning for the Teradata Database

The Sins of SQL Programming that send the DB to Upgrade Purgatory Abel Macias. 1 Copyright 2011, Oracle and/or its affiliates. All rights reserved.

Transcription:

-------------------------------------------------- -- c est une base de doonnees qui permet de gerer-- -- les vols d une compagnie aerienne-------------- --Victor Kimenyi, 13042806------------------------ -- Petar Zubac, 14077722------------------------ -------------------------------------------------- drop table aeroport cascade constraints; create table aeroport ( codeaeroport char(4) NOT NULL, ville VARCHAR(10) NOT NULL, etat varchar(10) NOT NULL, nom varchar(50) NOT NULL, CONSTRAINT PKaeroportCode PRIMARY KEY (codeaeroport), CONSTRAINT Uairport unique (codeaeroport,ville,etat,nom) DROP TABLE Vol cascade constraints; create table Vol ( No_Vol VARCHAR(8), typedevol VARCHAR(9) NOT NULL, constraint PKnbrVol primary key (No_vol) DROP TABLE segmentdevol CASCADE CONSTRAINTS; CREATE TABLE segmentdevol( No_vol numeric(9) NOT NULL, No_Segment numeric(9) NOT NULL, Code_aeroport_Depart VARCHAR(4), Code_aeroport_arrivee VARCHAR(4), Date_heure_depart TIMESTAMP NOT NULL, Date_heure_arrivee TIMESTAMP NOT NULL, constraint Usegment UNIQUE (No_vol,No_Segment,Code_aeroport_Depart, Code_aeroport_arrivee,Date_heure_depart, Date_heure_arrivee), constraint FKnbrVoL foreign key (no_vol) REFERENCES Vol DROP TABLE classe CASCADE CONSTRAINTS; CREATE TABLE classe ( No_Class numeric(2), Description VARCHAR(12), CONSTRAINT PK_classe primary KEY (No_Class),

CONSTRAINT U_la_class unique (No_Class,Description) DROP TABLE classevol CASCADE CONSTRAINTS; CREATE TABLE classevol( No_Class numeric(2), No_Vol VARCHAR(8), Prix_de_vol numeric(7,2) constraint FK_vol_class foreign key (no_vol) references vol; constraint FK_class foreign key (no_class) references classe, constraint U_class_prix unique (no_class,prix_de_vol DROP TABLE Avion CASCADE CONSTRAINTS; CREATE TABLE Avion( No_Avion numeric(8), No_Modele numeric(9), date_achat date not null, CONSTRAINT PK_Avion primary KEY (No_Avion), CONSTRAINT Uplane unique (No_Avion,No_Modele) DROP TABLE AvionVol CASCADE CONSTRAINTS; CREATE TABLE AvionVol ( No_Vol VARCHAR(8), No_Avion numeric(8), CONSTRAINT FKAvionVol_1 foreign key (No_Vol) REFERENCES vol, CONSTRAINT FKAvion_2 foreign key (No_Avion) REFERENCES Avion, constraint U_vol_avion unique (no_vol,no_avion) 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 (NO_AVION,NO_MODELE,DATE_ACHAT) values (1, boeing 747, 2010-09-08 insert into avion (NO_AVION,NO_MODELE,DATE_ACHAT) values (2, AIRBUS A380, 2011-09-01 insert into avion (NO_AVION,NO_MODELE,DATE_ACHAT) values (3, AIRBUS A340, 2012-08-01 insert into VOL (NO_VOL,TYPEDEVOL) values ( AC2001, regulier

insert into VOL (NO_VOL,TYPEDEVOL) values ( AC2002, NOLISE DATE_HEURE_DEPART,DATE_HEURE_ARRIVEE) values ( AC2001,2, yyz, cdg,timestamp 2014-01-02 14:00:00,timestamp 2014-01-03 07:00:00 DATE_HEURE_DEPART,DATE_HEURE_ARRIVEE) values ( AC2001,1, YUL, YYZ,timestamp 2014-01-02 13:00:00,timestamp 2014-01-02 14:00:00 insert into classe (NO_CLASS,DESCRIPTION) values(1, affaire insert into classe (NO_CLASS,DESCRIPTION) values(2, economique insert into classevol (NO_CLASS,NO_VOL,prix_de_vol) values(1, AC2001,1010.02 insert into classevol (NO_CLASS,NO_VOL,prix_de_vol) values(2, AC2001,300.03 values( AC2001,1 values( AC2002,2 update aeroport set etat= quebec where etat= qc ; update CLASSEVOL set prix_de_vol=prix_de_vol2 where no_class = 1; delete from AVION where no_modele= AIRBUS A340 ;

SQLPlus: Release 11.2.0.2.0 Production on Mon Sep 29 11:20:48 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 segmentdevol CASCADE CONSTRAINTS constraint FKnbrVoL foreign key (no_vol) REFERENCES Vol ERROR at line 11: ORA-02267: column type incompatible with referenced column type DROP TABLE classe CASCADE CONSTRAINTS

DROP TABLE classevol CASCADE CONSTRAINTS constraint FK_vol_class foreign key (no_vol) references vol ERROR at line 5: ORA-02253: constraint specification not allowed here SP2-0734: unknown command beginning "constraint..." - rest of line ignored. SP2-0734: unknown command beginning "constraint..." - rest of line ignored. SP2-0042: unknown command ")" - rest of line ignored. DROP TABLE Avion CASCADE CONSTRAINTS DROP TABLE AvionVol CASCADE CONSTRAINTS

values (1, boeing 747, 2010-09-08 ) ERROR at line 2: ORA-01722: invalid number values (2, AIRBUS A380, 2011-09-01 ) ERROR at line 2: ORA-01722: invalid number values (3, AIRBUS A340, 2012-08-01 ) ERROR at line 2: ORA-01722: invalid number

insert into classevol (NO_CLASS,NO_VOL,prix_de_vol) insert into classevol (NO_CLASS,NO_VOL,prix_de_vol) ORA-02291: integrity constraint (IFT187_99.FKAVION_2) violated - parent key not found ORA-02291: integrity constraint (IFT187_99.FKAVION_2) violated - parent key not found 1 row updated. update CLASSEVOL 0 rows deleted. Disconnected from Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options