what is primary key,unique key, foreign key? can u teach me
in simple language?
Answer Posted / nitin bisht
PRIMARY KEY: A tabLe can aontain only one PRIMARY KEY. It
Doesn't allow null values, it is used as Foreign Key In
Another Table(like Reference Key).
UNIQUE KEY: A Table may Contain one or more UNIQUE
constraints. Its aloow only one null value . Use this key We
maintain unique vales in the table.
FOREIGN KEY: A key used in one table to represent the value
of a primary key in a related table. While primary keys must
contain unique values, foreign keys may have duplicates. For
instance, if we use student ID as the primary key in a
Students table (each student has a unique ID), we could use
student ID as a foreign key in a Courses table: as each
student may do more than one course, the student ID field in
the Courses table (often shortened to Courses.student ID)
will hold duplicate values.
Is This Answer Correct ? | 123 Yes | 43 No |
Post New Answer View All Answers
What is difference between server and database?
query to Compare data of two tables between two different Databases(Oracle and SQL Server) Eg., Source Database: Oracle Table: Employee Target Database : SQL Server Table : emp
Explain file manager?
What is the difference between data source and database?
What is the Difference Primary key and Unique Key
issues involved in modeling and building data werahouses
What is the concept of Virtual field?
What does currency type mean in database?
What is sharded database?
Write a query to retrieve for many to many relationships?
How do I manually create a database?
Differentiate between delete and truncate table?
what is tkprof tool and how it is used???
What is the importance of database partitioning?
Explain the record term used in database.