adspace


What are primary key and foreign key and how they work?

Answer Posted / Mintu Kumar

"A Primary Key is a unique column or set of columns in a table that can be used to identify each row uniquely. It ensures data integrity by enforcing a constraint that requires each value in the primary key column(s) to be unique. A Foreign Key, on the other hand, is a field or set of fields in one table that refers to the Primary Key of another table. It establishes a relationship between two tables and helps maintain data integrity by enforcing referential integrity constraints."

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is inner join faster than left join?

1287


how to use regular expression in pattern match conditions? : Sql dba

1125


define sql insert statement ? : Sql dba

1110


Do we need to rebuild index after truncate?

1155


If a cursor is open, how can we find in a pl/sql block?

1252


What is the best sql course?

1064


What is your daily office routine?

2353


Can we rollback truncate?

1083


how many tables will create when we create table, what are they? : Sql dba

1156


Can we use distinct and group by together?

1147


How do I remove duplicates in two columns?

1202


what is dbms? : Sql dba

1070


what is collation? : Sql dba

1242


Is primary key always clustered index?

1101


what is schema? : Sql dba

1163