← Back to Constraints
Question 70
Ticket Priority From a Fixed List
Ticket Priority From a Fixed List
Create a table calledsupport_ticketswith four columns:id(anINTEGER PRIMARY KEY),student_id(INTEGER, required),subject(TEXT, required) andpriority(TEXT, required, defaulting to'normal'). The priority may only be'low','normal'or'high': write that as aCHECKwith anINlist, so a ticket marked'urgent'is rejected while one that leaves the priority out is accepted with'normal'.
Expected result:
Table support_tickets ✓ id INTEGER PRIMARY KEY ✓ student_id INTEGER NOT NULL ✓ subject TEXT NOT NULL ✓ priority TEXT NOT NULL DEFAULT 'normal' ✓ Insert a ticket with priority 'urgent': rejected (CHECK) ✓ Insert a ticket without a priority: accepted ✓ Insert a ticket with priority 'high': accepted
Hints3 available
Sign in to use hintsTopics:
Constraints
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.