What does the term “Tuple” Mean in Relational Databases?

前端 未结 10 1886
青春惊慌失措
青春惊慌失措 2021-01-29 21:31

Please explain what is meant by tuples in sql?Thanks..

10条回答
  •  遇见更好的自我
    2021-01-29 22:12

    It's a shortened "N-tuple" (like in quadruple, quintuple etc.)

    It's a row of a rowset taken as a whole.

    If you issue:

    SELECT  col1, col2
    FROM    mytable
    

    , whole result will be a ROWSET, and each pair of col1, col2 will be a tuple.

    Some databases can work with a tuple as a whole.

    Like, you can do this:

    SELECT  col1, col2
    FROM    mytable
    WHERE   (col1, col2) =
            (
            SELECT  col3, col4
            FROM    othertable
            )
    

    , which checks that a whole tuple from one rowset matches a whole tuple from another rowset.

提交回复
热议问题