a couple of things to think about:
first,
if you want to use a TEXT or BLOB column as an index you need to specify the length of the index.
e.g. 'PRIMARY KEY (name(20))' uses the first 20 characters as the index.
second,
PRIMARY KEY creates a unique index with a NOT NULL constraint.
UNIQUE creates a unique index that allows nulls.
so in this case PRIMARY KEY will do.
you can read more about CREATE TABLE syntax here and creating tables here
something like this should work.
Code:
CREATE TABLE people (name TEXT NOT NULL, number INT UNSIGNED NOT NULL, PRIMARY KEY (name(50)));
generally though i'd suggest using something like an AUTO_INCREMENT column to act as your primary key.
just a personal preference though.
hope this helps
Bookmarks