关于数据库:
数据库插入语句:
insert into table (col1,col2) values (v1,v2);
去数据库前十条数据
oracle: select * from table where rownum<=10;
mysql : select * from table limit 10;
sql server : select top 10 * from table;
关于数据库 某一列要计算总数:
求学生各科成绩之和:
select t.name,sum(e.score)
from student t
join exam e
on t.no=e.no
group by t.name
关于区分成绩等级:
select t.name ,e.subject,case
when e.score>=90 and e.score<100 then 'good'
when e.score>=80 and e.score<90 then 'not good'
else 'false'
end
from exam e
join student t
on e.no=t.no
删除表中所有数据;
truncate exam;