What are SQL operators? Write about any 5 logical operators of SQL.

0
GK SIR
Mar 30, 2023 08:10 AM 0 Answers Database
Member Since Dec 2016
Subscribed Subscribe Not subscribe
Flag(0)

SQL Operator

  • An operator is a reserved word or a character that is used to specify some action to perform on the given expression
  • Used primarily in an SQL statement's WHERE clause to perform operation

Types of SQL logical operators

  • AND: The AND operator allows the existence of multiple conditions in an SQL statement's WHEREclause.E.g. SELECT * FROM student

WHERE address Kathmandu' AND section='A':

  • OR: The OR operator is used to combine multiple conditions in an SQL statement's WHERE clause. E.g. SELECT * FROM student WHERE section='A' OR section='B';
  • BETWEEN: The BETWEEN operator is used to search for values that are within a set of values,

given the minimum value and the maximum value. E.g. SELECT FROM student

WHERE marks BETWEEN 50 AND 80;

  • IN: The IN operator is used to compare a value to a list of literal values that have been specified.

E.g. SELECT FROM student WHERE address in ('Kathmandu', 'Pokhara");

  • LIKE: The LIKE operator is used to compare a value to similar values using wildcard operators.

E.g. SELECT * FROM student

WHERE address LIKE 'K*':

SQL अपरेटर

  • अपरेटर भनेका आरक्षित (reserved) शब्द हुन् जसले दिइएको expression मा कुनै कार्य प्रस्तुत गर्दछ ।
  • मुख्यतया अपरेटर WHERE क्लजसँग प्रयोग हुन्छन् ।

Sol Logical अपरेटरका प्रकार

  • AND: AND operator ले एक भन्दा बढी सर्त मान्य रहेको अवस्थालाई चेक गर्दछ ।

उदाहरण: SELECT FROM student

WHERE address Kathmandu' AND section='A':

  • OR: OR operator ले एक भन्दा बढी सर्तमा कुनै एक सर्त मान्य भएको अवस्थालाई चेक गर्दछ।SQL statement's WHERE clause.

उदाहरण:: SELECT FROM student

WHERE section 'A' OR section='B':

  • BETWEEN:यसले कुनै न्यूनतम र अधिकतम दुइटा मानबीचमा रहेका अन्य मानलाई खोज्ने र देखाउने काम गर्छ । SELECT FROM student WHERE marks BETWEEN 50 AND 80:
  • IN:यसले दिइएका सूचीमध्ये कुनै एक सर्त मान्य भएको अवस्था हेर्दछ।

उदाहरण: SELECT * FROM student

WHERE address in ('Kathmand', 'Pokhara");

  • LIKE:यसले समान खालका मानसँगग तुलना गरेर डाटा खोज्ने काम गर्छ। यसमा वाइल्ड कार्डको प्रयो गरिन्छ । उदाहरण: SELECT * FROM student WHERE address LIKE 'K*
0 Subscribers
Submit Answer
Please login to submit answer.
0 Answers
Sort By:

Leave a Reply

Your email address will not be published. Required fields are marked *

*

overlaysunnew