๐‚๐จ๐ฆ๐›๐ข๐ง๐ข๐ง๐  ๐ซ๐ž๐œ๐จ๐ซ๐๐ฌ๐ž๐ญ๐ฌ ๐ข๐ง ๐Ž๐๐จ๐จ

Retrieving and Managing Sets of Database Records

๐‚๐จ๐ฆ๐›๐ข๐ง๐ข๐ง๐  ๐ซ๐ž๐œ๐จ๐ซ๐๐ฌ๐ž๐ญ๐ฌ ๐ข๐ง ๐Ž๐๐จ๐จ

Photo by NASA on Unsplash

A recordset is a collection of records that you can manipulate and interact with as a group. It represents a set of records in the database that meet certain criteria.

Example of Recordset Combination Operations

The following example demonstrates how recordset combination operations operate:

  • Suppose we have the following 3 recordsets:

      R1 = product.product(1, 2, 3, 4)
    
      R2 = product.product(3, 4, 5, 6)
    
      R3 = product.product(3)
    
  • ๐Ÿคบ ( + )

    Extend two recordsets (Duplicate Included)

      RecSets = R1 + R2
    

    Result: product.product(1, 2, 3, 4, 3, 4, 5, 6)

  • ๐Ÿคบ ( | )

    Merge Two recordsets (No duplicate)

      RecSets = R1 | R2
    

    Result: product.product(1, 2, 3, 4, 5, 6)

  • ๐Ÿคบ ( & )

    Find the records that are common between R1 and R2

      RecSets = R1 & R2
    

    Result: product.product(3, 4)

  • ๐Ÿคบ ( - )

    Records in R1 not in R2

      RecSets = R1 - R2
    

    Result: product.product(1, 2)

  • ๐Ÿคบ ( != )

    Check if both contain the same records

      R1 != R2
    

    Result: True

  • ๐Ÿคบ ( <= )

    Check if records in R3 are a subset of R1

      R3 <= R1
    

    Result: True

  • ๐Ÿคบ ( in )

    Check if R3 is part of R1 (R3 Must be one record)

      R3 in R1
    

    Result: True

We have more Python operators, such as the ones listed below: ( < , >= , == , not in )

ย