TN Online TestSamacheer Kalvi practice

Structured Query Language (SQL) - Formula Sheet

Share this chapter: Telegram

Relational Algebra Operations and Formulas

Relational algebra is a procedural query language used to model relational database operations. Each formula uses specific operators and operands to produce a new relation:

1. Selection (Row Filtering)

σc(R)

2. Projection (Column Filtering)

ΠL(R)

3. Set Union

R ∪ S

4. Set Difference

R − S

5. Set Intersection

R ∩ S

6. Cartesian Product

R × S

SQL Aggregate and Calculation Formulas

Aggregate functions operate on a collection of values from a column to return a single computed value:

1. Average (AVG) Formula

AVG(A) = (Sum of all non-null values of attribute A) / (Total count of non-null values of attribute A)

2. Row Count Formula

COUNT(column_name)

Returns the total number of non-null values in the specified column, while COUNT(*) returns the total number of rows in the table (including null values).

Solved MCQs → Practice test →

More for this chapter

Book Back Questions5 textbook MCQs · solved Additional MCQs15 extra MCQs · solved Practice TestInteractive · instant score Book Back TestTest yourself on the textbook set Additional MCQ TestTest yourself on the extra set Study NotesConcepts & methods

More chapters in Computer Science

View all
1 Function 2 Data Abstraction 3 Scoping 4 Algorithmic Strategies 5 Python -Variables and Operators 6 Control Structures 7 Python functions 8 Strings and String manipulation 9 Lists, Tuples, Sets and Dictionary 10 Python Classes and objects 11 Database Concepts 13 Python and CSV files 14 Importing C++ programs in Python. 15 Data manipulation through SQL 16 Data visualization using pyplot: line chart, pie chart and bar chart