|
Main /
MySQLCommandsSelecting a database: mysql> USE database;
Listing databases: mysql> SHOW DATABASES;
Listing tables in a db: mysql> SHOW TABLES;
Describing the format of a table: mysql> DESCRIBE table;
Creating a database: mysql> CREATE DATABASE db_name;
Creating a table: mysql> CREATE TABLE table_name (field1_name TYPE(SIZE), field2_name TYPE(SIZE)); ->Ex: mysql> CREATE TABLE pet (name VARCHAR(20), sex CHAR(1), birth DATE); Inserting one row at a time: mysql> INSERT INTO table_name VALUES ('MyName', 'MyOwner', '2002-08-31');
(Use NULL for NULL)
INSERT INTO users VALUES ('name', 'passwprd', 'blank', '1') |