---
title: "Conjunctions and Dis-junctions in SQL Server"  
description: "Conjunctions and Disjunctions in SQL ServerThe ConjunctionsBasically the logical conjunction is used to check that two conditions are true, in logic"  
author: "Sachindra Singh"  
published: 2011-02-12  
updated: 2020-03-04  
canonical: https://www.mindstick.com/articles/444/conjunctions-and-dis-junctions-in-sql-server  
category: "database"  
tags: ["database"]  
reading_time: 2 minutes  

---

# Conjunctions and Dis-junctions in SQL Server

## Conjunctions and Disjunctions in SQL Server

##### The Conjunctions

Basically the logical conjunction is used to [check that two conditions](https://www.mindstick.com/Articles/1120/upload-file-using-ajax-form-and-modal-dialog-in-asp-dot-net-mvc) are true, in logical conjunction both conditions must be verified.

In logical conjunction, if either condition is false, the whole statement is false. For instance, you have a list of students and you want to study some statistics for your database.

You want to get a list of girls, you can filter the students based on the gender and girl’s age should be greater than 20.

I have an Employee table and I will use this table to perform an operation.

![Conjunctions and Disjunctions in SQL Server](https://www.mindstick.com/mindstickarticle/97cf613e-31f7-4118-bf14-2201dce30654/images/1c058dc9-821c-479a-bf5a-69d985c02db8.png)

To create logical conjunction in SQL Server, we use the AND operator to combine two conditions. The formula to follow is:

##### Query

```
select * from Emp
where Gender='Female'
and Age>20
```

##### Output

![Conjunctions and Disjunctions in SQL Server](https://www.mindstick.com/mindstickarticle/97cf613e-31f7-4118-bf14-2201dce30654/images/4076b263-9e7f-4d13-b3de-537cfac677bf.png)

##### Disjunctions

A logical disjunction can be performed in one field. Interpreter to find out if the field matches this or that value.

In logical disjunction, if one condition is true than the query will be executed, if the first condition is false then the OR keyword check next condition is true or not if

the condition is true query will be executed. For instance, I have one condition I want to see that record of the person who belongs to Allahabad or Varanasi city.

I have a StudentDetail table and I will use this table to perform the operation.

![Conjunctions and Disjunctions in SQL Server](https://www.mindstick.com/mindstickarticle/97cf613e-31f7-4118-bf14-2201dce30654/images/3b83fc7f-5dd1-4188-a0f2-3e763f5a6c9a.png)

\
To create a logical disjunction in SQL Server, we use the **OR** operator to combine two conditions. The formula to follow is:

##### Query

```
select *
from StudentDetail where City='Allahabad'
or City='Varanasi'
```

##### Output

![Conjunctions and Disjunctions in SQL Server](https://www.mindstick.com/mindstickarticle/97cf613e-31f7-4118-bf14-2201dce30654/images/5fdaf391-cdca-4630-9ba2-a5734510e3b4.png)

---

Original Source: https://www.mindstick.com/articles/444/conjunctions-and-dis-junctions-in-sql-server

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
