Hope everything going fine with you..
I have a requirement and expecting you help in this regard, if you don't mind...
I read you page on DBMS_RANDOM, But lack of depth make me less to understand it.
I have a table :
Code: Select all
CREATE TABLE QUESTION_MASTER_TAB
SUBJECT_ID VARCHAR2(5 BYTE) NOT NULL,
QUESTION_ID VARCHAR2(6 BYTE) NOT NULL,
QUESTION VARCHAR2(1000 BYTE) NOT NULL,
OPTION1 VARCHAR2(500 BYTE),
OPTION2 VARCHAR2(500 BYTE),
OPTION3 VARCHAR2(500 BYTE),
OPTION4 VARCHAR2(500 BYTE),
OPTION5 VARCHAR2(500 BYTE),
ANSWER VARCHAR2(500 BYTE) NOT NULL,
UPDATED_BY VARCHAR2(20 BYTE),
-- CONSTRAINT FK_QMT FOREIGN KEY (SUBJECT_ID) REFERENCES SUBJECT_MASTER_TAB (SUBJECT_ID),
CONSTRAINT PK_QMT PRIMARY KEY (QUESTION_ID);
From this Table based on "QUESTION_ID" I have to select the questions.
I will insert the questions for each subject will be around 200, in that 20 Questions I need to give for each attendee, where they should not match with the questions in the same time with other attendees.
First of all in Each subject I need to select 20 Questions randomly, then after Next Subject 20 questions Randomly. Same like in this way I need to give 100 - 150 Questions per exam.