注册 | 登录 忘记密码? 51cto首页 | 博客 | 论坛 | 招聘
热点文章 子域部署Exchange服务器详..
 帮助

SQL答案


2008-03-06 16:31:32
 标签: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



上一篇 SQL题目  下一篇 QQ空间刷人参果代码



    文章评论
 
 

发表评论

昵   称:
验证码:  点击图片可刷新验证码  博客过2级,无需填写验证码
内   容: