第一次
1查询Student表中的所有记录的Sname、Ssex和Class列。
select studentName,studentSex,studentClass from student;
2以班级降序查询学生表的所有记录。
select * from student order by studentClass desc;
3查询Score表中成绩在60到80之间的所有记录
`select * from grades where gradesCJ between 60 and 80;`
4查询每门课的平均成绩
select subjectBH,avg(gradesCJ) as 平均分 from grades group by subjectBH;
5查询课程编号为1的,并且成绩高60 有同学的记录。
select * from student where studentID in
(select studentID
from grades
where grades.subjectBH =1 and grades.gradesCJ>60);
6查询"男"教师及其所上的课程。
select teacher.teacherSex,subject.subjectMC from teacher join subject where teacher.teacherSex='男' and teacher.teacherBH =subject.teacherBH;
第二次
math模块
import math
mianji=math.pi*pow(4,2)
#print(mianji)
a=round(mianji,2)
#print(a)
import random
random.random() 随机生成一个浮点数 0-1之间
a=random.random()
#print(a)
“”"
random.randint(start,stop) 随机生成一个start,stop之间的整数
随机生成一个start,stop之间的整数,包括start和stop
“”"
for i in range(10):
b=random.randint(2,9)
#print(b)
“”"
random.randrange() 随机生成一个start,stop之间的整数
random.randrange(start,stop,step) 随机生成一个start,stop之间的整数
1.random.randrange(stop) 不写start,默认是0
2.左开右闭
3.step 步长,间隔
“”"
for i in range(20):
c=random.randrange(1,10)