উত্তর: DBMS বা Database Management System-এর ক্ষেত্রে রিলেশনাল স্কিমা বলতে একটি relational database-এর table বা relation-এর গঠন বা structure-কে বোঝায়। এটি নির্দেশ করে যে কোনো table-এ কী কী attribute বা column থাকবে, প্রতিটি attribute-এর data type কী হবে, কোন attribute primary key হবে এবং table-গুলোর মধ্যে কী ধরনের relationship থাকবে।
রিলেশনাল স্কিমা মূলত database table-এর একটি পরিকল্পিত কাঠামো বা blueprint। এটি actual data নয়; বরং data কীভাবে table-এর মধ্যে সাজানো হবে, সেটির নিয়ম ও গঠন প্রকাশ করে।
সহজ ভাষায়: রিলেশনাল স্কিমা হলো table-এর নকশা, যেখানে table-এর নাম, column-এর নাম, key এবং relationship দেখানো হয়।
রিলেশনাল স্কিমা হলো relational database-এর একটি logical structure, যার মাধ্যমে table-এর নাম, attributes বা columns, data types, primary key, foreign key এবং constraints নির্ধারণ করা হয়। এটি database table-এর design বা blueprint হিসেবে কাজ করে।
ধরা যাক, একটি স্কুলের database তৈরি করতে হবে। সেখানে ছাত্রদের তথ্য রাখার জন্য Student নামে একটি table তৈরি করা হবে। এখন Student table-এ কী কী তথ্য রাখা হবে, যেমন Roll, Name, Class, Marks — এগুলো আগে থেকে ঠিক করতে হবে।
এই table-এর নাম, column-এর নাম এবং key কী হবে—এসব একসাথে লিখে যে structure তৈরি করা হয়, সেটিই হলো Relational Schema।
সহজ উদাহরণ: একটি স্কুলে ছাত্রদের তথ্য রাখার জন্য আমরা যদি Student table-এর structure লিখি—
Student (Roll, Name, Class, Marks)
এখানে Student হলো table বা relation-এর নাম এবং Roll, Name, Class, Marks হলো attributes বা columns। এটিই একটি relational schema-এর উদাহরণ।
রিলেশনাল স্কিমা সাধারণত নিচের format-এ লেখা হয়:
Relation_Name (Attribute1, Attribute2, Attribute3, ...)
যেমন:
Student (Roll, Name, Class, Marks)
এখানে:
ধরা যাক, একটি school database-এ তিনটি table আছে:
Student (Roll, Name, Class, Address)
Teacher (Teacher_ID, Teacher_Name, Subject)
Result (Roll, Subject, Marks)
এখানে প্রতিটি line একটি relational schema প্রকাশ করছে।
Student table-এর Roll attribute Result table-এর Roll attribute-এর সাথে সম্পর্ক তৈরি করতে পারে। এভাবে relational schema table-গুলোর মধ্যে relationship বোঝাতেও সাহায্য করে।
| Roll | Name | Class | Marks |
|---|---|---|---|
| 1 | Rahul | 10 | 85 |
| 2 | Sima | 10 | 90 |
উপরের table-টির relational schema হলো:
Student (Roll, Name, Class, Marks)
এখানে actual table-এ data আছে, কিন্তু schema শুধু table-এর structure বা design দেখায়।
| বিষয় | Relation Schema | Relation Instance |
|---|---|---|
| অর্থ | Table-এর structure বা design | Table-এর বর্তমান data |
| পরিবর্তন | সাধারণত কম পরিবর্তন হয় | Data insert, update, delete হলে পরিবর্তন হয় |
| উদাহরণ | Student (Roll, Name, Class) | Student table-এর actual rows |
| ধরন | Logical structure | Current data state |
শিক্ষক ছাত্রদের এভাবে বোঝাতে পারেন:
ধরা যাক, তোমরা একটি খাতা তৈরি করছ যেখানে ছাত্রদের তথ্য রাখা হবে। আগে ঠিক করতে হবে খাতায় কোন কোন heading থাকবে—Roll, Name, Class, Marks। এই headings বা columns আগে থেকে ঠিক করে নেওয়াই database-এর ক্ষেত্রে relational schema-এর মতো।
খাতার ভিতরে পরে ছাত্রদের actual information লেখা হবে। কিন্তু headings-গুলো হলো structure। তাই relational schema হলো table-এর headings এবং rules-এর নকশা।
প্রথমে relational schema-এর সংজ্ঞা লিখবে।
তারপর লিখবে যে এটি table-এর logical structure দেখায়।
relation name এবং attributes-এর কথা উল্লেখ করবে।
primary key, foreign key এবং constraints-এর কথা লিখলে উত্তরটি ভালো হবে।
শেষে Student (Roll, Name, Class, Marks) এই ধরনের একটি উদাহরণ দেবে।
রিলেশনাল স্কিমা হলো table-এর নকশা, যেখানে table-এর নাম, columns, keys এবং relationship দেখানো হয়।
DBMS-এর relational model-এ relational schema হলো একটি table বা relation-এর logical structure বা নকশা। এটি relation-এর নাম, attributes বা columns, data type বা domain, primary key, foreign key এবং constraints নির্দেশ করে। Relational schema actual data নয়; এটি কেবল data কীভাবে table-এ সাজানো হবে তা প্রকাশ করে। উদাহরণস্বরূপ, Student (Roll, Name, Class, Marks) একটি relational schema, যেখানে Student হলো relation name এবং Roll, Name, Class, Marks হলো attributes। এখানে Roll primary key হিসেবে ব্যবহার করা যেতে পারে। তাই relational schema database design ও data organization-এর জন্য অত্যন্ত গুরুত্বপূর্ণ।