Вы находитесь на странице: 1из 5

CREATE TABLE customers ( custID INTEGER NOT NULL, LastName CHAR(18) NOT NULL, FirstName CHAR(18) NOT NULL,

PRIMARY KEY (custID) ); CREATE TABLE currencies ( from_currency CHAR(30) NOT NULL, ExchRate REAL NOT NULL, to_currency CHAR(30) NOT NULL, PRIMARY KEY (from_currency), FOREIGN KEY (to_currency) REFERENCES currencies(from_currency) ); CREATE TABLE cities ( city CHAR(18) NOT NULL, country CHAR(18) NOT NULL, currency CHAR(4) NOT NULL, airtax decimal(6,2) NOT NULL, PRIMARY KEY (city, country), FOREIGN KEY (currency) REFERENCES currencies(from_currency) ); CREATE TABLE AirLines ( Name CHAR(18) NOT NULL, city CHAR(18) NOT NULL, country CHAR(18) NOT NULL, PRIMARY KEY (Name), FOREIGN KEY (city,country) REFERENCES cities(city,country) ); CREATE TABLE flights ( Fno INTEGER NOT NULL, airl_Name CHAR(18) NOT NULL, price_currency CHAR(4) NOT NULL, dest_country CHAR(18) NOT NULL, orig_country CHAR(18) NOT NULL, orig_city CHAR(18) NOT NULL, price DECIMAL(6,2) NOT NULL, SMallow CHAR(1) NOT NULL, BCavlb CHAR(1) NOT NULL,

FlightLength INTEGER NOT NULL, dest_city CHAR(18), PRIMARY KEY (Fno), FOREIGN KEY (airl_Name) REFERENCES AirLines(Name), FOREIGN KEY (price_currency) REFERENCES currencies(from_currency), FOREIGN KEY (dest_city,dest_country) REFERENCES cities(city,country), FOREIGN KEY (orig_city,orig_country) REFERENCES cities(city,country) ); CREATE TABLE bookings ( BkgNum INTEGER NOT NULL, custID INTEGER NOT NULL, book_country CHAR(18) NOT NULL, dtax_country CHAR(18) NOT NULL, atax_country CHAR(18) NOT NULL, atax_city CHAR(18) NOT NULL, Fno INTEGER NOT NULL, BkgDate DATE NOT NULL, Depart DATE NOT NULL, Arrival DATE NOT NULL, Class CHAR(3) NOT NULL, Status CHAR(3) NOT NULL, paid CHAR(1) NOT NULL, balance DECIMAL(6,2) NOT NULL, TLname CHAR(18) NOT NULL, TFname CHAR(18) NOT NULL, dtax_city CHAR(18) NOT NULL, book_city CHAR(18) NOT NULL, PRIMARY KEY (BkgNum), FOREIGN KEY (custID) REFERENCES customers, FOREIGN KEY (book_city,book_country) REFERENCES cities(city,country), FOREIGN KEY (dtax_city,dtax_country) REFERENCES cities(city,country), FOREIGN KEY (atax_city,atax_country) REFERENCES cities(city,country), FOREIGN KEY (Fno) REFERENCES flights ); CREATE TABLE Eaddrs ( Eaddr CHAR(18) NOT NULL,

PRIMARY KEY (Eaddr) ); CREATE TABLE has_3 custID Eaddr PRIMARY KEY FOREIGN KEY FOREIGN KEY ); ( INTEGER NOT NULL, CHAR(18) NOT NULL, (custID, Eaddr), (Eaddr) REFERENCES Eaddrs, (custID) REFERENCES customers

CREATE TABLE addrs ( country CHAR(8) NOT NULL, province CHAR(8) NOT NULL, city CHAR(18) NOT NULL, StrNo CHAR(6) NOT NULL, pcode CHAR(6) NOT NULL, PRIMARY KEY (country, province, city, StrNo) ); CREATE TABLE has_4 custID country province city StrNo PRIMARY KEY FOREIGN KEY REFERENCES addrs, FOREIGN KEY ); ( INTEGER NOT NULL, CHAR(8) NOT NULL, CHAR(8) NOT NULL, CHAR(18) NOT NULL, CHAR(6) NOT NULL, (custID,country,province,city,StrNo), (country,province,city,StrNo) (custID) REFERENCES customers

CREATE TABLE faxes ( CountryCode CHAR(4) NOT NULL, AreaCode CHAR(3) NOT NULL, Number CHAR(8) NOT NULL, PRIMARY KEY (CountryCode, AreaCode, Number) ); CREATE TABLE has_2 ( custID CountryCode AreaCode INTEGER NOT NULL, CHAR(4) NOT NULL, CHAR(3) NOT NULL,

Number CHAR(8) NOT NULL, PRIMARY KEY (custID,CountryCode,AreaCode,Number), FOREIGN KEY (CountryCode,AreaCode,Number) REFERENCES faxes, FOREIGN KEY (custID) REFERENCES customers ); CREATE TABLE phones ( CountryCode CHAR(4) NOT NULL, AreaCode CHAR(3) NOT NULL, Number CHAR(8) NOT NULL, PRIMARY KEY (CountryCode, AreaCode, Number) ); CREATE TABLE has_1 custID CountryCode AreaCode Number PRIMARY KEY Number), FOREIGN KEY REFERENCES phones, FOREIGN KEY ); LIST TABLES; TERMINATE; ( INTEGER NOT NULL, CHAR(4) NOT NULL, CHAR(3) NOT NULL, CHAR(8) NOT NULL, (custID, CountryCode, AreaCode, (CountryCode,AreaCode,Number) (custID) REFERENCES customers

Here is the script to delete all tables:


CONNECT TO DROP TABLE DROP TABLE DROP TABLE DROP TABLE DROP TABLE DB4EB3; customers; currencies; cities; AirLines; flights;

DROP TABLE bookings; DROP TABLE Eaddrs; DROP TABLE has_3; DROP TABLE addrs; DROP TABLE has_4; DROP TABLE faxes; DROP TABLE has_2; DROP TABLE phones; DROP TABLE has_1; LIST TABLES; TERMINATE;

Вам также может понравиться

  • ZHONE CLI Reference Guide
    ZHONE CLI Reference Guide
    Документ423 страницы
    ZHONE CLI Reference Guide
    Jason
    Оценок пока нет
  • SQL Lab Manual
    SQL Lab Manual
    Документ13 страниц
    SQL Lab Manual
    S N Raghavan Iyengar
    100% (3)
  • Virus Code
    Virus Code
    Документ22 страницы
    Virus Code
    mindhunter6
    Оценок пока нет
  • Vendor: Oracle
    Vendor: Oracle
    Документ128 страниц
    Vendor: Oracle
    Victor Manuel Ospina Bautista
    100% (1)
  • Getting Started With Microsoft Publisher 2013
    Getting Started With Microsoft Publisher 2013
    Документ6 страниц
    Getting Started With Microsoft Publisher 2013
    AR LO
    Оценок пока нет
  • Datacolor QTX File Specification
    Datacolor QTX File Specification
    Документ8 страниц
    Datacolor QTX File Specification
    JubaidurRahman
    Оценок пока нет
  • HANA
    HANA
    Документ27 страниц
    HANA
    Alejandro Londoño
    Оценок пока нет
  • Visualizing Data
    Visualizing Data
    Документ51 страница
    Visualizing Data
    Michael Welker
    Оценок пока нет
  • Chapter 3: Selecting
    Chapter 3: Selecting
    Документ1 страница
    Chapter 3: Selecting
    Miroslav Misa Miskovic
    Оценок пока нет
  • Create Tables Northwind
    Create Tables Northwind
    Документ4 страницы
    Create Tables Northwind
    Jonathan Guerrero Navarro
    Оценок пока нет
  • Dbms Lab Manual-2013
    Dbms Lab Manual-2013
    Документ27 страниц
    Dbms Lab Manual-2013
    Arham Jain
    Оценок пока нет
  • Tables
    Tables
    Документ3 страницы
    Tables
    Harsha Ojha
    Оценок пока нет
  • BD Obl Completa
    BD Obl Completa
    Документ9 страниц
    BD Obl Completa
    Lizbeth Santibañez Cruz
    Оценок пока нет
  • Anexa La Model Documentatie Baze de Date - Proiect
    Anexa La Model Documentatie Baze de Date - Proiect
    Документ11 страниц
    Anexa La Model Documentatie Baze de Date - Proiect
    VictorMatei
    Оценок пока нет
  • NOT Null, NOT Null, Null, NOT Null, Null, NOT Null, Null, NOT Null, NOT Null
    NOT Null, NOT Null, Null, NOT Null, Null, NOT Null, Null, NOT Null, NOT Null
    Документ5 страниц
    NOT Null, NOT Null, Null, NOT Null, Null, NOT Null, Null, NOT Null, NOT Null
    Xhevat Llumnica
    Оценок пока нет
  • SQLQuery Bank - DB Table
    SQLQuery Bank - DB Table
    Документ3 страницы
    SQLQuery Bank - DB Table
    Vivek
    Оценок пока нет
  • Script Sales PDF
    Script Sales PDF
    Документ291 страница
    Script Sales PDF
    Frank Cirilo
    Оценок пока нет
  • Airline Reservation
    Airline Reservation
    Документ32 страницы
    Airline Reservation
    Keeyo Relanes
    Оценок пока нет
  • Assignment 2
    Assignment 2
    Документ9 страниц
    Assignment 2
    Bismeldinova Karima
    Оценок пока нет
  • Bsadn
    Bsadn
    Документ7 страниц
    Bsadn
    nikkgarcia299
    Оценок пока нет
  • MySQL Script Northwind
    MySQL Script Northwind
    Документ3 страницы
    MySQL Script Northwind
    Juan Luiis Alvarado
    Оценок пока нет
  • New SQL File
    New SQL File
    Документ2 страницы
    New SQL File
    Kanti Chaurasia
    Оценок пока нет
  • Cs352 Design Report
    Cs352 Design Report
    Документ19 страниц
    Cs352 Design Report
    Wahab Saleem
    Оценок пока нет
  • Ass 3
    Ass 3
    Документ4 страницы
    Ass 3
    Galaxy Knowledge
    Оценок пока нет
  • Table CMD
    Table CMD
    Документ1 страница
    Table CMD
    Srikant
    Оценок пока нет
  • Usar Los Campos Que Están en Amarillo Solamente: Estado de Cuenta
    Usar Los Campos Que Están en Amarillo Solamente: Estado de Cuenta
    Документ4 страницы
    Usar Los Campos Que Están en Amarillo Solamente: Estado de Cuenta
    Susan Medina Zamora
    Оценок пока нет
  • sql2 (Answers)
    sql2 (Answers)
    Документ3 страницы
    sql2 (Answers)
    magedibrahim161
    Оценок пока нет
  • Scripts
    Scripts
    Документ5 страниц
    Scripts
    shubham tiwari
    Оценок пока нет
  • Hotel Database
    Hotel Database
    Документ6 страниц
    Hotel Database
    OSHO
    Оценок пока нет
  • Ex-6 (Bank Database)
    Ex-6 (Bank Database)
    Документ6 страниц
    Ex-6 (Bank Database)
    chennakesava13579
    Оценок пока нет
  • Compras
    Compras
    Документ2 страницы
    Compras
    Olga Lucia
    Оценок пока нет
  • Tables List
    Tables List
    Документ173 страницы
    Tables List
    Rahul mitra
    Оценок пока нет
  • Data Structures For PeopleSoft
    Data Structures For PeopleSoft
    Документ7 страниц
    Data Structures For PeopleSoft
    Phani Kumar Avula
    Оценок пока нет
  • Bank Database: Table Queries
    Bank Database: Table Queries
    Документ22 страницы
    Bank Database: Table Queries
    lok esh
    Оценок пока нет
  • SQL Practice Databases
    SQL Practice Databases
    Документ14 страниц
    SQL Practice Databases
    M.I.M KRUPHA
    Оценок пока нет
  • Dbmsass 2
    Dbmsass 2
    Документ3 страницы
    Dbmsass 2
    Bismeldinova Karima
    Оценок пока нет
  • Invoice Print Query
    Invoice Print Query
    Документ15 страниц
    Invoice Print Query
    M A Qader
    Оценок пока нет
  • New Text Document
    New Text Document
    Документ2 страницы
    New Text Document
    Tista Bhaduri
    Оценок пока нет
  • New Text Document
    New Text Document
    Документ2 страницы
    New Text Document
    Ahmed Abdulrahman
    Оценок пока нет
  • Data Base Management Systems - Lab 2ND SEM BCA - Y2K8 SCHEME
    Data Base Management Systems - Lab 2ND SEM BCA - Y2K8 SCHEME
    Документ8 страниц
    Data Base Management Systems - Lab 2ND SEM BCA - Y2K8 SCHEME
    Poxitee Pox
    Оценок пока нет
  • With FK: Create Tables
    With FK: Create Tables
    Документ2 страницы
    With FK: Create Tables
    Siddarth Nyati
    Оценок пока нет
  • BB Coffee Brewery System
    BB Coffee Brewery System
    Документ17 страниц
    BB Coffee Brewery System
    Taile Ku
    Оценок пока нет
  • DDLCommand FinalProject1
    DDLCommand FinalProject1
    Документ27 страниц
    DDLCommand FinalProject1
    neha
    Оценок пока нет
  • DB of Bank
    DB of Bank
    Документ6 страниц
    DB of Bank
    Bilal Anwar
    Оценок пока нет
  • Godad Email Article
    Godad Email Article
    Документ1 страница
    Godad Email Article
    Vishnu Pisal
    Оценок пока нет
  • Date Base
    Date Base
    Документ1 страница
    Date Base
    Gianny Maicol Machco Milla
    Оценок пока нет
  • Teter 00
    Teter 00
    Документ1 страница
    Teter 00
    jeyili3812
    Оценок пока нет
  • LiveSQL InventoryDWCREATEINSERTScript1
    LiveSQL InventoryDWCREATEINSERTScript1
    Документ14 страниц
    LiveSQL InventoryDWCREATEINSERTScript1
    rastparul1
    Оценок пока нет
  • DBMS (Day 1-4)
    DBMS (Day 1-4)
    Документ16 страниц
    DBMS (Day 1-4)
    shakil ahmad khan
    Оценок пока нет
  • Dtabase
    Dtabase
    Документ3 страницы
    Dtabase
    Samreen Awan
    Оценок пока нет
  • 6A
    6A
    Документ2 страницы
    6A
    Out of Mind
    Оценок пока нет
  • Tabla Empresa - Ellab
    Tabla Empresa - Ellab
    Документ2 страницы
    Tabla Empresa - Ellab
    jose gutierrez
    Оценок пока нет
  • Bank Management System PDF
    Bank Management System PDF
    Документ9 страниц
    Bank Management System PDF
    Sukh Vir
    Оценок пока нет
  • Course 1 Module 03 Assignment Solution Mysql
    Course 1 Module 03 Assignment Solution Mysql
    Документ2 страницы
    Course 1 Module 03 Assignment Solution Mysql
    Abhinav Pathak
    Оценок пока нет
  • Sales Script POSTGRES
    Sales Script POSTGRES
    Документ4 страницы
    Sales Script POSTGRES
    vsdfhds
    Оценок пока нет
  • Database
    Database
    Документ6 страниц
    Database
    vyanky pophale
    Оценок пока нет
  • Page 3
    Page 3
    Документ19 страниц
    Page 3
    gufran.momin25
    Оценок пока нет
  • Tysql24 Data
    Tysql24 Data
    Документ6 страниц
    Tysql24 Data
    souravdey3
    Оценок пока нет
  • Homework 9 Solution
    Homework 9 Solution
    Документ5 страниц
    Homework 9 Solution
    John Smith
    Оценок пока нет
  • SQL
    SQL
    Документ2 страницы
    SQL
    prabinmahaseth.cse19
    Оценок пока нет
  • Question 3
    Question 3
    Документ9 страниц
    Question 3
    Satish Kumar
    Оценок пока нет
  • Pinevalley
    Pinevalley
    Документ10 страниц
    Pinevalley
    cigila6437
    Оценок пока нет
  • Dbms Lab-1
    Dbms Lab-1
    Документ22 страницы
    Dbms Lab-1
    erkomal
    100% (1)
  • CREATE DATABASE LabTask
    CREATE DATABASE LabTask
    Документ6 страниц
    CREATE DATABASE LabTask
    Tehmoor Amjad
    Оценок пока нет
  • Testing
    Testing
    Документ17 страниц
    Testing
    satishbunty592
    Оценок пока нет
  • Lab DB
    Lab DB
    Документ4 страницы
    Lab DB
    FA20-BSE-040 (AFAQ AHMED) Unknown
    Оценок пока нет
  • Measuring Cups
    Measuring Cups
    Документ14 страниц
    Measuring Cups
    AR LO
    Оценок пока нет
  • Male Sex Disorders
    Male Sex Disorders
    Документ2 страницы
    Male Sex Disorders
    AR LO
    Оценок пока нет
  • We Serve:: Miki de Camote Tops With Egg Without Egg Polvoron Con Sesame Lemongrass Iced Tea
    We Serve:: Miki de Camote Tops With Egg Without Egg Polvoron Con Sesame Lemongrass Iced Tea
    Документ1 страница
    We Serve:: Miki de Camote Tops With Egg Without Egg Polvoron Con Sesame Lemongrass Iced Tea
    AR LO
    Оценок пока нет
  • Bangus Bangus Bangus: Innhs Sardines Innhs Sardines Innhs Sardines
    Bangus Bangus Bangus: Innhs Sardines Innhs Sardines Innhs Sardines
    Документ2 страницы
    Bangus Bangus Bangus: Innhs Sardines Innhs Sardines Innhs Sardines
    AR LO
    Оценок пока нет
  • Shamrock Hymn
    Shamrock Hymn
    Документ1 страница
    Shamrock Hymn
    AR LO
    Оценок пока нет
  • Course Description: (All Students Are Expected To Be Computer Literate!)
    Course Description: (All Students Are Expected To Be Computer Literate!)
    Документ17 страниц
    Course Description: (All Students Are Expected To Be Computer Literate!)
    AR LO
    Оценок пока нет
  • Project IN English 5: Submitted To Mrs - Henrietta C. Cabuyadao
    Project IN English 5: Submitted To Mrs - Henrietta C. Cabuyadao
    Документ2 страницы
    Project IN English 5: Submitted To Mrs - Henrietta C. Cabuyadao
    AR LO
    Оценок пока нет
  • Social Media in The Philippines
    Social Media in The Philippines
    Документ12 страниц
    Social Media in The Philippines
    AR LO
    Оценок пока нет
  • Data Rescue PC User Manual
    Data Rescue PC User Manual
    Документ28 страниц
    Data Rescue PC User Manual
    Bulearca Cristian
    Оценок пока нет
  • SANS DFPS Command-Line v1.6 02-23
    SANS DFPS Command-Line v1.6 02-23
    Документ2 страницы
    SANS DFPS Command-Line v1.6 02-23
    Het Bhavin Patel
    Оценок пока нет
  • The PC Hacking FAQ
    The PC Hacking FAQ
    Документ24 страницы
    The PC Hacking FAQ
    api-3712211
    Оценок пока нет
  • Cisco: Sritrusta Sukaridhoto
    Cisco: Sritrusta Sukaridhoto
    Документ34 страницы
    Cisco: Sritrusta Sukaridhoto
    Berrezeg Mahieddine
    Оценок пока нет
  • HW 6
    HW 6
    Документ3 страницы
    HW 6
    Eneet Singh Rana
    Оценок пока нет
  • UE3 Auto Report Ini Dump 0006
    UE3 Auto Report Ini Dump 0006
    Документ108 страниц
    UE3 Auto Report Ini Dump 0006
    HamidZaoui
    Оценок пока нет
  • l24 Reliability
    l24 Reliability
    Документ40 страниц
    l24 Reliability
    DUDEKULA VIDYASAGAR
    Оценок пока нет
  • Rsa Netwitness Logs and Packets: Server, Dac and San HW Specifications
    Rsa Netwitness Logs and Packets: Server, Dac and San HW Specifications
    Документ10 страниц
    Rsa Netwitness Logs and Packets: Server, Dac and San HW Specifications
    funyiroember
    Оценок пока нет
  • Arduino Wifi Manual
    Arduino Wifi Manual
    Документ7 страниц
    Arduino Wifi Manual
    Cix Xid
    Оценок пока нет
  • Arp Rarp Icmp
    Arp Rarp Icmp
    Документ22 страницы
    Arp Rarp Icmp
    rkankrale1980
    Оценок пока нет
  • 20bcab33 Abishek
    20bcab33 Abishek
    Документ146 страниц
    20bcab33 Abishek
    Abishek Sharma
    Оценок пока нет
  • Symantec DLP For Networks
    Symantec DLP For Networks
    Документ3 страницы
    Symantec DLP For Networks
    M_BB
    Оценок пока нет
  • QTFF
    QTFF
    Документ356 страниц
    QTFF
    rijoi
    Оценок пока нет
  • Ncdu
    Ncdu
    Документ9 страниц
    Ncdu
    ricardoso5549
    Оценок пока нет
  • Openarchive: The Final Destination of Your Data
    Openarchive: The Final Destination of Your Data
    Документ26 страниц
    Openarchive: The Final Destination of Your Data
    Joshi Mp
    Оценок пока нет
  • Lec 15 - 17 (SQL FUNCTIONS)
    Lec 15 - 17 (SQL FUNCTIONS)
    Документ38 страниц
    Lec 15 - 17 (SQL FUNCTIONS)
    Latest Gadgets
    Оценок пока нет
  • Retrieving Data Using The SQL SELECT Statement
    Retrieving Data Using The SQL SELECT Statement
    Документ38 страниц
    Retrieving Data Using The SQL SELECT Statement
    Abby AR
    Оценок пока нет
  • Partial Restore
    Partial Restore
    Документ7 страниц
    Partial Restore
    aggarwallokesh
    Оценок пока нет
  • Artigo PingER SLAC
    Artigo PingER SLAC
    Документ7 страниц
    Artigo PingER SLAC
    Leandro Justino
    Оценок пока нет
  • Obiee 11g - Performance Tuning Real Success Stories
    Obiee 11g - Performance Tuning Real Success Stories
    Документ60 страниц
    Obiee 11g - Performance Tuning Real Success Stories
    yugandhar_ch
    Оценок пока нет
  • CCNA Access List Questions
    CCNA Access List Questions
    Документ6 страниц
    CCNA Access List Questions
    Kelvin Roa
    Оценок пока нет
  • 15 - 18 Digit Id - Object ID
    15 - 18 Digit Id - Object ID
    Документ2 страницы
    15 - 18 Digit Id - Object ID
    vkrish6
    Оценок пока нет
  • Quiz Time!!!
    Quiz Time!!!
    Документ13 страниц
    Quiz Time!!!
    Souvik Paul
    Оценок пока нет
  • VSAN Failure Testing
    VSAN Failure Testing
    Документ28 страниц
    VSAN Failure Testing
    Lawes Chan
    Оценок пока нет