登录 注册
当前位置:主页 > 资源下载 > SQL语言基础中包括生成笛卡尔积的指令

SQL语言基础中包括生成笛卡尔积的指令

  • 更新:2024-07-07 11:19:50
  • 大小:5.26MB
  • 推荐:★★★★★
  • 来源:网友上传分享
  • 类别:Informix - 数据库
  • 格式:PPT

资源介绍

产生一个笛卡尔积 * ENAME DNAME ------ ---------- KING ACCOUNTING BLAKE ACCOUNTING ... KING RESEARCH BLAKE RESEARCH ... 56 rows selected. EMP (14 行) DEPT (4 行) EMPNO ENAME ... DEPTNO ------ ----- ... ------ 7839 KING ... 10 7698 BLAKE ... 30 ... 7934 MILLER ... 10 DEPTNO DNAME LOC ------ ---------- -------- 10 ACCOUNTING NEW YORK 20 RESEARCH DALLAS 30 SALES CHICAGO 40 OPERATIONS BOSTON “笛卡尔积 运算结果: 14*4=56行” * Cartesian Product (continued) A Cartesian product is generated if a join condition is omitted. The example on the slide displays employee name and department name from EMP and DEPT tables. Because no WHERE clause has been specified, all rows (14 rows) from the EMP table are joined with all rows (4 rows) in the DEPT table, thereby generating 56 rows in the output. Instructor Note Demo: l4cart.sql Purpose: To illustrate executing a Cartesian product. SQL> SELECT ename, dname 2 FROM emp, dept; ENAME DNAME ---------- -------------- KING ACCOUNTING BLAKE ACCOUNTING ... KING RESEARCH BLAKE RESEARCH ... 56 rows selected.