The primary key element
Primary key specifications determine which columns of the table form the primary key.
There can only be one primary key specification per table. In the following example,
we see that state
and name
are the primary key of
the table city
.
<table id="City" lex="city,cities,town,towns"> <column id="name" type="text" lex="name,names,named,called"/> <column id="state" type="text" lex="where,located in"/> <column id="population" type="int" lex="population,populations,..."/> <primary_key key="name,state"/> </table>
The DTD definition of primary_key
is:
<!ATTLIST primary_key key CDATA #REQUIRED description CDATA #IMPLIED>
key lists the comma separated identifiers of columns that form the primary key.
Note to support the Edit functionality in the NLI Portal, the primary key must be only a single column.