{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

ch06 - 6 SQL SQL q O SEQUEL(Structured English QUEry...

Info icon This preview shows pages 1–13. Sign up to view the full content.

View Full Document Right Arrow Icon
6. SQL
Image of page 1

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
2 SQL L   SEQUEL(Structured English QUEry Language) 2   1974 Q , IBM [   IBM Q   'SYSTEM R'   q O     ° ± ²  “ Æ % ¤     + ³   SQL 1986 Q , SQL-86 Q   SQL1 1992 2   , SQL/92, SQL-92 Q   SQL2     : SQL3, SQL-99 Q   Q   DBMS Q   DB2 Q   SQL/DS       ORACLE, INFORMIX, SYBASE       [ D       ³   Ł (ANSI)      Ł q (ISO)           Ł
Image of page 2
3 SQL(Structured Query Language) SQL 2   ° 0 {  “ * ³ p  fl ´ + ³ ³ ³     ° ±   * ³ ³  %   +    + ¤ µ   * ³ (DDL), X   D (DML),   D (DCL)      H
Image of page 3

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
4 SQL L     ³ ³   £   +   ³ ³    £ „  fl  +     Q   ´ +  œ ¶ “ *   SQL   Q   RDBMS t+     L   ³ 7     @ @ °°   @    "   t+     *  %   +   ˚  +
Image of page 4
5 SQL L   (2)  „ * ³ ³  % ¤  + “    + Java, COBOL, C/C++       >         @ ± ² L   ³  7 gV     ) @        ! t X {   * SQL t   Æ   ¤       + (access path)       Q Note   O     >          –  8 ,  – * ,  –  8  
Image of page 5

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
6 SQL ° 0 {  “ * ³ ³ ³   ł ³ ³   0 * ( Q )     Æ % ¤       1 0 {   * , q   ´ +   , ( Q , Q , Q , Q , 2   Q ) Q CREATE SCHEMA UNIVERSITY AUTHORIZATION SHLEE ; S     CREATE SCHEMA     CREATE DATABASE       SQL q ´ x       ´             Information_schema :   O     >         D   ³           D     D     L   ³   g @   V  @   @   D    !
Image of page 6
7   ł 0 {  “ *   (1) 9 y  ∙ CREATE DOMAIN Q _ X    | _ Q [ 2   _ Q   ] [ Q _ Q _ X { „   ]; ex) CREATE DOMAIN Dept CHAR (4) DEFAULT '???’ CONSTRAINT VALID-DEPT CHECK ( VALUE IN ('COMP', 'ME', 'EE', 'ARCH', '???')); ALTER DOMAIN Q _ Q   < *   > DROP DOMAIN Q _ m y     RESTRICTED | CASCADE ; RESTRICTED :   O   >         V   > CASCADE :     >         f V  
Image of page 7

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
8   ł q  “ *   (2) 9   * S   ´ + ³     S   INTEGER, SMALLINT : Q FLOAT(n), REAL, DOUBLE PRECISION : Q DECIMAL(i, j), NUMERIC(i, j) : m       * CHAR(n) : m     VARCHAR(n) :     m   * BIT(n), BIT VARYING(n) Q DATE : YY-MM-DD Q TIME : hh:mm:ss TIMESTAMP : DATE Q   TIME Q INTERVAL : DATE, TIME, TIMESTAMP Q
Image of page 8
9   ° °       (1) · q  * oe  • * ³   DDL   q  +   ³     Q (view) DDL   q ´ O  œ : • *       ³   @ D      7   (virtual table)   D DDL q O Q ´ O > V   [   D  fl ´       Q fl  +      
Image of page 9

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
10       ¶   (2) S CREATE TABLE k   ({      [ NOT NULL ] [ DEFAULT S ],} + [ PRIMARY KEY ( Q _ Q ),] {[ UNIQUE ( Q _ Q ),]} * {[ FOREIGN KEY ( Q _ Q ) REFERENCES [( Q _ Q )] [ ON DELETE Q ] [ ON UPDATE Q ] ,]} * [ CONSTRAINT Q ] [ CHECK ( Q )]);
Image of page 10
     ¸  (3)  „ [ ] : Q { } :   + : 1 w  q „ * * : 0    * UNIQUE : Q DELETE Q   UPDATE w     D NO ACTION CASCADE SET NULL SET DEFAULT CHECK :     ' CONSTRAINT   q   O     Q p q   O       ´ O   D       @ 11
Image of page 11

Info icon This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
12      ‘ ´   (4)
Image of page 12
Image of page 13
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

What students are saying

  • Left Quote Icon

    As a current student on this bumpy collegiate pathway, I stumbled upon Course Hero, where I can find study resources for nearly all my courses, get online help from tutors 24/7, and even share my old projects, papers, and lecture notes with other students.

    Student Picture

    Kiran Temple University Fox School of Business ‘17, Course Hero Intern

  • Left Quote Icon

    I cannot even describe how much Course Hero helped me this summer. It’s truly become something I can always rely on and help me. In the end, I was not only able to survive summer classes, but I was able to thrive thanks to Course Hero.

    Student Picture

    Dana University of Pennsylvania ‘17, Course Hero Intern

  • Left Quote Icon

    The ability to access any university’s resources through Course Hero proved invaluable in my case. I was behind on Tulane coursework and actually used UCLA’s materials to help me move forward and get everything together on time.

    Student Picture

    Jill Tulane University ‘16, Course Hero Intern