Select * from Student Select * From Course Select * from SC --子查询 低于总平均成绩的女同学成绩 Select Grade from Student, SC Where Student.Sno = SC.Sno and Student.Sex = '女' and Grade < (Select AVG(Grade) from SC) --(1).把低于总平均成绩的女同学成绩提高5% Update SC +0.05) From SC,…
1.查询 var v = from s in db.Set<ScoreInfo>().ToList()group s by s.subject into scoreselect new{ sub = score.Key, avg = score.Average(s => s.score), max = score.Max(s => s.score), min = score.Min(s => s.score), sum = score.Sum(s => s.score)…
一.多表的创建 from django.db import models # Create your models here. class Author(models.Model): id = models.AutoField(primary_key=True) name = models.CharField(max_length=32) age = models.IntegerField() au = models.OneToOneField(to='AuthorDetail',to_fiel…