Exercices sur SQL server 2000



Documents pareils
Création et Gestion des tables

1/ Présentation de SQL Server :

Le Langage De Description De Données(LDD)

WEB page builder and server for SCADA applications usable from a WEB navigator

VTP. LAN Switching and Wireless Chapitre 4

Instructions pour mettre à jour un HFFv2 v1.x.yy v2.0.00

Instructions Mozilla Thunderbird Page 1

I. Programmation I. 1 Ecrire un programme en Scilab traduisant l organigramme montré ci-après (on pourra utiliser les annexes):

FÉDÉRATION INTERNATIONALE DE NATATION Diving

Olivier Mondet

APPENDIX 6 BONUS RING FORMAT

Contents Windows

Once the installation is complete, you can delete the temporary Zip files..

Gestion des prestations Volontaire

THE LAW SOCIETY OF UPPER CANADA BY-LAW 19 [HANDLING OF MONEY AND OTHER PROPERTY] MOTION TO BE MOVED AT THE MEETING OF CONVOCATION ON JANUARY 24, 2002

DOCUMENTATION MODULE BLOCKCATEGORIESCUSTOM Module crée par Prestacrea - Version : 2.0

Exemple PLS avec SAS

How to Login to Career Page

Le langage SQL pour Oracle - partie 1 : SQL comme LDD

Règlement sur le télémarketing et les centres d'appel. Call Centres Telemarketing Sales Regulation

Fiche produit ifinance v4

Le Cloud Computing est-il l ennemi de la Sécurité?

Thank you for choosing the Mobile Broadband USB Stick. With your USB Stick, you can access a wireless network at high speed.

Editing and managing Systems engineering processes at Snecma

Historisation des données

Archived Content. Contenu archivé

Cheque Holding Policy Disclosure (Banks) Regulations. Règlement sur la communication de la politique de retenue de chèques (banques) CONSOLIDATION

COPYRIGHT Danish Standards. NOT FOR COMMERCIAL USE OR REPRODUCTION. DS/EN 61303:1997

Support de Cours REQUÊTES TRANSACT-SQL DANS MICROSOFT SQL SERVER Stéphane N GUESSAN Groupe Pigier Abidjan Version 1.

DOCUMENTATION - FRANCAIS... 2

Les Portfolios et Moodle Petit inventaire

lundi 3 août 2009 Choose your language What is Document Connection for Mac? Communautés Numériques L informatique à la portée du Grand Public

DOCUMENTATION - FRANCAIS... 2

English Q&A #1 Braille Services Requirement PPTC Q1. Would you like our proposal to be shipped or do you prefer an electronic submission?

Critères à l attention des fabricants et des fournisseurs de biens ou de services : dispositifs mécaniques pour bingo

Application Form/ Formulaire de demande

Improving the breakdown of the Central Credit Register data by category of enterprises

RULE 5 - SERVICE OF DOCUMENTS RÈGLE 5 SIGNIFICATION DE DOCUMENTS. Rule 5 / Règle 5

VMware ESX : Installation. Hervé Chaudret RSI - Délégation Centre Poitou-Charentes

Principe de TrueCrypt. Créer un volume pour TrueCrypt

AMENDMENT TO BILL 32 AMENDEMENT AU PROJET DE LOI 32

Acronymes et abréviations. Acronymes / Abbréviations. Signification

Langage propre à Oracle basé sur ADA. Offre une extension procédurale à SQL

Comment calculer une moyenne journalière de l irradiance avec excel 2007? How to calculate a daily average amount of irradiance with Excel 2007?

Calculation of Interest Regulations. Règlement sur le calcul des intérêts CONSOLIDATION CODIFICATION. Current to August 4, 2015 À jour au 4 août 2015

DOCUMENTATION - FRANCAIS... 2

Lesson Plan Physical Descriptions. belle vieille grande petite grosse laide mignonne jolie. beau vieux grand petit gros laid mignon

Guide d'installation rapide TFM-560X YO.13

Supervision et infrastructure - Accès aux applications JAVA. Document FAQ. Page: 1 / 9 Dernière mise à jour: 15/04/12 16:14

POLICY: FREE MILK PROGRAM CODE: CS-4

ARCHOS Activity Tracker

PIB : Définition : mesure de l activité économique réalisée à l échelle d une nation sur une période donnée.

HAUTE DISPONIBILITÉ DE MACHINE VIRTUELLE AVEC HYPER-V 2012 R2 PARTIE CONFIGURATION OPENVPN SUR PFSENSE

Mon Service Public - Case study and Mapping to SAML/Liberty specifications. Gaël Gourmelen - France Telecom 23/04/2007

Bill 69 Projet de loi 69

MELTING POTES, LA SECTION INTERNATIONALE DU BELLASSO (Association étudiante de lʼensaparis-belleville) PRESENTE :

22/09/2014 sur la base de 55,03 euros par action

Afin de valider votre inscription merci de bien veiller à :

INVESTMENT REGULATIONS R In force October 1, RÈGLEMENT SUR LES INVESTISSEMENTS R En vigueur le 1 er octobre 2001

