मैंने SQL सर्वर के लिए कभी भी "हैंड-कोडेड" ऑब्जेक्ट क्रिएशन कोड नहीं बनाया है और SQL सर्वर और पोस्टग्रेज के बीच विदेशी कुंजी घोषणा अलग-अलग प्रतीत होती है। यहाँ मेरा वर्ग अब तक है:
drop table exams;
drop table question_bank;
drop table anwser_bank;
create table exams
(
exam_id uniqueidentifier primary key,
exam_name varchar(50),
);
create table question_bank
(
question_id uniqueidentifier primary key,
question_exam_id uniqueidentifier not null,
question_text varchar(1024) not null,
question_point_value decimal,
constraint question_exam_id foreign key references exams(exam_id)
);
create table anwser_bank
(
anwser_id uniqueidentifier primary key,
anwser_question_id uniqueidentifier,
anwser_text varchar(1024),
anwser_is_correct bit
);
जब मैं क्वेरी चलाता हूं तो मुझे यह त्रुटि मिलती है:
Msg 8139, स्तर 16, राज्य 0, पंक्ति 9 विदेशी कुंजी में संदर्भित स्तंभों की संख्या संदर्भित स्तंभों की संख्या, तालिका 'question_bank' से भिन्न होती है।
क्या आप त्रुटि को देख सकते हैं?