数据库第五章理论总结

来源:互联网 发布:剑倚天下坐骑进阶数据 编辑:程序博客网 时间:2024/05/17 03:45

1数据库的查询操作分为三类:投影操作(制定查询中能显示哪些列)

 选择操作(指定哪些行出现在结果中)

 排序操作(指定查询的结果以什么结果排序)

2查询语句:select*from 表名 where +所要查询的列

3投影操作:select 列名列表from 表名

4 表前缀 如:select t_class.c_name from t_class

5列别名 如:select c_name AS ’名字’from t_class

6计算列 如:select c_age+10 from t_class wherec_age<=18

7排除重复语句  select distinct 列A from 表

    如:select distinct c_age from t_class

8 查询一个范围 如:select*from t_class where c_age between18 and 20

0 0