Utiliser une WebCam. Micro-ordinateurs, informations, idées, trucs et astuces

Institut français des sciences et technologies des transports, de l aménagement

UML : Unified Modeling Language

Tex: The book of which I'm the author is an historical novel.

Le passé composé. C'est le passé! Tout ça c'est du passé! That's the past! All that's in the past!

INSTRUMENTS DE MESURE SOFTWARE. Management software for remote and/or local monitoring networks

Surveillance de Scripts LUA et de réception d EVENT. avec LoriotPro Extended & Broadcast Edition

that the child(ren) was/were in need of protection under Part III of the Child and Family Services Act, and the court made an order on

Les Triggers SQL. Didier DONSEZ. Université de Valenciennes Institut des Sciences et Techniques de Valenciennes

Compte-rendu technique complet et détaillé des cookies

Cours Bases de données 2ème année IUT

Credit Note and Debit Note Information (GST/ HST) Regulations

SparkInData. Place de Marché des applications Spatiales

Academic Project. B2- Web Development. Resit Project. Version 1.0 Last update: 24/05/2013 Use: Students Author: Samuel CUELLA

Laboratoires de bases de données. Laboratoire n 6. Programmation SQL. par Danièle BAYERS et Louis SWINNEN

L. Obert, T. Lascar, A. Adam

MapReduce. Malo Jaffré, Pablo Rauzy. 16 avril 2010 ENS. Malo Jaffré, Pablo Rauzy (ENS) MapReduce 16 avril / 15

TABLE DES MATIERES A OBJET PROCEDURE DE CONNEXION

Loi sur l aide financière à la Banque Commerciale du Canada. Canadian Commercial Bank Financial Assistance Act CODIFICATION CONSOLIDATION

WiFi Security Camera Quick Start Guide. Guide de départ rapide Caméra de surveillance Wi-Fi (P5)

Paris Airports - Web API Airports Path finding

PRACTICE DIRECTION ON THE LENGTH OF BRIEFS AND MOTIONS ON APPEAL

Table des matières PRESENTATION DU LANGAGE DS2 ET DE SES APPLICATIONS. Introduction

Thank you for choosing the Mobile Broadband USB Stick. With your USB Stick, you can access a wireless network at high speed.

Les déclencheurs. Version 1.0. Grégory CASANOVA

Stakeholder Feedback Form January 2013 Recirculation

Quick Start Guide This guide is intended to get you started with Rational ClearCase or Rational ClearCase MultiSite.

Monitor LRD. Table des matières

GAME CONTENTS CONTENU DU JEU OBJECT OF THE GAME BUT DU JEU

Stock Management Suite

FileMaker 13. Guide de référence SQL

THE EVOLUTION OF CONTENT CONSUMPTION ON MOBILE AND TABLETS

CALCUL DE LA CONTRIBUTION - FONDS VERT Budget 2008/2009

SERVEUR DÉDIÉ DOCUMENTATION

An Act to Amend the Tobacco Sales Act. Loi modifiant la Loi sur les ventes de tabac CHAPTER 46 CHAPITRE 46

Input Tax Credit Information (GST/HST) Regulations

Insérer des images dans Base

ISC Système d Information Architecture et Administration d un SGBD Compléments SQL

Interest Rate for Customs Purposes Regulations. Règlement sur le taux d intérêt aux fins des douanes CONSOLIDATION CODIFICATION

VMware : De la Virtualisation. au Cloud Computing

OpenPaaS Le réseau social d'entreprise

Transcription:

Exercices sur SQL server 2000 La diagramme de classe : Exercices sur SQL server 2000 Le modèle relationnel correspondant : 1

Créer les tables Clic-droit on Tables et choisir «New Table» Créer la table Client Mettre N_client en clé primaire Pour clé primaire mettre «Identity» à yes 2

Créer la table Commande Créer la table Constitution 3

Créer la table Produit Data type bigint binary[(n)] Description Data types An 8-byte integer (whole number). Fixed-length binary data of n bytes, where n is a value from 1 through 8000. Use binary when data entries in a column are expected to be close to the same size. Storage size 8 bytes n + 4 bytes bit char[(n)] cursor datetime decimal[(p,[s])] or numeric[(p,[s])] Integer data type that can be a value of 1, 0, or NULL. Bit columns cannot have indexes on them Fixed-length non-unicode character data with length of n characters, where n is a value from 1 through 8000 A reference to a cursor. Can be used only for variables and stored procedure parameters Date and time data from January 1, 1753 through December 31, 9999, with accuracy to 3.33 milliseconds Fixed-precision and fixed-scale numbers. (The data type numeric is a synonym for decimal.)precision (p) specifies the total number of digits that can be stored, both to the left and to the right of the decimal point. Scale (s) specifies the maximum number of digits that can be stored to the right of the decimal point. Scale must be less than or equal to precision. The minimum precision is 1, and the maximum precision is 28 unless SQL Server is started with the -p parameter, in which case, precision can be up to 38. 1 byte for a table with up to 8-bit columns, 2 bytes for a table with 9-bit through 16-bit columns, and so on n bytes Not applicable 8 bytes 5 through 17 bytes, depending on precision 4

