|
Definitions More Info. | Definition ID | 522 | Title | SQL | Category | NOTES | Definition | Constraint General Example by Cuno | Definition Description | use yuksel2 go CREATE TABLE hedesi ( sno INT IDENTITY( 1000,5 ) NOT NULL CONSTRAINT pk_hedesi_sno PRIMARY KEY CLUSTERED( sno ), ad VARCHAR( 50 ) NULL, bolumad VARCHAR( 30 ) NOT NULL CONSTRAINT df_hedesi_bolumad DEFAULT( 'dahiliye' ), CONSTRAINT ck_hedesi_bolumad CHECK( bolumad = 'dahiliye' OR bolumad = 'cerahiye' OR bolumad = 'intaniye' ), fiyat MONEY NOT NULL CONSTRAINT ck_hedesi_fiyat CHECK( fiyat >= 100 AND fiyat<900 ), harftest VARCHAR( 10 ) NULL CONSTRAINT ck_hedesi_harftest CHECK ( harftest LIKE '[a-c;0-5][a-z][3-6]' ), hastano INT NOT NULL CONSTRAINT unq_hedesi_hastno UNIQUE ( hastano ) ) go insert into hedesi (ad,bolumad,fiyat,harftest,hastano) values ('cuneyd','intaniye',500,'cu4',244) insert into hedesi (ad,bolumad,fiyat,harftest,hastano) values ('mustafa','dahiliye',300,'4u4',245) insert into hedesi (ad,fiyat,harftest,hastano) values ('abdulkadir',300,'4u4',246) insert into hedesi (ad,bolumad,fiyat,harftest,hastano) values ('ayşe','cerahiye',250,'3u4',247) go select * from hedesi | RecordBy | cunay | Record Date | 04-06-2014 02:13:55 | Düzenle | | Kopyala | | Sil | | |
|
|