Email: support@essaywriterpros.com
Call Us: US - +1 845 478 5244 | UK - +44 20 7193 7850 | AUS - +61 2 8005 4826

How to Solve Relational Algebra Problems for GATE

Count

Spec:

Count(<ROW_CALL>)

Description:

Returns the number of set bits in the ROW_CALL passed in.

Result Type: int

Examples:

Query the number of bits set in a row (the number of repositories a user has starred):

Count(Row(stargazer=1))
{"results":[1]}
  • Result is the number of repositories that user 1 has starred.

Shift

Spec:

Shift(<ROW_CALL>, [n=UINT])

Description:

Returns the row specified by ROW_CALL shifted by n bits.

Result Type: object with attrs and columns

attrs will always be empty

Examples:

Query all columns with a bit set in row 1 of the field stargazer and shift the result by 2:

Shift(Row(stargazer=1), n=2)
{"attrs":{},"columns":[12, 22]}
  • columns are the repositories which user 1 has starred shifted by 2 bits.