float[(n)] Floating-precision numerical data that can range from -1.79E +308 through 1.79E +308. The value n is the number of bits used to store the mantissa of the float number and can range from 1 to 53 4 through 8 bytes, depending on precision image Used for variable-length binary data longer than 8000 bytes, with a maximum of 2^31-1 bytes. An image column entry is a pointer to the location of the image data value. The data is stored separately from the table data 16 bytes for the pointer integer or int Integer (whole number) data from -2^31 (-2,147,483,648) through 2^31-1 (2,147,483,647) 4 bytes money Monetary data values from -2^63 (-922,337,203,685,477.5808) through 2^63-1 (922,337,203,685,477.5807), with accuracy to one ten-thousandth of a monetary unit 8 bytes Fixed-length Unicode character data of n characters, where n is a value from 1 through 4000.Unicode characters use 2 bytes per character and can support all international charactersnchar[(n)] ntext Variable-length Unicode data with a maximum length of 2^30-1 (1,073,741,823) characters.the column entry for ntext is a pointer to the location of the data. The data is stored separately from the table data 2 bytes * the number of characters entered 16 bytes for the pointer and 2 bytes * the number of characters entered for the data nvarchar real smalldatetime smallint smallmoney sql_variant Variable-length Unicode data of n characters, where n is a value from 1 through 4000. Recall that Unicode characters use 2 bytes per character and can support all international characters. Floating-precision numerical data that can range from?3.40e+38 through 3.40E+38. The synonym for real is float(24) Date and time data from January 1, 1900 through June 6, 2079, with accuracy to the minute (less precise than the datetime data type) Integer data from -2^15 (-32,768) through 2^15-1 (32,767) Monetary data values from -214,748.3648 through 214,748.3647, with accuracy to one ten-thousandth of a monetary unit Allows values of different data types. The data value and data describing that value its base data type, scale, precision, maximum size, and collation are stored in this column 2 bytes * the number of characters entered 4 bytes 4 bytes 2 bytes 4 bytes Size varies sysname A special, system-supplied, SQL Server user-defined data type. The sysname data type is defined by SQL Server as nvarchar(128), which means that it can contain 128 Unicode characters (or 256 bytes). Use sysname to refer to columns that store object names 256 bytes table Similar to using a temporary table the declaration includes a column list and data types. Can be used to define a local variable or for the return value of a user-defined function. Varies with table definition 5

text Used for variable-length non-unicode character data longer than 8000 bytes. A text column entry can hold up to 2^31-1 characters. It is a pointer to the location of the data value. The data is stored separately from the table data 16 bytes for the pointer timestamp A timestamp column is automatically updated every time a row is inserted or updated. Each table can have only one timestamp column. 8 bytes tinyint Integer data from 0 through 255. 1 byte unique-identifier Stores a 16-byte binary value that is a globally unique identifier (GUID) 16 bytes varbinary Variable-length binary data of n bytes, where n is a value from 1 through 8000. Use varbinary when data entries in a column are expected to vary considerably in size. Actual length of data entered + 4 bytes varchar[(n)] Variable-length non-unicode character data with a length of n characters, where n is a value from 1 through 8000. Actual length of data entered Créer un nouveau diagramme 6

Ajouter les tables avec wizard Ajouter les liens entre les tables Tirer un lien de Client.N_client Vers Commande.N_Client 7

Ajouter les liens entre les tables Ajouter les liens entre les tables Client.N_client Commande.N_Client Commande.N_Commande Constitution.N_Commande Produit.N_Produit Constitution.N_Produit 8

Ajouter des données aux tables Clic-droit sur la table et choisir «Open table» puis «Return all rows» Ajouter des données aux tables On peut aussi modifier les données déjà entrées Ajouter les données à la dernière ligne de la table, Le champs N_client se complète automatiquement car «Identity» est mis à yes 9

Ajouter des données aux tables Attention à la contrainte d intégrité existentielle Pour les clés étrangères Ajouter des données aux tables Client Commande Produit Constitution 10

Créer un nouveau «view» Créer un nouveau «view» Clic-droit et choisir «add table» 11

Créer un nouveau «view» Ajouter la table client Créer un nouveau «view» Cliquer sur «all columns» puis sur run 12

Créer un nouveau «view» Choisir N_client, Nom_Client et Adresse. Décocher «output» d adresse. Ajouter «= Bruxelles» dans criteria Créer un nouveau «view» Créer un nouveau «view» Ajouter tous les tables qu on a créé 13

Créer un nouveau «view» Construire une vue qui renvoie le nom et adresse du client, les produits qu il a acheté, la date de la Commande et la quantité acheté Créer un nouveau «view» 14

Créer un nouveau «view» Quels sont les clients (nom et adresse) qui n ont pas fait d achat en octobre SELECT Client.NomClient, Client.Adresse FROM Client, Commande WHERE (Client.N_Client = Commande.N_Client) And (Commande.DateCommande NOT LIKE /10/ ); Créer un nouveau «view» Deux lignes identiques! 15

Créer un nouveau «view» Pour éliminer les duplicats 16