importmysql.connector# 连接数据库conn=mysql.connector.connect(host="localhost",user="your_username",password="your_password",database="your_database")# 创建光标cursor=conn.cursor()# 执行查询query="SELECT student_id FROM students WHERE course1_score > course2_score"cursor.execute(query)# 获取结...
(select sid from sc where score<60 group by sid having count(*)>=2) group by sid; 1. 2. 3. 4. 5. 6. 6. 查询2号课程成绩比1号课程成绩低的学生的学号、姓名 (select sid,cid,score from sc where cid=1) a (select sid,cid,score from sc where cid=2) b (select a.sid from (s...