SQL答案
版权声明:原创作品,允许转载,转载时请务必以超链接形式标明文章 原始出处 、作者信息和本声明。否则将追究法律责任。http://allan.blog.51cto.com/332166/64438 |
1)
create table student ( 学号 int primary key, 姓名 varchar(50) not null, 年龄 int not null, 性别 varchar(2) not null, 家庭住址 varchar(50) not null, 联系电话 int not null ) 2)
alter table student add 学历 varchar(10) not null 3)
alter table student drop column 家庭住址 4)
insert into student values(1,'A',22,'男',123456,'小学') insert into student values(2,'B',21,'男',119,'中学') insert into student values(3,'C',23,'男',110,'高中') insert into student values(4,'D',18,'女',114,'大学') 5)
update student set 学历='大专' where 联系电话 like '11%' 6)
delete student where 姓名 like 'c%' and 性别='男' 7)
select 姓名,学号 where 年龄>22 and 学历='大专' 8)
select top 25% percent from student 9)
select 姓名,性别,年龄 from student order by 年龄 desc 10) select 性别,avg(年龄)as 平均年龄 group by 性别 本文出自 “ヾ火凤凰ヾ” 博客,请务必保留此出处http://allan.blog.51cto.com/332166/64438 本文出自 51CTO.COM技术博客 |


whallan
博客统计信息
热门文章
最新评论
友情链接

