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.
-
Open the terminal window.
-
Type:
mysql -u root -p hardware
then press ENTER
to connect to the MySQL database server, then the hardware database.
-
Type:
textbook
then press ENTER.
-
In the student table, add a column named department using the ALTER command.
The column should hold up to 50 characters: char(50).