What is difference between UNIQUE and PRIMARY KEY constraints?

1 Answer

Answer :

A table can have only one PRIMARY KEY whereas there can be any
number of UNIQUE keys. The columns that compose PK are
automatically define NOT NULL, whereas a column that compose a
UNIQUE is not automatically defined to be mandatory must also specify
the column is NOT NULL.

Related questions

Description : What is the difference between candidate key, unique key and primary key

Last Answer : Candidate keys are the columns in the table that could be the primary keys and the primary key is the key that has been selected to identify the rows. Unique key is also useful for identifying the distinct rows in the table.)

Description : What is difference between UNIQUE constraint and PRIMARY KEY constraint ?

Last Answer : A column defined as UNIQUE can contain Nulls while a column defined as PRIMARY KEY can't contain Nulls.

Description : Describe the use of primary key and unique key constraints with example?

Last Answer : There are two Entity constraints: 1.Primary Key constraint 2. Unique Constraint 1. Primary Key constraint: It is use to avoid redundant/duplicate value entry within the row of specified column in ... TABLE PERSONS (P_ID NUM CONSTRAINT P_UK UNIQUE , FIRSTNAME VARCHAR(20), CITY VARCHAR(20) );

Description : If an unique key constraint on DATE column is created, will it validate the rows that are inserted with SYSDATE ?

Last Answer : It won't, Because SYSDATE format contains time attached with it.

Description : Give two examples of referential integrity constraints.

Last Answer : rential integrity constraints.

Description : Where the integrity constraints are stored in Data Dictionary ?

Last Answer : The integrity constraints are stored in USER_CONSTRAINTS.

Description : How will you a activate/deactivate integrity constraints ?

Last Answer : The integrity constraints can be enabled or disabled by ALTER TABLE ENABLE constraint/DISABLE constraint.

Description : What are various constraints used in SQL?

Last Answer : NULL -NOT NULL -CHECK -DEFAULT

Description : How do you control the constraints in forms ?

Last Answer : Select the use constraint property is ON Block definition screen.BLOCK

Description : What is the use of CONSTRAINTS option in EXP command ?

Last Answer : A flag to indicate whether constraints on table need to be exported.

Description : Can a primary key contain more than one columns?

Last Answer : Yes

Description : Can you disable and enable Primary key?

Last Answer : You can use the ALTER TABLE statement to enable, disable, modify, or drop a constraint. When the database is using a UNIQUE or PRIMARY KEY index to enforce a constraint, and constraints associated ... and any FOREIGN KEY constraints that depend on it: ALTER TABLE dept DISABLE PRIMARY KEY CASCADE;

Description : Write any one similarity and one difference between primary key and unique Constraint. -Technology

Last Answer : Similarity: Column with both the constraints will only take unique values.Difference: Column with Primary key constraints will not be able to hold NULL values while Column with Unique constraints will be able to hold NULL values.

Description : Write any one similarity and one difference between primary key and unique Constraint -Technology

Last Answer : Similarity: Column with both the constraints will only take unique values.Difference: Column with Primary key constraints will not be able to hold NULL values while Column with Unique constraints will be able to hold NULL values.

Description : What is the difference between unique key and primary key ?

Last Answer : Unique key can be null; Primary key cannot be null.

Description : What is difference between UNIQUE constraint and PRIMARY KEY constraint?

Last Answer : A column defined as UNIQUE can contain Nulls while a column defined as PRIMARY KEY can’t contain Nulls. 47.What is Index Cluster? – A Cluster with an index on the Cluster Key 48.When does a Transaction end? – When it is committed or Rollbacked.

Description : In an LPP, if the solution of a variable can be made infinitely large without violating the constraints, then the solution is .............................. a. Infeasible b. Alternative c. Unbounded d. Unique

Last Answer : c. Unbounded

Description : Consider the following database table : Create table test( one integer, two integer, primary key(one), unique(two), check(one≥1 and ≤10), check(two≥1 and ≤5) ); How many data records/tuples atmost can this table contain ?  (A) 5 (B) 10 (C) 15 (D) 50

Last Answer : (A) 5 

Description : What is the difference between a Function Key Trigger and Key Function Trigger ?

Last Answer : Function key triggers are associated with individual SQL*FORMS function keys You can attach Key function triggers to 10 keys or key sequences that normally do not perform any SQL * FORMS operations. These keys referred as key F0 through key F9.

Description : Which of the following are NOT key constraints of the food processing industry? a) Inadequate quality control. c) High packaging cost b) Low demand. d) Poor infrastructure as in no cold storage

Last Answer : Low demand.

Description : Based on the cardinality ratio and participation ............... associated with a relationship type, choose either the Foreign Key Design, the Cross Referencing Design or Mutual Referencing Design. (A) Entity (B) Constraints (C) Rules (D) Keys

Last Answer : (B) Constraints

Description : what are key-mode and locking mode properties? level ?

Last Answer : Key Mode : Specifies how oracle forms uniquely identifies rows in the database.This is property includes for application that will run against NON-ORACLE datasources . Key setting unique (default.) ... locks on rows that correspond to queried records in the form. a) immediate b) delayed

Description : Key Words Used in Oracle

Last Answer : The Key words that are used in Oracle are :: a) Commiting :: A transaction is said to be commited when the transaction makes permanent changes resulting from the SQL statements. b) Rollback :: ... A Process is a 'thread of control' or mechansim in Operating System that executes series of steps.

Description : What are the different types of key triggers ?

Last Answer : Function Key Key-function Key-others Key-startup

Description : Is a Key startup trigger fires as result of a operator pressing a key explicitly ?

Last Answer : No

Description : What is cluster key?

