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



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

Answer / 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

More SQL PLSQL Interview Questions

I have a table .in the table 100 recored is there .we have get the single row with out using clause..

3 Answers  


How many types of sql are there?

1 Answers  


How to remove duplicate rows from a table?.

3 Answers  


How to create an array in pl/sql?

1 Answers  


What packages are available to pl/sql developers?

1 Answers  


Write a unique difference between a function and a stored procedure.

1 Answers  


Create a procedure to delete certain records from a table and display the total number of records deleted in this process. (Condition for deletion can be of ur choice, for instance delete all records where eid='')

2 Answers  


What are system versioned tables?

1 Answers  


how to check server status with 'mysqladmin'? : Sql dba

1 Answers  


What is a heap in sql?

1 Answers  


How to display Row Number with Records in Oracle SQL Plus?

1 Answers   MCN Solutions,


What do you understand by pl/sql packages?

1 Answers  


Categories