Column vs Table Primary Key constraint in a SQLite table -


i'm medling sqlite databases, , documentation :

each table in sqlite may have @ 1 primary key. if keywords primary key added column definition, primary key table consists of single column. or, if primary key clause specified table-constraint, primary key of table consists of list of columns specified part of primary key clause.

my question when there's single column used primary key, there fundamental difference between 2 following commands ?

create table t (x integer, y text ,  primary key (x));  create table t (x integer primary key, y text); 

no, there not difference (apart naming text column once y , once t). said in quote, there can difference. if need 2 or more columns primary key must use first command. personal preference use first version because think easier read.


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -