MySQL Basics In Pictures

Practice: Working with Tables

Task: All of the students in the hardware database are in different departments. Add a column to the students table to keep track of which department a student is in.

  1. Open the terminal window.
  2. Type:

    mysql -u root -p hardware

    then press ENTER

    to connect to the MySQL database server, then the hardware database.
  3. Type:

    textbook

    then press ENTER.
  4. In the student table, add a column named department using the ALTER command.

    The column should hold up to 50 characters: char(50).