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

How to get a list of all tables in a database?

580


How do you backup a database in mysql?

580


How many columns is too many mysql?

474


What is use of mysql?

493


How to Recover a MySQL root password. Stop the MySQL server process. Start again with no grant tables. Login to MySQL as root. Set new password. Exit MySQL and restart MySQL server.

534






Which is better sqlite or mysql?

496


Explain what is mysql?

588


What is row?

570


What is pdo connection?

469


How do I install mysql on windows 10?

508


What is striped backup

1827


How to use 'mysql' to run sql statements?

529


What is the difference between procedure and function in mysql?

512


What's the difference between mysql and sql server?

476


How do you rename a table in mysql?

508