ore) from cj 3、查询输出所有学生的、、性别、总分,按总分降序排列。 SELECT student.no, student.name, student.sex, cj.score; from student k inner join cj on student.no = cj.no ; order by score desc 4、
查询 student 表中男生和女生各自的总人数。 select iif(student.sex,"女","男") as 性别, count(*) as 人数 from student group by sex select sum(iif(student.sex,1,0)) as 女生人数,sum(iif(not student.sex ,1,0)) as 男生人数 from student 5、查询 cj 表中各门科目的最高分和最低分。 SELECT max(sub1) ,min(sub1) ,max(sub2) , min(sub2) , max(sub3) ,min(sub3) from cj 6、查询 student 表中 deno 为”11”的学生情况,按性别排列。 SELECT no ,name,sex,deno from student where deno="11" order by sex 7、查询 student 表中各的学生总数。 select deno as , count(*) as 人数 from student group by deno 8、创建 test.dbf,字段为字符型,长度为 8,分数字段为数值型,长度为 5 含 1 位小数, 生日字段为日期型,性别字段为逻辑型。 create table test( C(8),分数 N(5,1),生日 D,性别 L) 9、修改 test 结构,删除性别字段,增加年龄字段为整型,改分数字段长度为(7,2)。 alter table test alter 分数 N(7,2) drop 性别 add 年龄 I 10、用 Insert into …Values 命令为表 test 插入两条记录,不输入年龄值。 insert into test (,分数,生日) values("张三",80, {^1980-01-01}) 11、用 update … set 命令为表 test 的年龄字段赋值。 update test set 年龄=year(date()) - year(生日) 12、删除日期型生日字段中年份大于 2000 年的记录。 delete from test where year(生日)>2000