Primary Keys can be enforced with by unique indexes or by using a UNIQUE or PRIMARY KEY constraint on the table. The first goal of your Primary Index is to identify the best access path to the data and/or join strategy in the overall data model not necessarily to enforce the integrity of the data in the table.
There are tables in DBC that will help you identify both indexes and table constraints.
If you show the definition of the table either by right clicking on the table listed in the tree view or type SHOW TABLE dbname.tablename; it will display the definition of the table with all indices including the default one which was created automatically.
In order to find the Primary key in a table, Condition for Primary Key: * the column should be not-null * it should give unique record Suppose, we are having 10 columns in a table(dw_users). choose one not-null column for eg:user_id column in dw_users table. Query to find P.K ------------------- sel user_id,count(*) from dw_users group by 1 having count(*)>1 -- give unique record means user_id is the P.k for this table.
Hello, PI and PK are different. You dont have to look for PK in physical database design cos PK is a logical datamodel term to uniquely identify a row , whereas PI is a physical database design term and it is used by amp to access/distribute rows to teradata DB. The below sql may be handy to guess your PK though : sel colname ,count(*) from DB.tablename group by 1 having count(*)>1
note: you need to try out different combo of columns if your PK is a composite one.