Create a table

  1. Type/Copy the following statements on a notepad, remember to
    replace [username] by your own username without brackets.
  2. Save the file with extension as sql; for example, fruit.sql
  3. Upload the file via WinSCP to the root directory of the
    loc-cs.org server, that is, outside of public_html folder.
  4. Log into your MySQL account via PuTTY. There are two gates.
    1. The first gate has exactly same username and password as you login WinSCP.
    2. After you get into PuTTY system, you type the following command to
      get into the second gate.
      mysql -u [username] -p [username];
      Hit ENTER key and type in your MySQL password.
    3. Use command source to access the work; for example,
      source fruit.sql;
USE [username];

CREATE TABLE fruit(
id	SMALLINT UNSIGNED NOT NULL AUTO_INCREMENT,
name	VARCHAR(30) NOT NULL,
color	VARCHAR(30) NOT NULL,
PRIMARY KEY (id)
);

Use the following commands to check your table.

SHOW TABLES;
DESCRIBE fruit;