|
刚试了试 4#的sql 还真可以耶.但是不知道怎么从两张表查询,不用关联关键字也行。。。
#select sc.sno,sc.sname,co.cname,sc.score from score as sc inner join course as co where sc.score>90 and sc.cno=co.cno;
CREATE TABLE course
(cno INT NOT NULL,
cname VARCHAR(255))
CREATE TABLE score
(sno INT NOT NULL,
sname VARCHAR(255),
cno INT,
score INT)
INSERT INTO course (cno,cname)
VALUES
(01,'数学'),
(02,'语文'),
(03,'化学')
INSERT INTO score(sno,sname,cno,score)
VALUES
(301,'张三',1,99),
(301,'张三',2,95),
(302,'李四',1,85),
(302,'李四',2,76),
(302,'李四',3,96) |
|