← Back to Views & Indexes
Question 60
Index the Student Last Names
Index the Student Last Names
The student search looks people up by surname, so speed it up: create an index calledidx_students_last_nameon the single columnlast_nameof thestudentstable. The grader compares the index's columns, not its name, so make sure it covers exactlylast_nameand nothing else.
Expected result:
Table students ✓ id INTEGER PRIMARY KEY ✓ first_name TEXT NOT NULL ✓ last_name TEXT NOT NULL ✓ email TEXT NOT NULL ✓ major_department_id INTEGER ✓ enrollment_year INTEGER NOT NULL ✓ gpa REAL ✓ city TEXT ✓ birth_date TEXT ✓ status TEXT NOT NULL DEFAULT 'active' ✓ scholarship_amount REAL ✓ major_department_id REFERENCES departments(id) ✓ UNIQUE (email) ✓ INDEX ON (last_name)
Hints2 available
Sign in to use hintsTopics:
Views & Indexes
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.