Which two statements are true regarding constraints? (Choose two.)
A.
A table can have only one primary key and one foreign key.
B.
A table can have only one primary key but multiple foreign keys.
C.
Only the primary key can be defined at the column and table levels.
D.
The foreign key and parent table primary key must have the same name.
E.
Both primary key and foreign key constraints can be defined at both column and table levels.
i think option E is wrong.could anyone explain. how is it correct?
read 3 time
please read the books…
11g, SQl Fundamentals I
FK constraint: Defined at either the table level or the column level
The same for PK.
Option B:
Does this mean Primary key can be declared for only one column?
We can define primary key for more than one column.
constraint constraint_name primary_key(col1,col2);
Option B means that we can have only one Primary key for a table but can consists of one or more columns.
more than one column to together can be primary key.
is it mean that only one primary key?.i am confused .make clear any body please?
Yes, PK can consists of one of more columns. But table can have only one PK.
DEFINING PRIMARY KEY AT COLUMN LEVEL AND TABLE LEVEL:
a. Column Level
CREATE TABLE Products
(
ProductID INT CONSTRAINT pk_products_pid PRIMARY KEY,
ProductName VARCHAR(25)
);
b. Table Level
CREATE TABLE Products
(
ProductID INT,
ProductName VARCHAR(25),
CONSTRAINT pk_products_pid PRIMARY KEY(ProductID)
);
Philosophy has also given us the ability to nuance, an ability that has given us diplomacy. Diplomacy has saved he the world many times from possible conflicts. In contrast one person who said with pride that he does not nuance was George Bush. Thus he neither philosophizes. In many respects he has made the world a more dangers places because he does not nuance and therefore has not engaged much in diplomacy, that world saving activity.
http://friv.party/
Great blog.Much thanks again. Fantastic.
http://chaoticcoding.info/houses/-145404/