Xiangyu.Wu
0
Q:

constraints in sql

-- Note: this is for Oracle only

select *
from USER_CONSTRAINTS
where TABLE_NAME = '<your-table-name>';
1
# The most common constraints are
NOT NULL 	 # Ensures a column cannot have a NULL value
UNIQUE 		 # Ensures all values in a column are unique
PRIMARY KEY  # Identifies a record in a table, is NOT NULL & UNIQUE
FOREIGN KEY  # References a unique record from another table
CHECK		 # Ensures all column values satisfy a condition
DEFAULT		 # Set a default value for a column if none is entered
INDEX		 # Quick way of retrieving records from database
7

New to Communities?

Join the community