Drop the Notes Column
mediumQuestion 22The free-text notes column on enrollments is no longer wanted. Remove it with a single ALTER TABLE statement, so that the table keeps all of its other columns and all 90 rows but notes is gone. Only a plain column can be dropped this way: SQLite will not drop a key, a UNIQUE column 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 under the question.