查询某⼀年份出⽣的学⽣_sql再体验—简单查询⼤纲
1.基本查询语句
2.指定查询条件
3.注释和sql语句注意事项
4.运算符
5.字符串模糊查询
1.基本查询语句
lect <;列名1>,<;列名2>,... —lect⼦句
from <;表名>; —from⼦句
#从学⽣表查询出2列
lect 姓名,性别
from student;
#从学⽣表查询出全部列
lect *
from student;
#为列设置别名
lect 姓名 as s_name,性别 as "⼈类性别" from student;
#删除重复数据
lect distinct 姓名
from student;
#distinct ⽤在多列之前lect distinct 学号,姓名from student;
SQL语句基本规则
新东方托福词汇—以英⽂分号结尾
—不区分关键字⼤⼩写—列名不能加单引号—符号只能写英⽂符号2.指定查询条件
#设定查询条件
3.lect 姓名,学号
1.from student
save六一儿童节开场白2.where 姓名="猴⼦";
运⾏顺序
1.from从哪张表中查找数据
2.where查询出符合条件的⾏
3.从查询出的⾏中选取出lect语句指定的列
3.如何给sql写注释和常见注意事项
两会 英文>美术留学—注释有什么⽤
帮助阅读者更好地理解sql语句,特别是书写复杂sql语句的时候。⽐如过了⼀年已经忘记了写过的sql是什么意思,但是看了注释能够快速回忆起来芝加哥大学
—注释的种类
——单⾏注释
-- 查询出全部列
lect *
from student;
——多⾏注释
/*查找姓名是猴⼦学⽣的学号*/
lect 姓名,学号
from student
where 姓名="猴⼦"
——sql注意事项
lect 姓名,性别
from student;
4.运算符
算术运算符 含义
加法
— 减法
× 乘法
÷ 除法
permittivity
lect 学号,成绩,
成绩/100 as "百分⽐成绩" from score;
⽐较运算符 含义
= 相等
>< 不等于
小学英语单词> ⼤于
>= ⼤于等于
lord什么意思< ⼩于
<= ⼩于等于误吸是什么意思
lect 姓名,性别
from student
where 姓名="猴⼦";