--Guillaume Couture coug1812. prompt question 1 prompt Select codeaeroport,novol,ville,nom,etat Aeroport,segmentdevol.

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

-- ROSE-MARIE BRISSON MATRICULE: MARIE-?VE BERTHIAUME MATRICULE: DROP TABLE VOL CASCADE CONSTRAINT; CREATE TABLE VOL (

--- Vincent Hamel, hamv

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

Oracle Database: SQL and PL/SQL Fundamentals

Oracle Database 10g: Introduction to SQL

2 Software requirements and installation

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

5. CHANGING STRUCTURE AND DATA

Chapter 9 Joining Data from Multiple Tables. Oracle 10g: SQL

Oracle Database 12c: Introduction to SQL Ed 1.1

Oracle Database: SQL and PL/SQL Fundamentals

Oracle 10g PL/SQL Training

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

Oracle Database 11g: SQL Tuning Workshop

Oracle Database: SQL and PL/SQL Fundamentals NEW


An Oracle White Paper March Integrating Oracle Database Vault with Oracle Application Express

Oracle USF

2. Oracle SQL*PLUS Winter Some SQL Commands. To connect to a CS server, do:

MySQL for Beginners Ed 3

Oracle For Beginners Page : 1

Oracle Database: Introduction to SQL

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

Backup Types. Backup and Recovery. Categories of Failures. Issues. Logical. Cold. Hot. Physical With. Statement failure

Oracle Database: SQL and PL/SQL Fundamentals NEW

Oracle SQL. Course Summary. Duration. Objectives

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

SAP BO Course Details

Oracle PL/SQL Injection

Oracle Database 11g: SQL Tuning Workshop Release 2

Copyright 2013 wolfssl Inc. All rights reserved. 2

TIM 50 - Business Information Systems

Installation and management of Oracle 11g Express Edition Release 2 2 July 2016

QA Tools (QTP, QC/ALM), ETL Testing, Selenium, Mobile, Unix, SQL, SOAP UI

CONNECTING PROGRAM FOR EUROPE QUESTIONS AND ANSWERS

Oracle Database Security and Audit

Transborder US Canada Roundtable

The First Example of TimesTen with Oracle on Windows

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

Oracle Database: Introduction to SQL

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/-

Oracle Database: Introduction to SQL

Guide to Performance and Tuning: Query Performance and Sampled Selectivity

ICAB4136B Use structured query language to create database structures and manipulate data

Oracle9i Data Warehouse Review. Robert F. Edwards Dulcian, Inc.

5.5 Copyright 2011 Pearson Education, Inc. publishing as Prentice Hall. Figure 5-2

Database Programming with PL/SQL: Learning Objectives

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

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

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

Oracle Database 11g SQL

Oracle Database 11 g Performance Tuning. Recipes. Sam R. Alapati Darl Kuhn Bill Padfield. Apress*

REPORT GENERATION USING SQL*PLUS COMMANDS

Persistent Stored Modules (Stored Procedures) : PSM

LearnFromGuru Polish your knowledge

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

Programming with SQL

Basic Import Utility User Guide

Costing In Oracle HRMS CONCEPTS

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.

Using SQL Queries to Insert, Update, Delete, and View Data: Joining Multiple Tables. Lesson C Objectives. Joining Multiple Tables

PUBLIC. How to Use in SAP Business One. Solutions from SAP. SAP Business One 2005 A SP01

Instant SQL Programming

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

Oracle Database 10g Express

Oracle Database 10g: Administration Workshop II Release 2

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

Oracle PL/SQL Parameters, Variables, and Views

Using RMAN to restore a database to another server in an ASM environment

Relational Database: Additional Operations on Relations; SQL

Using Temporary Tables to Improve Performance for SQL Data Services

Outline. SAS-seminar Proc SQL, the pass-through facility. What is SQL? What is a database? What is Proc SQL? What is SQL and what is a database

Data warehousing in Oracle. SQL extensions for data warehouse analysis. Available OLAP functions. Physical aggregation example

SSIS Training: Introduction to SQL Server Integration Services Duration: 3 days

Oracle Architecture, Concepts & Facilities

IBM Campaign Version-independent Integration with IBM Engage Version 1 Release 3 April 8, Integration Guide IBM

3.GETTING STARTED WITH ORACLE8i

Advanced Oracle SQL Tuning

Oracle BI 11g R1: Create Analyses and Dashboards

Objectif. Participant. Prérequis. Pédagogie. Oracle Database 11g - New Features for Administrators Release 2. 5 Jours [35 Heures]

1 Structured Query Language: Again. 2 Joining Tables

Building Views and Charts in Requests Introduction to Answers views and charts Creating and editing charts Performing common view tasks

Relational Databases for the Business Analyst

Writing Control Structures

Green Migration from Oracle

Exploiting PL/SQL Injection on Oracle 12c. with only. CREATE SESSION privileges

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

SQL - QUICK GUIDE. Allows users to access data in relational database management systems.

Documentation Accessibility

HP Quality Center. Upgrade Preparation Guide

Top 10 Oracle SQL Developer Tips and Tricks

IBM Campaign and IBM Silverpop Engage Version 1 Release 2 August 31, Integration Guide IBM

When to consider OLAP?

ORACLE OLAP. Oracle OLAP is embedded in the Oracle Database kernel and runs in the same database process

Demystified CONTENTS Acknowledgments xvii Introduction xix CHAPTER 1 Database Fundamentals CHAPTER 2 Exploring Relational Database Components

Empowered Self-Service with SAP HANA and SAP Lumira. Dennis Scoville BI Evangelist Business Intelligence & Technology Honeywell Aerospace

Transcription:

--Guillaume Couture coug1812 prompt question 1 prompt Select codeaeroport,novol,ville,nom,etat where Aeroport,segmentdevol etat = QC and (codeaeroport=codeaeroportdepart ) order by codeaeroport,novol; -- prompt question 2 prompt Select distinct codeaeroport,novol,ville,nom,etat Aeroport,segmentdevol where etat = QC and ( codeaeroport=codeaeroportdepart or codeaeroport=codeaeroportarrivee ) order by codeaeroport,novol; -- prompt question 3 prompt select novol,count (nosegment) "nb segments" segmentdevol group by novol; -- prompt question 4 prompt select novol,prix classevol c1 where prix >= all (select prix classevol c2 where c1.novol=c2.novol) order by novol; -- prompt question 5 prompt select v1.novol,count (seg1.nosegment) "nb segments" segmentdevol seg1,vol v1 where v1.novol = seg1.novol (+) group by v1.novol order by v1.novol; --

prompt question 6 prompt select a1.codeaeroport aeroport a1 left outer join segmentdevol seg1 on a1.codeaeroport=seg1.codeaeroportdepart group by a1.codeaeroport having count () <= 2 order by a1.codeaeroport; -- prompt question 7 prompt select a1.codeaeroport aeroport a1 left outer join segmentdevol seg1 on a1.codeaeroport=seg1.codeaeroportdepart or a1.codeaeroport=seg1.codeaeroportarrivee group by a1.codeaeroport having count (seg1.codeaeroportdepart)<= 2 and count (seg1.codeaeroportarrivee)<=2 order by a1.codeaeroport; -- prompt question 8 prompt select v1.novol, v1.typedevol vol v1 order by v1.novol having count (seg1.nosegment)>= all ( select count (seg2.nosegment) segmentdevol seg2 group by seg2.novol ) ; -- prompt question 9 prompt select a1.codeaeroport aeroport a1 left outer join segmentdevol seg1 on a1.codeaeroport=seg1.codeaeroportdepart or a1.codeaeroport=seg1.codeaeroportarrivee group by a1.codeaeroport having count (seg1.codeaeroportdepart)<=0 and count (seg1.codeaeroportarrivee)<=0 order by a1.codeaeroport; -- prompt question 10

prompt select v1.novol vol v1, classe c1 having c1.description = Affaires (select c1.description classe c1 where c1.description = Affaires ) group by novol ; -- prompt question 11 prompt drop view fabricant; create view tablefabriquant as select avion a1, vol v1 join avionvol av1 on av1.novol=v1.novol; select a1.nomodele "fabricant",count (v1.novol) "nbdevols" vol v1, avion a1 join avionvol av1 on av1.novol=v1.novol case when a1.nomodele in ( %Boing% ) then Boing and a1.nomodele in ( %Airbus% ) then Airbus and a1.nomodele not in ( %Boing% ) then Autres and a1.nomodele not in ( %Airbus% ) then Autres ; -- prompt question 12 prompt select cv1.novol classevol cv1 having count (cv1.novol)=4 group by cv1.novol; -- prompt question 13 prompt select codeaeroport where aeroport codeaeroport in ( select distinct codeaeroportdepart

segmentdevol union select distinct codeaeroportarrivee segmentdevol ) order by codeaeroport ; -- prompt question 14 prompt select codeaeroport aeroport where codeaeroport in (select codeaeroportarrivee, codeaeroportdepart segmentdevol) ; -- prompt question 15 prompt SQLPlus: Release 11.2.0.2.0 Production on Fri Oct 3 16:34:53 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-tp2.sql PL/SQL procedure successfully completed.

PL/SQL procedure successfully completed. Création des tables et données drop table Aeroport cascade constraints Table created. drop table Vol cascade constraints Table created. drop table SegmentDeVol cascade constraints Table created. drop table Classe cascade constraints Table created. drop table ClasseVol cascade constraints

Table created. drop table Avion cascade constraints Table created. drop table AvionVol cascade constraints Table created. Insertion des données

Affichage des résultats de tp2.sql question 1 CODEAEROP NOVOL VILLE NOM ETAT --------- ------------------ ---------------------- ---------------------- ---------------------- YQB AC2003 Québec Jean-Lesage QC YUL AC2001 Montréal Trudeau QC YUL AC2002 Montréal Trudeau QC YUL AC2003 Montréal Trudeau QC YUL AC2007 Montréal Trudeau QC question 2 CODEAEROP NOVOL VILLE NOM ETAT --------- ------------------ ---------------------- ---------------------- ---------------------- YQB AC2003 Québec Jean-Lesage QC YUL AC2001 Montréal Trudeau QC YUL AC2002 Montréal Trudeau QC YUL AC2003 Montréal Trudeau QC YUL AC2004 Montréal Trudeau QC YUL AC2007 Montréal Trudeau QC 6 rows selected. question 3 NOVOL nb segments ------------------ ----------- AC2001 2 AC2002 1 AC2003 3 AC2004 1 AC2007 1 question 4

NOVOL PRIX ------------------ ---------- AC2001 1010.02 AC2002 5275.25 AC2003 199.99 AC2006 9999.99 question 5 NOVOL nb segments ------------------ ----------- AC2001 2 AC2002 1 AC2003 3 AC2004 1 AC2005 0 AC2006 0 AC2007 1 7 rows selected. question 6 CODEAEROP --------- CDG JFK YQB YVR YYZ question 7 CODEAEROP --------- YQB YVR question 8 having count (seg1.nosegment)>= all

ERROR at line 4: ORA-00933: SQL command not properly ended question 9 CODEAEROP --------- YVR question 10 (select c1.description ERROR at line 4: ORA-00933: SQL command not properly ended question 11 drop view fabricant create view tablefabriquant as ORA-00957: duplicate column name case ERROR at line 5: ORA-00933: SQL command not properly ended question 12 NOVOL ------------------

AC2001 question 13 CODEAEROP --------- CDG JFK YQB YUL YYZ question 14 (select codeaeroportarrivee, codeaeroportdepart ERROR at line 4: ORA-00913: too many values question 15 Disconnected Oracle Database 10g Enterprise Edition Release 10.2.0.1.0 - Production With the Partitioning, OLAP and Data Mining options