Correcting teacher:查无此人
Correction status:qualified
Teacher's comments:完成的不错,继续努力
INSERT INTO `person` (`username`,`password`,`realname`,`age`,`email`,`sex`,`phone`,`mobile`,`address`,`status`)
VALUES('admin','123456','张三',25,'123456@qq.com',1,'0769-87767612','13800138000','东莞市',1);
UPDATE `person` SET `username`='zhangsan' WHERE id=1;
DELETE FROM `person` WHERE id=2;
SELECT * FROM `person` where id=1;
SELECT * FROM `student` WHERE collegeId=1 LIMIT 0,5;
内连接就是表间的主键与外键相连,只取得键值一致的,可以获取双方表中的数据连接方式
SELECT a.name,a.phone,b.collegeName
FROM `student` as a
INNER JOIN `college` as b
ON a.collegeId = b.collegeId;
左连接是以左表为标准,只查询在左边表中存在的数据,当然需要两个表中的键值一致
SELECT a. NAME,a.phone,b.collegeName
FROM`student` AS a
LEFT JOIN `college` AS b
ON a.collegeId = b.collegeId;
右连接将会以右边作为基准,进行检索
SELECT a. NAME,a.phone,b.collegeName
FROM`student` AS a
RIGHT JOIN `college` AS b
ON a.collegeId = b.collegeId;