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 ?    5 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

How to create a new view in mysql?

540


Is mariadb faster than mysql?

469


How to display odd rows in student table in mysql?

473


How to enter microseconds in sql statements?

525


How do I rename a table in mysql workbench?

503






Can't connect mysql server on localhost?

507


Is mysql is a programming language?

529


Write a query to fetch duplicate records from a table using mysql?

507


How can you filter the duplicate data while retrieving records from the table?

478


How to return query output in xml format?

598


What is truncate in mysql?

430


What is general log in mysql?

464


What is schema in mysql?

500


How to use triggers to track changes in mysql?

487


How to show all records starting with the letters 'sonia' and the phone number '9876543210'

523