时间:2021-07-01 10:21:17 帮助过:21人阅读
CREATE DATABASE Test GO USE Test GO CREATE TABLE UserInfo ( Id INT IDENTITY PRIMARY KEY, Name VARCHAR(20), Age INT , Sex BIT, Address VARCHAR(200) ) GO ALTER TABLE dbo.UserInfo ADD Phone VARCHAR(11) ALTER TABLE dbo.UserInfo ADD CONSTRAINT age_c CHECK (Age>0 AND Age<200) CREATE NONCLUSTERED INDEX name_index ON dbo.UserInfo(Name) ALTER TABLE dbo.UserInfo ADD CONSTRAINT name_fk FOREIGN KEY(Name) REFERENCES CC(Name)
SQL SERVER 建库,表,索引,约束
标签:arc sql ima lte div database pre hone alter