SQL CONSTRAINT

  • The CHECK CONSTRAINT specifies a condition on each row in a table.
  • EXAMPLE:-
ERROR
RESULT
  • THE DEFAULT CONSTRAINT used to provide a default value to the column.
  • EXAMPLE:-
RESULT
  • NOT NULL CONSTRAINT can not accept NULL values.
  • EXAMPLE:-
ERROR
RESULT
  • The UNIQUE CONSTRAINT ensures that all value in the column is different.
  • EXAMPLE:-
ERROR
RESULT
  • The PRIMARY KEY CONSTRAINT uniquely identifies each record in a table.
  • EXAMPLE:-
ERROR
RESULT
  • A FOREIGN KEY CONSTRAINT used to link two tables together.
  • EXAMPLE:-
REVIEW 4 TABLE
REVIEW 5 TABLE
RESULT

--

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Recommended from Medium

9 Free Resources for Google Action & Alexa Skill Builders

Product Owner — a 3 min overview

The advantages of being a polyglot

Cross-Platform vs. Native Mobile Apps

20 Most Useful APIs for Managing Your Oracle Goldengate 21c Deployment

Grafana & Google Sheets Guide

Dive Deep Into Julia Types

AWS SSM Sessions Root & Non-Root Access

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Vaishali Goilkar

Vaishali Goilkar

More from Medium

What I Learned This Week (01-Mar-2022 to 07-Mar-2022)

IELTS Complicated Sentences- Easy Ways to Create & Use It in IELTS Writing

GROWTH MINDSET — FIND PURPOSE IN MY LIFE

SQL Difficult Queries