select t1.name from (select student.name,student.sno,relationship.cno from student inner join relationship on student.sno=relationship.sno) t1 where t1.cno='1001';
Insert into插入:insert into 表名(列1,列2,…) values (值1,值2,…)
如果有設(shè)置為自增的列,這一列不需要插入
插入多條:insert into 表名(列1,列2,…)values (值1,值2,…),(值1,值2,…),…
INSERT into student (name,age,sex) VALUES('張二三',18,'男');
INSERT into student (name,age,sex) VALUES('張三三',18,'男'),('張四三',18,'男'),('張五三',18,'男');
特殊插入; insert into 表名 set 列=值
INSERT into student set name='sss';
INSERT into student set name='234' where1 id=1;
Update 修改:update 表名 set 列=值,… where 列=值2。必須指定修改的行并且指定條件語(yǔ)句。