← Back to Views & Indexes
Question 58
A View of Active Students
A View of Active Students
Create a view calledactive_studentsthat lists only the students whosestatusis'active'. The view must have exactly four columns, taken straight fromstudents:id,first_name,last_nameandgpa. Leave theSELECTat the bottom of the editor in place: it shows what the view returns, sorted byid.
Expected result:
Table active_students ✓ id INTEGER ✓ first_name TEXT ✓ last_name TEXT ✓ gpa REAL +----+------------+-----------+------+ | id | first_name | last_name | gpa | +----+------------+-----------+------+ | 1 | Ava | Patel | 3.8 | | 2 | Liam | Nguyen | 3.45 | | 3 | Sophia | Rossi | 3.92 | | 4 | Noah | Kim | 2.95 | | 7 | Mia | Haddad | 3.8 | | 8 | Lucas | Fernandes | NULL | | 9 | Charlotte | Dubois | 3.67 | | 11 | Amelia | Schmidt | 3.05 | | 12 | Oliver | Brown | 2.4 | | 13 | Harper | Singh | 3.55 | +----+------------+-----------+------+ (showing 10 of 25 rows)
Hints3 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.