- Create
a New Database:
- mysql> create
database <dbname>;
- Create a New
Table in the Database:
- mysql> create table <tablename>
(field1 type(len), field2 type(len));
- ex.
mysql> create table phonebook
(name varchar(20), phone varchar(11));
- Insert
a new Record in this New Table:
- mysql> insert
into phonebook values ("Homer Simpson", "555-5594");
- Insert
data from one Table into another Table:
- mysql> insert
into <targetTable> select <column> from <sourceTable>;
- Alter: Add a
Column to a Table:
- mysql> alter
table <tablename> add column <newcolumn> char(25);
|