I have this code, and cannot work out why I am getting issues. Can anyone help? It executes the generate sequence command, but not the create tables one, so I therefore cannot see it on the object browser.
If this helps:
- QuizID is to be generated by a sequence.
- QuizTitle, is at most 15 characters, and is not null.
- Category is to default to Music with Sports and Geography as the only other available options.
SQL code:
CREATE TABLE Quiz_NLB_2 ( QuizID NUMBER, QuizTitle VARCHAR2(15) NOT NULL, Category VARCHAR2(9) DEFAULT 'Music', CONSTRAINT pk_QuizID PRIMARY KEY (QuizID), CONSTRAINT chk_Category CHECK (Category='Music', 'Sports', 'Geography') ); CREATE SEQUENCE QuizID_Sequence_Gen START WITH 100;