什么是投影和选择?

发布于 2024-07-25 00:47:52 字数 126 浏览 6 评论 0原文

投影和选择有什么区别? 是:

  • 投影--> 用于选择表的列; 和
  • 选择---> 选择表的行?

那么投影和选择分别是垂直和水平切片吗?

What is the difference between projection and selection? Is it:

  • Projection --> for selecting the columns of table; and
  • Selection ---> to select the rows of table?

So are projection and selection vertical and horizontal slicing respectively?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(4

夏雨凉 2024-08-01 00:47:52

确切地。

投影意味着选择查询应返回哪些列(或表达式)。

选择表示要返回哪些行

如果查询是

select a, b, c from foobar where x=3;

“a,b,c”是投影部分,“where x=3”是选择部分。

Exactly.

Projection means choosing which columns (or expressions) the query shall return.

Selection means which rows are to be returned.

if the query is

select a, b, c from foobar where x=3;

then "a, b, c" is the projection part, "where x=3" the selection part.

ˇ宁静的妩媚 2024-08-01 00:47:52

简而言之,PROJECTION 处理列的消除或选择,而SELECTION 处理行的消除或选择。

Simply PROJECTION deals with elimination or selection of columns, while SELECTION deals with elimination or selection of rows.

给不了的爱 2024-08-01 00:47:52

投影和选择是关系代数中的两个一元运算,在 RDBMS(关系数据库管理系统)中具有实际应用。

在实际意义上,投影是指从表中选择特定的列(属性),选择是指过滤行(元组)。 此外,对于传统表格,投影和选择可以称为垂直和水平切片或过滤。

维基百科通过示例提供了更正式的定义,它们有助于进一步阅读关系代数:

Projections and Selections are two unary operations in Relational Algebra and has practical applications in RDBMS (relational database management systems).

In practical sense, yes Projection means selecting specific columns (attributes) from a table and Selection means filtering rows (tuples). Also, for a conventional table, Projection and Selection can be termed as vertical and horizontal slicing or filtering.

Wikipedia provides more formal definitions of these with examples and they can be good for further reading on relational algebra:

空气里的味道 2024-08-01 00:47:52

投影:在 select 子句中输入的内容,即“列列表”或“*”或“表达式”,将成为投影下的内容。

*选择:*我们在该列上应用什么类型的条件,即获取选择的记录。

例如:

  SELECT empno,ename,dno,job from Emp 
     WHERE job='CLERK'; 

在上面的查询中,列“empno,ename,dno,job”属于投影,“where job='clerk'”属于选择

Projection: what ever typed in select clause i.e, 'column list' or '*' or 'expressions' that becomes under projection.

*selection:*what type of conditions we are applying on that columns i.e, getting the records that comes under selection.

For example:

  SELECT empno,ename,dno,job from Emp 
     WHERE job='CLERK'; 

in the above query the columns "empno,ename,dno,job" those comes under projection, "where job='clerk'" comes under selection

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文