List:General Discussion« Previous MessageNext Message »
From:Marco Kammerer Date:May 30 2001 1:34pm
Subject:inserting a colum into a existing table
View as plain text  
Hello

I am writing a programm in java that is checking my mysql db if
everything is correct, so that I can you that db later in my java
programm to write datas into it!

I am fresh to mysql, but I got everything so fare, that the prog is
able to make a no root user with the appr. rights, creates, drops
db, creates tables, drops tables but i need one more thing!

How can i add to an existing table - called t1 - in the database db1
some more columes?

I just need the mysql syntax like it will be entered :

local:~ # mysql -u root -p
Enter password:
Welcome to the MySQL monitor.  Commands end with ; or \g.
Your MySQL connection id is 1617 to server version: 3.22.32

Type 'help' for help.

mysql> use db1;
Database changed
mysql> show tables;
+---------------+
| Tables in db1 |
+---------------+
| t1                   |
+---------------+
1 row in set (0.00 sec)

mysql> select * from t1;
+-----------+------------+
| id_t1         | t1_text        |
+-----------+------------+
|         1 |      NULL |
+-----------+------------+
1 row in set (0.00 sec)

mysql> command to add colum for example t1_info!

mysql> select * from t1;
+-----------+------------+------------+
| id_t1         | t1_text        | t1_text       |
+-----------+------------+------------+
|         1 |      NULL |         NULL |
+-----------+------------+------------+
1 row in set (0.00 sec)

Sorry if this stuff is to easy for you, i am working hard to get
better :-)

Thanks Marco






Thread
inserting a colum into a existing tableMarco Kammerer30 May
  • Re: inserting a colum into a existing tableGerald Jensen30 May