What are projection and selection?

前端 未结 4 1205
遇见更好的自我
遇见更好的自我 2020-11-28 22:38

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

  • Projection --> for selecting the columns of table; and
  • Selection ---> to select the ro
4条回答
  •  野性不改
    2020-11-28 23:02

    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:

    • Projection: https://en.wikipedia.org/wiki/Projection_(relational_algebra)
    • Selection: https://en.wikipedia.org/wiki/Selection_(relational_algebra)
    • Relational Algebra: https://en.wikipedia.org/wiki/Relational_algebra

提交回复
热议问题