Jump to content
xisto Community
Sign in to follow this  
ashish17

Composite Key?

Recommended Posts

Greetings,

A composite key is a key that uses more than one column to identify the data as opposed to a single column. This can sometimes be more useful than assigning each row an arbitrary value to use as a key such as an auto number field.

For normalization I suggest you visit this site.

You may also wish to take a look at this post for a list of really useful database links.

I hope this is helpful to you.

Share this post


Link to post
Share on other sites

I am learning database and i want to know the differernce between the primary and composite keys.. and something about the normalization.. Composite Key?

Hello Ashish17,

  • This is a very basic database question which most of us get, but I think it is necessary to clarify the concept.

  • A Primary Key uniquely identifies each row in a table, it is not always a single-column key,it could be

  • a single-column key

  • or a composite key

  • A primary key can consist of one or more columns of a table. When two or more columns are used as a primary key, they are called a composite key. Each single column's data can be duplicated but the combination values of these columns cannot be duplicated.

  • For example, if you have a Student table and a Course table, and one student can select many courses and one course can be selected by many students, so this is a many-to-many relationship. So you need to create the third table to define the relationship, say it's called StudentCourse. It is important to note that you only need the StudentID and CourseID in this table as a composite key. You do not need an extra identity ID column in this table to uniquely identifies each row because only having an ID column to uniquely identifies each row is not sufficient. It cannot prevent the same student selecting the same course from being inserted into this table.

  • Normalization is the process of organizing your data and breaking it into smaller tables that are easier to manage. The primary reason we normalize a database is to prevent redundant data.

Hope this answers your question !

 

-reply by Rebecca

Share this post


Link to post
Share on other sites
primary and composite keys..Composite Key?

 Composite key:A primary key that can consists two or more than two attribute is known as Composite Key.

Primary Key:1) uniquely identify,2) no null,3)no repetition4)no duplication

-reply by Aamir khan

 

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
Sign in to follow this  

×
×
  • Create New...

Important Information

Terms of Use | Privacy Policy | Guidelines | We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.