if object_id('student', 'U') is not null
drop table student
go
create table student(
sno varchar(20) not null ,
sage decimal not null,
sname varchar(20)
)
go
create nonclustered index stu_index on student(sno)
go
if(object_id('person', 'U') is not null)
drop table person
go
create table person(
sname varchar(20) not null
)
go
alter table person add primary key(sname)
go
create nonclustered index person_index on person(sname)
go
alter table student add primary key(sno, sage)
go
alter table student add foreign key(sname) references person(sname)
go