Last Answer : The related columns of the tables in a cluster are called the cluster key.

Description : What is a cluster Key ?

Last Answer : The related columns of the tables are called the cluster key. The cluster key is indexed using a cluster index and its value is stored only once for multiple tables in the cluster.

Description : What are the Referential actions supported by FOREIGN KEY integrity constraint ?

Last Answer : UPDATE and DELETE Restrict - A referential integrity rule that disallows the update or deletion of referenced data. DELETE Cascade - When a referenced row is deleted all associated dependent rows are deleted.

Description : HOW MANY SEGMENTS ARE THERE IN THE KEY FLEXFIELD(S) IN ORACLE GENERAL LEDGER?

Last Answer : - Oracle GL Key flexfield can have 15 columns each representing a segment. However, the segments type can be:  Cost Center segment  Balancing segment  Account segment  Intercompany segment

Description : WHAT IS A KEY FLEXFIELD QUALIFIER?

Last Answer : - A qualifier is a label attached to a particular key flexfield segment so it can be located by the application requiring its information. A key flexfield qualifier can be of 2 types: · Flexfield qualifiers identify a segment in a flexfield. · Segment qualifiers identify a value set in a segment.

Description : KEY AND DEXCRIPTIVE FLEXFIELD COMPARISON

Last Answer : KEY FLEXFIELD DESCRIPTIVE FLEXFIELD  Owned by one application; used by many Associated with tables in a specific ... Identifies entities Captures additional information only

Description : HOW MANY KEY FLEXFIELDS ARE THERE IN ORACLE FINANCIALS?

Last Answer : · General Ledger o Accounting Flexfield · Assets o Asset Key Flexfield o Location Flexfield o Category Flexfield · Service o Service Item Flexfield · Receivables o Territory ... Inventory o Item Categories o System Items o Sales Orders o Item Catalogs

Description : What are partial, alternate,, artificial, compound and natural key?

Last Answer : Partial Key: It is a set of attributes that can uniquely identify weak entities and that are related to same owner entity. It is sometime called as Discriminator. Alternate Key: All Candidate ... create a unique identifier for the construct is known as creating a compound key. Natural Key:

Description : What is Domain-Key Normal Form?

Last Answer : A relation is said to be in DKNF if all constraints and dependencies that should hold on the the constraint can be enforced by simply enforcing the domain constraint and key constraint on the relation.

Description : Key field is a unique identifier for each record. It is defined in the form of (a) rows (b) columns -Technology

Last Answer : (b) Key is a data item that allows you to uniquely identify individual occurrences which is defined as the column or set of columns.

Description : What’s the .NET collection class that allows an element to be accessed using a unique key? 

Last Answer : HashTable. 

Description : What’s the .NET collection class that allows an element to be accessed using a unique key?

Last Answer : HashTable.

Description : A digital signature is a. a bit string giving identity of a correspondent b. a unique identification of a sender c. an authentication of an electronic record by tying it uniquely to a key only a sender knows d. an encrypted signature of a sender 

Last Answer : c. an authentication of an electronic record by tying it uniquely to a key only a sender knows

Description : What Difference between disjoint and overlapping constraints?

Last Answer : Need answer

Description : The activities in a project must be …. a. Unique b. Primary c. Important d. None of the above

Last Answer : a. Unique

Description : Difference between SUBSTR and INSTR ?

Last Answer : INSTR (String1,String2(n,(m)),INSTR returns the position of the mth occurrence of the string 2 instring1. The search begins from nth position of string1.SUBSTR (String1 n,m)SUBSTR returns a character string of size m in string1, starting from nth position of string1.

Description : What is the difference between DBFile Sequential and Scattered Reads?(for DBA

Last Answer : Both "db file sequential read" and "db file scattered read" events signify time waited for I/O read requests to complete. Time is reported in 100's of a second for Oracle 8i releases and below, ... v_$system_event b where a.event = 'db file sequential read' and b.event = 'db file scattered read';

Description : What is the difference between static and dynamic lov

Last Answer : The static lov contains the predetermined values while the dynamic lov contains values that come at run time

Description : What is the difference between NAME_IN and COPY ?

Last Answer : Copy is package procedure and writes values into a field. Name in is a package function and returns the contents of the variable to which you apply.

Description : What is the difference between restoring and recovering? (for DBA

Last Answer : Restoring involves copying backup files from secondary storage (backup media) to disk. This can be done to replace damaged files or to copy/move a database to a new location. Recovery is the process ... as SYSDBA Sql> RECOVER DATABASE UNTIL TIME '2001-03-06:16:00:00' USING BACKUP CONTROLFILE;

Description : What is the difference between online and offline backups? (for DBA

Last Answer : A hot backup is a backup performed while the database is online and available for read/write. Except for Oracle exports, one can only do on- line backups when running in ARCHIVELOG mode. A cold backup is a backup performed while the database is off-line and unavailable to its users.

Description : What is the difference between the SQL*Loader and IMPORT utilities?

Last Answer : These two Oracle utilities are used for loading data into the database. The difference is that the import utility relies on the data being produced by another Oracle utility EXPORT while the SQL* ... from different data sources just so long as it conforms to ASCII formatted or delimited files.

Description : What is the difference between a TEMPORARY tablespace and a PERMANENT tablespace?

Last Answer : A temporary tablespace is used for temporary objects such as sort structures while permanent tablespaces are used to store those objects meant to be used as the true objects of the database.

Description : Explain the difference between a FUNCTION, PROCEDURE and PACKAGE.

Last Answer : A function and procedure are the same in that they are intended to be a collection of PL/SQL code that carries a single task. While a procedure does not have to return any ... functions and procedures that are grouped together based on their commonality to a business function or application.