What is difference b/w composit key n primary key and
forigion key?
Answers were Sorted based on User's Feedback
Answer / sathish
Assume a table contains columns
book name
author name
price
>>composite key
Having multi column primary key for a single table is known as composite key.
ex: primary composite key is book name and author name
>>primary Key
Primary key is the unique key, do not accept null value and used as a id to fetch the record from the table.
>> Foreign Key
A primary key of a table which is used as a reference key of another table..
| Is This Answer Correct ? | 16 Yes | 0 No |
Answer / 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 |
Answer / 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 |
Answer / reem
A primary key is a column which uniquely identifies the
records in a table.
A foreign key is a column (the child collumn) in a table
which has a corresponding relationship and a dependency on
another collumn (the parent collumn) that is usually in a
different table.
comosit key is more than one attribute can used as aprimary
key
| Is This Answer Correct ? | 1 Yes | 0 No |
What are the 3 main types of search queries?
How internally data stores in MyISAM and INNODB table types?
In which year mysql created?
Explain MySQL locks?
Why do we use views instead of tables?
How would you get the current date in mysql?
I have a table like this tblData (month int,Qty int) and i am inserting three rows in this table 1.tblData Values (1,100) 2.tblData Values (2,200) 3.tblData Values (3,300) The Result I want is the Running total of the field Qty that is 1 100 100 2 200 300 3 300 600 What is the Query for that ?
How we can create index in mysql?
How to get current MySQL version?
Describe mysql transaction properties.
What are the advantages of MySQL when compared with Oracle?
How many primary keys can be there in a table?
Oracle (3259)
SQL Server (4518)
MS Access (429)
MySQL (1402)
Postgre (483)
Sybase (267)
DB Architecture (141)
DB Administration (291)
DB Development (113)
SQL PLSQL (3330)
MongoDB (502)
IBM Informix (50)
Neo4j (82)
InfluxDB (0)
Apache CouchDB (44)
Firebird (5)
Database Management (1411)
Databases AllOther (288)