--´´½¨±íTongXunLu
CREATE TABLE TongXunLu
(
[tName] nvarchar(30),
[tAddress] nvarchar(50),
[tEmail] varchar(50)
)
--´´½¨±í students
CREATE TABLE students
(
[sId] int IDENTITY (1, 1) primary key NOT NULL ,
[sName] varchar (50) NOT NULL ,
[sAddress] varchar (50) default 'daxing' ,
[sEmail] varchar (50) check([sEmail] like '%@%') ,
[sSex] bit NOT NULL
)
insert into students (sname,saddress,semail,ssex) values ('ÕŹûÀÏ',default,'a@a',1)
insert into [students] (sname,saddress,semail,ssex) values ('ÀîÑ°»¶',null,'b@b',1)
insert into [students] (sname,saddress,semail,ssex) values ('Áîºü³å',default,'c@c',1)
insert into [students] (sname,saddress,semail,ssex) values ('³ÌÁéËØ',null,'d@f',0)
insert into [students] (sname,saddress,semail,ssex) values ('Ц¹þ¹þ','beijing','e@e',0)
insert into [students] (sname,saddress,semail,ssex) values ('ÀֺǺÇ','neimenggu','f@f',1)
insert into [students] (sname,saddress,semail,ssex) values ('AAAAA',default,'a@a',1)
insert into [students] (sname,saddress,semail,ssex) values ('BBBBB',null,'b@b',1)
insert into [students] (sname,saddress,semail,ssex) values ('CCCCC',default,'c@c',1)
insert into [students] (sname,saddress,semail,ssex) values ('DDDDDD',null,'d@f',0)
insert into [students] (sname,saddress,semail,ssex) values ('EEEEE','beijing','e@e',0)
insert into [students] (sname,saddress,semail,ssex) values ('FFFFF','neimenggu','f@f',1)
insert into [students] (sname,saddress,semail,ssex) values ('GGGGGG',default,'a@a',1)
insert into [students] (sname,saddress,semail,ssex) values ('HHHHHH',null,'b@b',1)
insert into [students] (sname,saddress,semail,ssex) values ('IIIIII',default,'c@c',1)
insert into [students] (sname,saddress,semail,ssex) values ('JJJJJ',null,'d@f',0)
insert into [students] (sname,saddress,semail,ssex) values ('KKKKK','beijing','e@e',0)
insert into [students] (sname,saddress,semail,ssex) valu
ÕâÖÖÓ÷¨ÏàÐÅÔÚÍøÕ¾Öо³£Ê¹Óã¬ÈçÒªÔÚ±íÖÐËæ»úÈ¡³ö10Ìõ¼Ç¼£¬Èç¹ûʹÓñà³ÌÓïÑÔ½øÐÐÔËËãµÄ»°»áºÜÂé·³¶øÇÒЧÂʵÍÏ¡£ÔÚSql ServerÖÐ×Ô´øÁËrandom()º¯ÊýÓÃÓÚÉú³ÉËæ»úÊý£¬ÆäʵËü»¹×Ô´øÁËÁíÍâÒ»¸öËæ»úº¯Êýnewid();newid()ÔÚɨÃèÿÌõ¼Ç¼ʱ¶¼»áÉú³ÉÒ»¸öËæ»úµÄÖµ£º
Ö´ÐÐselect newid()£»ÔËÐнá¹û
¿ÉÒÔ¿´µ½Õâ²¢²»ÊÇÒ»¸öËæ»úµÄÊý× ......