Full Stack Web Development Internship Program
- 29k Enrolled Learners
- Weekend/Weekday
- Live Class
It is a constraint that ensures that every row is filled with some value for the column, which has been specified as ‘not null’.
‘create table table_name
(column1_name datatype NOT NULL,
column2_name datatype);
*here column1 datatype cannot be NULL
It is a constraint, used for column of a table so that rows of that column are unique where it allows null value also.
‘create table table_name(
Column1_name datatype UNIQUE,
Column2_name datatype);
*Here the unique column1 will take only unique values.
It is a constraint, used for a column of a table so that a row in a table could be uniquely identified.
‘create table table_name(
Column1_name datatype PRIMARY KEY,
Column_2name datatype);
In the same column one won’t find any other primary key with same value. It is used for referencing the table with the same value.
It is a constraint used to establish a relationship between two columns in the same or different tables. For a column to be defined as a Foreign Key, it should be defined as a Primary Key in the table, which it is referring. One or more columns can be defined as Foreign keys. This constraint identifies any column referencing the PRIMARY KEY in another table, which means you have the Primary Key in one table and find all the values in the second table as well. Then, that column in the second table is actually the Foreign Key of the second table.
‘create table table_name(
Column1_name datatype FOREIGN KEY,
Column_2name datatype);
Got a question for us? Mention them in the comments section and we will get back to you.
Related Posts:
edureka.co