Can a table have two primary keys?
Answers were Sorted based on User's Feedback
Answer / karunakar reddy
No,In the entire table,there will be only one primary key.
A primary key is nothing but a collection of one or more
coloumns used to identify a row in a table.
Is This Answer Correct ? | 110 Yes | 28 No |
Answer / dev lamani
no a table can have only one primary key.
u can make one or column to have primary key
that is called a composite primary key
Dev
ddlamani@yahoo.com
Is This Answer Correct ? | 61 Yes | 5 No |
Answer / suresh somayajula
A table can have Only One Primary key. But a table can have
composite Primary key. that means we can create composite
primary key
upto 16 columns only.
suresh.
suresh_somayajula@hotmail.com
Is This Answer Correct ? | 52 Yes | 4 No |
Answer / sankar
yes any table has only one primary key.but the basic idea
of pk is ....primary key=NOTNULL+UNIQUE KEY.which we can
give any column to a table and act as primary key
Is This Answer Correct ? | 60 Yes | 28 No |
Answer / vaibhavi_dixit
A table can have only one primary key constraint but it can
consist one or multiple columns.If a primary key is made up
of more than one columns then it is know as composite
primary key.
VD
Is This Answer Correct ? | 15 Yes | 2 No |
Answer / sowmya
Hi
A table can have only one primary key.but a primary key can
have two column fields
Ex i have a employee table.and i have fields eno,ename,esal
i can declare primarykey(esal,ename)
let me know if i am wrong
Is This Answer Correct ? | 20 Yes | 12 No |
Answer / satish reddy
Each table can have only one primary key; however, that key may consist of more than one column.
SQL> create table EMP(EMPNO Number(5),EMPNAME Varchar2(10),ADDRESS Varchar2(10),Constraint Multi_Constr
aint Primary Key(EMPNO,EMPNAME));
After creating table try to insert null value into EMPNAME Column, it will throw an error "cannot insert NULL into ("SCOTT"."EMP"."EMPNAME")"
Is This Answer Correct ? | 8 Yes | 1 No |
Answer / rahul khanke
primary key is only and only one in a table.
it may be in more column in table means
In one table --one primary key and more than one column on
the same table
Is This Answer Correct ? | 9 Yes | 4 No |
Answer / murugavel. u
ya..it's possible when, a table contains more than one
fields. we can able to set the primary for two or more..
thanks.,
Is This Answer Correct ? | 5 Yes | 2 No |
create table emp
(empno varchar2(10) constraint empnopk primary key,
e_id varchar2(10) constraint eiduk unique not null);
Is This Answer Correct ? | 7 Yes | 5 No |
In table three columns with 1 milion records(here there is no sequence values) i want add one more column with sequence values from the first how it is posible?
i have a table with fields(id,name,accnt_type)and in account type are FD,SAVING,RD. Write a query to get How many number of People are in each type of Account?
Is join an inner join?
What is rank () in sql?
What is a mutating table
What is a record in a database?
What does data normalization mean?
What is set transaction?
What is varchar data type in sql?
How do you exit in sql?
declare v_count number(8,3); v_sal scott.emp.sal%type := '&P_sal'; cursor cur_name is select sal from scott.emp where sal between (v_sal-100) and (v_sal +1000); begin v_count :=nvl(sql%rowcount ,0); if v_count = 0 then dbms_output.put_line('no records are fetch in the given sal range'); else dbms_output.put_line('There is/are '||to_char(v_count)|| ' salaries are selected in the given range '); end if; end; in the above programm .....for any sal range ....always it shows the following message.. no records are fetch in the given sal range please find the mistake and share with me...with thansk and regards..sarao....
if i perform any operation on views such as insert, delete etc will my base table get affected?????