2010 03 29 sql sintaksa deo 1


SQL sintaksa
CREATE DATABASE naziv-baze-podataka [IN naziv-dbspace]
[ ON < filespec > [ ,...n ] ]
[ LOG ON < filespec > [ ,...n ] ]
< filespec > ::= ( [ NAME = logical_file_name , ]
FILENAME = 'os_file_name'
[ , SIZE = size ]
[ , MAXSIZE = { max_size | UNLIMITED } ]
[ , FILEGROWTH = growth_increment ] ) [ ,...n ] )
ALTER DATABASE database
{ ADD FILE < filespec > [ ,...n ]
| ADD LOG FILE < filespec > [ ,...n ]
| REMOVE FILE logical_file_name
| MODIFY FILE < filespec >
| MODIFY NAME = new_dbname}
DROP DATABASE naziv-baze-podataka
CREATE TABLE naziv-tabele ( def.-kolone-1,..., [ def.-ograni%0ńenja-na-nivou-tabele-1, ...] )
Definicija-kolone
naziv-kolone tip-podatka [DEFAULT klauzula] [def.-ograni%0ńenja-na-nivou-kolone]
Definicija-ograni%0ńenja-na-nivou-kolone
[NOT NULL] [UNIQUE] [PRIMARY KEY] [REFERENCES klauzula] [CHECK klauzula]
REFERENCES naziv-tabele [(naziv-kolone-1)]
CHECK (uslov)
Definicija-ograni%0ńenja-na-nivou-tabele
[UNIQUE(naziv-kol-1, ...)] [PRIMARY KEY (naziv-kol-1, ...)] [FOREIGN KEY (naziv-kol-1, ...)
REFERENCES klauzula] [CHECK klauzula]
ALTER TABLE naziv-tabele [ADD klauzula] [DROP klauzula] [ALTER klauzula]
ADD klauzula
ADD naziv-kolone tip-podatka [DEFAULT klauzula] [def.-ograni%0ńenja-na-nivou-kolone] [BEFORE naziv-
kolone]
ADD [UNIQUE (naziv-kol-1, ...)] [PRIMARY KEY (naziv-kol-1, ...)] [FOREIGN KEY (naziv-kol-1, ...)
REFERENCES klauzula] [CHECK klauzula]
DROP klauzula
DROP COLUMN naziv-kolone
DROP CONSTRAINT naziv-ograni%0ńenja
ALTER klauzula
ALTER COLUMN naziv-kolone tip-podatka [DEFAULT klauzula] [def.-ograni%0ńenja-na-nivou-kolone]
DROP TABLE naziv-tabele
CREATE [UNIQUE][CLUSTERED|NONCLUSTERED] INDEX naziv-indeksa ON naziv-tabele (naziv-kol-1
[DESC], ...)
DROP INDEX naziv-indeksa
INSERT INTO naziv-tabele [ (naziv-kolone-1, ...) ] VALUES klauzula | SELECT iskaz
VALUES klauzula
VALUES (NULL | broj | "string" | konstanta, ...)
konstanta
USER | DATETIME | TODAY | CURRENT | ...
DELETE naziv-tabele [ WHERE uslov ]


Wyszukiwarka

Podobne podstrony:
2010 03, str 166 169
2010 03 03
2010 03 04
2010 03, str 058 064
program seminarium 2010 03 11
2010 03, str 035 039
2010 03 16id 115
2010 03, str 090 094
2010 03, str 182 187
2010 03 03
2010 03, str 096 100
2011 03 29 12 48 50
1916 03 29 Rozporządzenie policyjne Warszawa
2010 03 11015
2010 03 Tworzenie kopii obiektów [Programowanie C C ]

więcej podobnych podstron