← Back to ALTER & DROP
Question 22
Drop the Notes Column
Drop the Notes Column
The free-textnotescolumn onenrollmentsis no longer wanted. Remove it with a singleALTER TABLEstatement, so that the table keeps all of its other columns and all 90 rows butnotesis gone. Only a plain column can be dropped this way: SQLite will not drop a key, aUNIQUEcolumn or one that a constraint refers to.
Expected result:
Table enrollments ✓ id INTEGER PRIMARY KEY ✓ student_id INTEGER NOT NULL ✓ course_id INTEGER NOT NULL ✓ enrolled_on TEXT NOT NULL ✓ grade REAL ✓ letter TEXT ✓ status TEXT NOT NULL DEFAULT 'enrolled' ✓ attendance_pct REAL ✓ paid INTEGER NOT NULL DEFAULT 0 ✓ course_id REFERENCES courses(id) ✓ student_id REFERENCES students(id) ✓ UNIQUE (course_id, student_id)
Hints3 available
Sign in to use hintsTopics:
ALTER & DROP
1
Tab to indent (Esc then Tab to move on) · Ctrl+Enter to run · Ctrl+Space to expand shortcuts (sel, ins, desc)
Results
Run your SQL to see every statement's output here, then how it compares with the expected answer.
Not sure what is in a table? SHOW TABLES lists them and DESCRIBE students shows the columns — or open the database browser on the left.