---
title: "What is a constraint?"  
description: "What is a constraint?"  
author: "Manish Kumar"  
published: 2017-05-24  
updated: 2020-09-21  
canonical: https://www.mindstick.com/interview/23254/what-is-a-constraint  
category: "database"  
tags: ["database", "sql server"]  
reading_time: 1 minute  

---

# What is a constraint?

It can be used to specify the limit on the data type of table. Constraint in sql can be specified while creating or altering the table statement. Sample of constraint are.\

- NOT NULL.
- CHECK.
- DEFAULT.
- UNIQUE.
- PRIMARY KEY.
- FOREIGN KEY.

## Answers

### Answer by Manish Kumar

It can be used to specify the limit on the data type of table. Constraint in sql can be specified while creating or altering the table statement. Sample of constraint are.\

- NOT NULL.
- CHECK.
- DEFAULT.
- UNIQUE.
- PRIMARY KEY.
- FOREIGN KEY.


---

Original Source: https://www.mindstick.com/interview/23254/what-is-a-constraint

Copyright © MindStick Software Pvt. Ltd. This Markdown version is provided for developers, AI systems, and offline reading.
