Download pdf - Vj3 Uvod u SQL-11-Ora

Transcript
  • BAZE PODATAKA 2 VJEBE 1Mr Boris Damjanovi

    1

  • Vjebe Vjebe kreiranje tabela kreiranje tabela -- uvod u SQLuvod u SQL

    Pojednostavljena sintaksa:

    CREATE TABLE ime-bazne-tabele

    ( kolona_1 tip_kolone_1 {,kolona_n tip_kolone_n}

    [, def_prim_kljuca]

    3

    [, def_prim_kljuca]

    [, def_spolj_kljuca_1 {, def_spolj_kljuca_n}])

  • Vjebe Vjebe kreiranje tabela kreiranje tabela -- uvod u SQLuvod u SQL

    Za Oracle:

    Nalog HR + Pass hr

    SQL-> SQL commands

    4

  • Vjebe Vjebe kreiranje tabela kreiranje tabela -- uvod u SQLuvod u SQL

    Primjer:

    CREATE TABLE ODJELJENJE

    (

    ODJELJENJE_ID integer,

    5

    ODJELJENJE_ID integer,

    NAZIV char(20),

    GRAD char(20)

    );

    /*I Oracle i Firebird*/

  • OracleOracle

    6

  • OracleOracle

    Struktura tabele

    describe ODJELJENJE

    /*SAMO Oracle */

    7

    /*SAMO Oracle */

  • OracleOracle

    8

  • OracleOracle

    Home -> Object Browser

    Odabrati tabelu ODJELJENJE

    9


Recommended