How to use AND/ OR Operator in SQL?

In this article, we will talk about SQL. In the event that You realize what is AND/Or Operator, at that point it turned out to be straightforward; If you know any of the programming dialects then formally you comprehend what are these administrators and how they work. In this way, in this article, we will talk about the utilization of AND/OR administrator in SQL questions.

Essentially, AND/OR administrator is accustomed to recovering the record from the database. In the event that we give more than one conditions by utilizing AND Operator, at that point it recovers the information from the database when both the conditions are valid. Also, on the off chance that we use OR administrator it recovers information from the database in the two cases it is possible that at least one condition is valid. Here, in this example we utilize table 1 for recovering information utilizing AND, OR administrator:

Example:

Table 1:

Student_IDStudent_NameDeptBranchCourse
15011AmanGautamCSEITB.tech
15028AtulAnandCSECSB.tech
15032Bharti ParmarCSECSB.tech
15068Partha BiswasCSEITB.tech

1) We need to discover the Student_Name whose Dept is CSE and Branch is CS utilizing SQL question.

How to use AND/ OR Operator in SQL?

2) We need to discover the Student_Name whose Dept is CSE OR Branch is CS utilizing SQL question.

How to use AND/ OR Operator in SQL?

Here, in this example we utilize two table which are join by essential and outside key for recovering information utilizing AND OR administrator.

1) We need to discover the Student_Name, HOD whose Dean is R. K Sharma and Branch is CS utilizing SQL question.

How to use AND/ OR Operator in SQL?

2) We need to discover the Student_Name, Dean where HOD is shivani rajpoot utilizing SQL question.

How to use AND/ OR Operator in SQL?

In the End:

In this article, we are utilizing AND OR administrator to recover information from the database/table. Additionally, we see the example of how to recover information from the single table or more than one table. I trust you comprehend the idea; on the off chance that you have any inquiry, don’t hesitate to ask in the remark area. I will be attempting to offer you a response of your inquiry as quickly as time permits. We will find out about SQL in the up and coming article.

Leave a Comment