mysql - Insert a new column in SQL -



mysql - Insert a new column in SQL -

i have db consisting of 4 fields.my application retrieve info db. have 1 primary key(the id).i want depending on id, provide other info organized in new table. better? create new table , search 1 time again it, or given fact have found row because of id, create new element table. illustration can create new element named info, , create array,as want 11 rows,and 2 columns info. sql code far this:

create table people ( id int not null auto_increment primary key , name varchar( 100 ) not null , sex bool not null default '1', birthyear int not null )

what changes need make? table created.

if each row in existing table needs associating 11x2 set of data, you're best off creating table.

don't seek stuff 22 items of info single field, it's bad idea.

if, however, it's always same (22 items), add together 22 fields. depends on how info going used, searched, joined on, etc.

how depends on rdbms , interface it. may easier create whole new table , re-create old info across. or environment have may allow add together columns , leg work you.

mysql

Comments

Popular posts from this blog

How do I check if an insert was successful with MySQLdb in Python? -

delphi - blogger via idHTTP : error 400 bad request -

postgresql - ERROR: operator is not unique: unknown + unknown -