Difference between revisions of "PostgreSQL-Database/C2/Relational-Operators/English"

From Script | Spoken-Tutorial
Jump to: navigation, search
(Created page with "'''Title of the Script: Relational Operators.''' '''Authors: EduPyramids.''' '''Keywords:''' postgresql, pgadmin4, Relational operators, equal to, not equal to, greater than...")
 
 
Line 3: Line 3:
 
'''Authors: EduPyramids.'''
 
'''Authors: EduPyramids.'''
  
'''Keywords:''' postgresql, pgadmin4, Relational operators, equal to, not equal to, greater than, less than, greater than or equal to, less than or equal to, WHERE clause, edupyramids, video tutorial.
+
'''Keywords:''' postgresql, pgadmin4, Relational operators, equal to, not equal to, greater than, less than, greater than or equal to, less than or equal to, WHERE clause, EduPyramids, video tutorial.
  
 
{|border=1
 
{|border=1

Latest revision as of 15:17, 10 April 2026

Title of the Script: Relational Operators.

Authors: EduPyramids.

Keywords: postgresql, pgadmin4, Relational operators, equal to, not equal to, greater than, less than, greater than or equal to, less than or equal to, WHERE clause, EduPyramids, video tutorial.

Visual Cue Narration
Slide 1

Title Slide

Welcome to this Spoken Tutorial on Relational Operators in Postgres Q L.
Slide 2

Learning Objectives

In this tutorial, we will learn about
  • Relational operators.
Slide 3

System Requirements

  • Ubuntu 24.04 LTS
  • PostgreSQL version 18.1, and
  • PgAdmin 4 version 9.11
To record this tutorial, I am using the following setup.
Slide 4

Pre-requisites

https://EduPyramids.org

To follow this tutorial,
  • Learners should have Postgres Q L and p g Admin 4.
  • For the prerequisite Postgres Q L tutorials, please visit this website.
Slide 5

Code Files

The following code file is required to practice this tutorial:

  • ro-commands.txt

This file is provided in the Code Files link on this tutorial page.

Please download and extract the file.

The following code file is required to practice this tutorial.

This file is provided in the Code Files link of this tutorial page.

Please download and extract the file.

Let us get started.
Slide 6

Relational operators

SELECT *

FROM students

WHERE city = ‘Bhopal’;


Highlight: WHERE

Relational operators are used to compare values in a table.

They are used along with the WHERE clause to filter the records.

They return only those rows that satisfy a specified condition.

Point to the interface. I have opened the p g Admin 4 interface and connected to the localhost server.
Now let us use relational operators to execute queries with different conditions.
Type the following query:

SELECT *

FROM students

WHERE city = 'Delhi';

Highlight: WHERE city = 'Delhi';

Press the Execute query button.

Let us type this query.

In this query we will retrieve the records of students using equal to operator.

Click the Execute query icon to execute the query.

This query displays the details of the student Bindu, who resides in Delhi.

Type the following query:

SELECT *

FROM students

WHERE cgpa > 9.0;

Press the execute query button.

Next let us type this query.

Here we will retrieve the records of students whose C G P A is greater than 9 point zero.

Let us execute the query.

Output shows the details of students whose C G P A is greater than 9 point zero.

Type the following query:

SELECT *

FROM students

WHERE cgpa < 8.0;

Press the execute query button.

Next, let us type this query.

Here we will retrieve the records of students whose C G P A is less than 8 point zero.

Now execute this query to see the output.

Type the following query:

SELECT * FROM students

WHERE dob>= '1996-04-22';

Press the execute query button.

Let us now retrieve the records of students based on date of birth.

I will type the query that uses the greater than or equal to operator.

Then execute it.

The output displays all student records who were born on or after 22 April 1996.

Type the following query:

SELECT * FROM students

WHERE studentid <= 'S111';

Press the execute query button.

Next, let us retrieve the records of students whose student id is S 1 1 1 or less.

Let me type this query.

Here we have used less than or equal to operator.

Let us execute the query.

Notice the records of students in the table.

Type the following query:

SELECT *

FROM students

WHERE city <> 'Mumbai';

Press the execute query button.

Now, let us retrieve the records of students whose city is not Mumbai.

Let us type this query.

Here we have used the not equal to operator.

Now execute the query.

The output displays all students who are not from Mumbai.

With this, we come to the end of this tutorial.
Slide 7

Summary

In this tutorial, we learnt about

  • Relational operators.
Let us summarize.
Slide 8

Assignment

As an Assignment,

  • Retrieve the details of students who reside in the city Pune.
  • Display the details of students whose gender is Female.
  • Retrieve the details of students who were born before 1st January 1996.
  • Display the details of students whose student ID is not S101.
We encourage you to do this assignment.
Slide 9

This Spoken Tutorial is brought to you by EduPyramids Educational Services Private Limited, SINE, IIT Bombay.

Thank You

Thank you for joining.

Contributors and Content Editors

Ketkinaina