A brief MySQL tutorial
Short Description
Assuming we have a file named “president_db” in the current directory, with multiple INSERT commands in it, we can use the LOAD DATA command to insert the data into the table president.
Website: www-cse.ucsd.edu | Filesize: 22kb
No of Page(s): 18
Content
…
1) Creating a database
mysql> CREATE database 134a;
Query OK, 1 row affected (0.00 sec)
2) Deleting a database
mysql> DROP database 134a;
Query OK, 0 rows affected (0.00 sec)
3) After we have created the database we use the USE statement to
change the current database;
mysql> USE 134a;
Database changed
4) Creating a table in the database is achieved with the CREATE table
statement
mysql> CREATE TABLE president (
-> last_name varchar(15) not null,
-> first_name varchar(15) not null,
-> state varchar(2) not null,
-> city varchar(20) not null,
-> birth date not null default ‘0000-00-00′,
-> death date null
-> );
Query OK, 0 rows affected (0.00 sec)
…
Get the file Download here
Related Books:Related Searches: null state, president website, creating a table, death date, short description
Comments
Leave a Reply