数据库
首页 > 数据库> > MySql(十二)Sql92和Sql99的区别

MySql(十二)Sql92和Sql99的区别

作者:互联网

sql92和sql99比较

  1. 功能方面:sql99支持的较多
  2. 可读性:sql99实现了连接条件和筛选条件的分离,因此可读性较高

进阶练习:

/**查询编号大于3的女神的男朋友信息,如果有则列出详细信息,如果没有则用null补充**/
SELECT bea.id,bea.name,b.*
FROM beauty bea
LEFT OUTER JOIN boys b
ON bea.'boyfriend_id' = b.'id'
WHERE bea.id > 3;
/**查询哪个城市没有部门**/
SELECT city
FROM location l
LEFT OUTER JOIN department d
ON l.'location_id' = d.'location_id'
WHERE d.'department_id' IS NULL;
/**查询部门名为SAL或IT的员工信息**/
SELECT e.* ,d.department_name
FROM departments d
LEFT OUTER JOIN employees e
ON d.'department_id'= e.'department_id'
WHERE d.department_name IN ('SAL','IT');

标签:sql99,bea,department,Sql99,location,MySql,Sql92,id,SELECT
来源: https://blog.csdn.net/qq_43952245/article/details/90485688