I'm just playing around with SQL for the first time at the moment and I've been trying to add new columns to an existing table for a student registry sort of deal.
I've followed a few tutorials online and they're all pointing to what I've been trying so far which is basically this:
ALTER TABLE students
ADD
allergies VARCHAR(255),
afterSchoolActivities VARCHAR(255);
Based on the stuff I've read and the tutorials I've watched, it should work, but phpmyadmin displays an error message:
1 errors were found during analysis.
Unrecognized alter operation. (near "" at position 0)
1064 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'VARCHAR(255)' at line 1
I'm pretty sure there's something here tha I'm missing, but I've been staring at this for a while and cannot seem to figure it out. Thought I'd reach out to this amazing community for help.
P.S: Apologies for the poor code formatting, I've been trying to post this question for nearly an hour indenting and trying everything else, but it just doesn't seem to work. EDIT: Somehow managed to fix it after posting.