Select a MySQL database to use
A single instance of MySQL can hold many separate database s. It is important to specify the database to which subsequent commands will be issued.
From within the MySQL command (see Connect to a MySQL server using the MySQL command for more information), the 'use' command selects the named database for use:
use financial
This command will select the database named 'financial' for use. Subsequent SQL commands will affect this database. The use command must be used on a separate line with no additional SQL commands.
Also see ...
Create a basic MySQL table
H3Creating tables in databases is an important first step to storing data. The CREATE TABLE statement is rich and sometimes confusing. This recipe describes the basics of creating a table in MySQL./H3PCreating a table involves describing the columns and their attributes, whether they contain
H3Creating tables in databases is an important first step to storing data. The CREATE TABLE statement is rich and sometimes confusing. This recipe describes the basics of creating a table in MySQL./H3PCreating a table involves describing the columns and their attributes, whether they contain
Delete a column from an existing MySQL table
H3The SQL command in this recipe removes a column and the column's data from an existing MySQL table./H3PTo delete the column span style="font weight: bold"col_stuff/span from the table span style="font weight: bold"table_things/span, use the following SQL command: br / br /div cl
H3The SQL command in this recipe removes a column and the column's data from an existing MySQL table./H3PTo delete the column span style="font weight: bold"col_stuff/span from the table span style="font weight: bold"table_things/span, use the following SQL command: br / br /div cl
Create a MySQL table with a primary key
H3A primary key uniquely identify a row in a table. One or more columns may be identified as the primary key. The values in a single column used as the primary key must be unique (like a person's social security number). When more than one column is used, the combination of column values must b
H3A primary key uniquely identify a row in a table. One or more columns may be identified as the primary key. The values in a single column used as the primary key must be unique (like a person's social security number). When more than one column is used, the combination of column values must b
Add a column to an existing MySQL table
H3MySQL tables are easy to extend with additional columns./H3PTo add a column called span style="font weight: bold"email/span to the contacts table created in a href="mysql_tips376.html" target="_blank" class="postlink" rel="nofollow"Create a basic MySQL table/a with a datatype of VARC
H3MySQL tables are easy to extend with additional columns./H3PTo add a column called span style="font weight: bold"email/span to the contacts table created in a href="mysql_tips376.html" target="_blank" class="postlink" rel="nofollow"Create a basic MySQL table/a with a datatype of VARC
Modify an existing MySQL column
H3The best laid plans of mice and DBAs oft go awry, so it is sometimes necessary to change the characteristics of a column after it exists and contains data. Beware whenever you make changes to your database always make a backup first./H3PAfter a week of using the contacts table created in
H3The best laid plans of mice and DBAs oft go awry, so it is sometimes necessary to change the characteristics of a column after it exists and contains data. Beware whenever you make changes to your database always make a backup first./H3PAfter a week of using the contacts table created in
