| **Navigation:**  [[introduction.htm|Language Reference]] > 5 - Declaration Attributes > Variable and Entity Attributes >====== PRIMARY (set relational primary key) ====== | [[pre set label prefix .htm|{{btn_prev_n.gif|Previous page}}]][[introduction.htm|{{btn_home_n.gif|Return to chapter overview}}]][[private set variable private to a class module .htm|{{btn_next_n.gif|Next page}}]] | | || **PRIMARY** {{blk2blue.jpg|blk2blue.jpg}} The **PRIMARY** attribute (PROP:PRIMARY) specifies the KEY is unique, includes all records in the file, and does not allow "null" values in any of the fields comprising the KEY. This is the definition of a file's "Primary Key" per the relational database theory as expressed by E. F. Codd. **Example:** **Names   FILE,DRIVER('TopSpeed'),PRE(Nam)   !Declare a file structure** **NameKey   KEY(Nam:Name),OPT                !Declare name key, exclude blanks** **NbrKey    KEY(Nam:Number),****PRIMARY****            !Declare number key as the primary key** **Rec        RECORD** **Name        STRING(20)** **Number      SHORT** **           END** **       END** **See Also:** [[key declare dynamic file access index .htm|KEY]]