Город МОСКОВСКИЙ
00:22:48

18. Constraints in SQL|Not Null,Check,Default,Unique, Primary Key, Foreign Key,Composite Key Part-2

Аватар
Python: шаг за шагом
Просмотры:
34
Дата загрузки:
03.12.2023 17:44
Длительность:
00:22:48
Категория:
Технологии и интернет

Описание

Download 300+ Real-time SQL Interview Questions with Answers: https://imojo.in/SQLQuestionsPandeyGuruji
Download Complete SQL Training Materials: https://imojo.in/sqlpandeyguruji
Enroll for SQL Training Videos, SQL Training Materials, and Important Real-time Interview Questions with Answers: https://pandeyguruji.graphy.com/courses/download-sql-training-videos-materials-and-important-interview-questions
----------------------------------------------------------------------------------------------------------------------------
Are you someone who is looking for Real-time training, visit https://pandeyguruji.graphy.com/ and join for free training materials, Link: https://bit.ly/30vrk1W
For any query Contact me on social media:
Facebook : https://www.facebook.com/mpandeyguruji/
Instagram: https://www.instagram.com/pandey_guruji/
Linkedin: https://www.linkedin.com/in/mukesh-pandey-1a151634/
Telegram: https://t.me/pandeyguruji
-------------------------------------------------------------------------------------------------------------------
SQL Tutorial for Beginners in Hindi: https://bit.ly/3CwfnGB
SQL Tutorial for Beginners in English: https://bit.ly/3qVI3GQ
SQL Live Training: https://bit.ly/3kXqOl1
Crack SQL Interview: https://bit.ly/3caxIyb
SQL Interview Questions: http://bit.ly/2CR6wCZ
Advance SQL Interview Questions: https://bit.ly/3HnMrnN
Career Guidance: https://bit.ly/3FffkRf
IT Technology News & Updates: https://bit.ly/3FeNQvc
--------------------------------------------------------------------------------------------------------------------
This Video contains In-depth coverage of Constraints in SQL. Covers all of the important queries and Constraints in SQL commands. In this videos series, you'll learn how to read and write complex queries. Handle tricky SQL interview questions. Implement complex SQL queries and answer popular interview questions on SQL. These videos series will help to crack interviews and get jobs in SQL Developer, Database Developer, Data Engineer, Reporting Analyst, Data Analyst, Data Scientist, System Analyst, Power BI Developer, Tableau Developer, BI Developer, etc.
-----------------------------------------------------------------------------------------------------------------
#Call_Now_8309569513_Realtime_One_to_One_Training #SQL #SQLTraining
Constraints
Constraints are rules and restrictions applied on a column or a table such that unwanted data
can't be inserted into tables. This ensures the accuracy and reliability of the data in the
database. We can create constraints on single or multiple columns of any table. Constraints
maintain the data integrity and accuracy in the table.
SQL Server contains the following 6 types of constraints:
● Not Null Constraint
● Check Constraint
● Default Constraint
● Unique Constraint
● Primary Key Constraint
● Foreign key Constraint
Not Null Constraint:
A Not null constraint restricts the insertion of null values into a column. If we are using a Not
Null Constraint for a column then we cannot ignore the value of this column during an insert of
data into the table.
Check Constraint:
A Check constraint checks for a specific condition before inserting data into a table. If the data
passes all the Check constraints then the data will be inserted into the table otherwise the data
for insertion will be discarded. The CHECK constraint ensures that all values in a column satisfy
certain conditions.
Default Constraint:
Specifies a default value for when a value is not specified for this column. If in an insertion
query any value is not specified for this column then the default value will be inserted into the
column.
Unique Constraint:
It ensures that each row for a column must have a unique value. It is like a Primary key but it can
accept only one null value. In a table, one or more columns can contain a Unique Constraint.
Primary Key Constraint
A Primary key constraint is applied for uniquely identifying rows in a table. It cannot contain Null
values and the rest of the table data should be unique. While creating a table if we do not
specify a name to the constraint, SQL Server automatically assigns a name to the constraint.
https://www.youtube.com/c/pandeyguruji 1-to-1 Training: https://pandeyguruji.graphy.com/
Below is an example to create a Primary Key Constraint. Column EmpID of table
EmployeeDetails is specified as Primary Key. Hence EmpID cannot have duplicate and null
values.
Foreign Key Constraint :
A Foreign Key Constraint is used to establish a relationship between two tables where one
column is a Primary Key of the table and the other column from the other table is referenced to
the Primary Key column. A Foreign Key column can also have reference to the Unique Key
column of another table.
Below are two tables EmployeeDetails and EmpSalary. EmpID of EmployeeDetails table's
Primary Key column and EmpID column of EmpSalary table is Foreign Key which references the
EmpID column of EmployeeDetails table.