What is difference b/w composit key n primary key and
forigion key?

Answer Posted / saraswathi muthuraman

Compost key :

More than one column will be used to create compst key

SQL> create table ts_250 (a number,b number,c number,
primary key(a,c));

Table created.

here column A and column C is used to create compst key.
U can't insert null value in both columns.
Only unique combination of column A and column B value can
be inserted.

Primary key :

Key will be created on a single column in table.

SQL> create table ts_251 (a number,b number,c number,
primary key(a));

Table created.


null value cann't be inserted into column a.
oracle will create a index
only unique value can be inserted into column a.
only one primary key can be created on a table

Is This Answer Correct ?    1 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the datatype of image?

515


What are the 5 r's of managing behaviors?

626


How to display odd rows in student table in mysql?

476


I've looked but can't find a MySQL equivalent for MS SQL's xp_cmdshell. I have 7z files that I want to unzip and load into MySQL. I'm trying to write a sp to do the unzip, but I can't find a way to do that. Can anyone provide an example of a similar process in Windows? TIA.

3446


Is mysql an oracle product?

490






What is mysql installer?

506


How to decrement dates by 1 in mysql?

520


Does mysql automatically index foreign keys?

500


What are mysql functions?

501


What is the difference between BLOB AND TEXT?

594


Write a query to fetch common records between two tables using mysql?

549


What is the data type for image?

623


How do I restore a mysql database dump file in linux?

497


How do I create a mysql database?

503


How to create table with same structure of student table in mysql?

471