27
2020
09

以下有两个表 user表 字段id (int),name (varchar) score表 字段uid (int),subject (varchar) ,score (int) score表的uid字

1). mysql_query(“insert into user(name) values(‘test’)”);


$id = mysql_insert_id();


Mysql_query(“insert into score(uid,subjext,score) values(“.$id.”,’english’,’99’)”);


2).$sql = select uid,sunjext,score from score where uid=2 order by score desc limit 0,5;


3).select s.score from score s RIGHT JOIN user u ON u.id=s.uid where u.name=’张三;


4).delete from score where uid in(select id from user where name=’李四’);


Delete from user where name=’李四’;


5).delete from score;


6).drop table user;

« 上一篇 下一篇 »

发表评论:

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。