SQLite version 3.6.11
Enter ".help" for instructions
Enter SQL statements terminated with a ";"
sqlite> CREATE TABLE foo (id INTEGER PRIMARY KEY, desc TEXT, num
INTEGER DEFAULT 0);
sqlite> INSERT INTO foo (desc) VALUES ('foo');
sqlite> INSERT INTO foo (desc) VALUES ('bar');
sqlite> INSERT INTO foo (desc) VALUES ('baz');
sqlite> SELECT * FROM foo;
id          desc        num
----------  ----------  ----------
1           foo         0
2           bar         0
3           baz         0
sqlite> CREATE TABLE bar AS SELECT * FROM foo;
sqlite> .s
CREATE TABLE bar(id INTEGER,"desc" TEXT,num INTEGER);
CREATE TABLE foo (id INTEGER PRIMARY KEY, desc TEXT, num INTEGER DEFAULT 0);


Why did the definition of the column ‘num’ change? Where did the
‘DEFAULT 0’ part go in the definition of ‘num’?

-- 
Puneet Kishor http://www.punkish.org
Carbon Model http://carbonmodel.org
Charter Member, Open Source Geospatial Foundation http://www.osgeo.org
Science Commons Fellow, http://sciencecommons.org/about/whoweare/kishor
Nelson Institute, UW-Madison http://www.nelson.wisc.edu
-----------------------------------------------------------------------
Assertions are politics; backing up assertions with evidence is science
=======================================================================
Sent from Madison, WI, United States
_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to