Steps to create a database:

  1. Log into kirk.
  2. Create a SQL batch file (createdb.sql) with the following code:
    CREATE TABLE Friend (
      firstname VARCHAR(15),
      lastname  VARCHAR(20),
      city      VARCHAR(15),
      state     CHAR(2),
      age       INTEGER
    );
    INSERT INTO Friend VALUES (
      'Mike',
      'Nichols',
      'Tampa',
      'FL',
      19
    );
    INSERT INTO Friend VALUES (
      'John',
      'Wayne',
      'Tampa',
      'FL',
      20
    );
    
  3. Run mysql -ucs655 -pabc123 cs655 < createdb.sql
    where -u stands for the user, -p for the password, and cs655 for the database name respectively.
  4. To drop a table, you can use the following SQL batch file (droptable.sql) and run mysql -ucs655 -pabc123 cs655 < droptable.sql.
    where droptable is a file contans a line "drop table Friend;".
  5. For the Oracel database users, log into tinman and run those batch files without first two lines in this way:
    sqlplus username/password < createdb.sql.
  6. To load data file into a table, use the load command. For example,
    LOAD DATA LOCAL INFILE "Corvettes.tb" INTO TABLE Corvettes where the data in the file Corvettes.tb is loaded into the table Corvettes. For more information, please refer to 3.3.3 Loading Data into a Table of the manual of MySQL.
Note: If the table name has been taken, use another one. Table names are case-senstive in MySQL.

Some useful MySQL DBMS commands: