码迷,mamicode.com
首页 > 其他好文 > 详细

Capabilities of the SELECT Statement(SELECT语句的功能):Projection(投影)、Selection(选择)、Joining(连接)

时间:2017-06-30 21:07:55      阅读:232      评论:0      收藏:0      [点我收藏+]

标签:ted   unicode   form   name   从表   row   element   single   sof   

Capabilities of the SELECT Statement(SELECT语句的功能)

Data retrieval from data base is done through appropriate and efficient use of SQL. Three concepts from relational theory encompass the capability of the SELECT statement: projection, selection, and joining.

  • Projection(投影): A project operation selects only certain columns (fields) from a table. The result table has a subset of the available columns and can include anything from a single column to all available columns. 选择列的能力
  • Selection(选择): A select operation selects a subset of rows (records) in a table (relation) that satisfy a selection condition. The ability to select rows from out of complete result set is called Selection. It involves conditional filtering and data staging. The subset can range from no rows, if none of the rows satisfy the selection condition, to all rows in a table. 从表里选择所需要的行
  • Joinin连接): A join operation combines data from two or more tables based on one or more common column values. A join operation enables an information system user to process the relationships that exist between tables. The join operation is very powerful because it allows system users to investigate relationships among data elements that might not be anticipated at the time that a database is designed. 连接多个表

Consider the above table structures. Fetching first_name name, department_id and salary for a single employee from EMPLOYEES table is Projection. Fetching employee details whose salary is less than 5000, from EMPLOYEES table is Selection. Fetching employee‘s first name, department name by joining EMPLOYEES and DEPARTMENTS is Joining.

技术分享

 

技术分享

 

Question: Identify the capabilities of SELECT statement.

  1. Projection
  2. Selection
  3. Data Control
  4. Transaction

Answer: A, B. The SELECT statement can be used for selection, projection and joining.

 

 

Capabilities of the SELECT Statement(SELECT语句的功能):Projection(投影)、Selection(选择)、Joining(连接)

标签:ted   unicode   form   name   从表   row   element   single   sof   

原文地址:http://www.cnblogs.com/scentpath/p/SELECTStatement.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!