Home > database >  Turn a newbie question about create a view
Turn a newbie question about create a view

Time:09-26

There are three table in the database:
Students table s (sno, sname, age, sex) schedule c (cno, cname, tname) course selection table sc (sno, cno, score)
20 f c1 c s1 wang shi s1 c1 80
17 m c2 db li s1 s2 hu c2 60
19 f c3 OS s3 xia li s1 c3 70
18 m c4 s4 liu shi c + + s2 c1 85
S2 c2 75
S4 c4 90
How to establish a statistical view of each student lowest grades: s_sc1 (sno, sname, min_score)
I tried several times, on PB9.0 results should not be s1 wang 60? I don't come out, have a headache, and good people to help ah, s2 hu 75
S4 liu 90

CodePudding user response:

 create view s_sc1 as 
The select s.s no, s.s name, min (sc) score) as scroe
From s, sc
Where s.s no=sc. Sno
Group by s.s no, s.s name
The order by s.s no
  • Related