نمذجة الجداول باستخدام الذكاء الاصطناعي
صمّم schema باللغة العادية
نمذجة الجداول باستخدام الذكاء الاصطناعي درس مجاني في Vibe Coding على CoddyKit. هذا هو الدرس 3 من أصل 4. يمكنك قراءة الدرس كاملاً أدناه مجاناً — ثم تمرن عليه مباشرة في المتصفح باستخدام محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7. هذا الدرس جزء من مسار التعلم في Vibe Coding، وتقدمك يتزامن عبر الويب وتطبيق CoddyKit. تتضمن دورة Vibe Coding 4 دروس في المجموع.
بعض أجزاء هذا الدرس لم تُترجم بعد وتظهر باللغة الإنجليزية.
Tables Are Just Lists
A table is a named list of similar things. A "users" table holds users; a "posts" table holds posts.
Each table has columns that define what facts you store, and each row is one item. Modeling means deciding which tables and columns your app needs.
Columns Have Types
Every column has a type: text, number, boolean, date, and so on. Types keep your data clean. An age column should be a number, not free text.
When you describe a table to your AI, it will suggest sensible types, but you can review and correct them.
I need a table for blog posts with a title, body text, a published flag, and a created date.
Suggest the columns and the right data type for each.The Primary Key
Every row needs a unique label so you can find it again. That's the primary key, usually an auto-incrementing id or a generated UUID.
Without it, two identical rows are impossible to tell apart. Your AI will normally add an id column automatically.
Describing a Table in Words
You don't have to write schema syntax yourself. Describe the table plainly and let the AI translate it.
Be specific about each field's meaning, and the generated schema will match your intent closely.
Create a "customers" table with: a unique id, full name, email that must be unique, a phone number that's optional, and a signup timestamp.Connecting Tables
Real apps have related data: a user has many orders. We connect them with a foreign key, a column in one table that points to a row's id in another.
Describing the relationship in plain words lets the AI add the correct keys for you.
I have a "users" table and an "orders" table.
Each order belongs to one user. Add the foreign key so orders link back to the right user.One-to-Many vs. Many-to-Many
A user having many orders is one-to-many. But a student taking many courses, where each course has many students, is many-to-many and needs a joining table.
Naming the relationship type, or just describing it, helps the AI build the right structure.
Students can enroll in many courses, and each course has many students.
Design the tables to model this many-to-many relationship correctly.Required vs. Optional
Some fields must always be filled, like an email for an account. Others can be blank, like a middle name. We mark these as not null or nullable.
Spelling out which fields are required prevents broken records later, so include that detail in your prompt.
Avoid Repeating Yourself
If you find the same value copied across many rows, like a category name typed out every time, that's a sign to split it into its own table.
This is called normalization. Ask the AI to review your design and flag repeated data.
Review this schema and point out any repeated data that should be moved into its own table.
Suggest a cleaner, normalized design.Letting AI Draw the Map
Once you have a few tables, it helps to see how they connect. Ask the AI to describe the relationships as a simple diagram in text.
This catches missing links or wrong directions before you write any save-and-read code.
Summarize my schema as a text diagram showing each table and how they relate.
Call out any table that has no connection to the others.Migrations: Changing Tables Safely
Your schema will change as the app grows. A migration is a recorded change to the database structure, like adding a column.
Ask the AI to generate migrations rather than editing tables by hand, so every change is tracked and reversible.
I need to add an "is_archived" boolean column to the posts table, defaulting to false.
Generate a migration for this change.Review Before You Build
The schema is the foundation; fixing it later is harder than fixing it now. Always read the AI's proposed tables before approving.
Check the names, types, keys, and relationships. A few minutes of review saves hours of cleanup.
Quick Check
Test your understanding of modeling tables with AI.
Recap
Tables are lists with typed columns, each row identified by a primary key. Foreign keys connect tables, and you choose between one-to-many and many-to-many relationships.
Describe tables in plain words, mark required fields, normalize repeated data, and use migrations for changes. Always review the AI's schema before building. Next, you'll save and read records.
الأسئلة الشائعة
هل درس «نمذجة الجداول باستخدام الذكاء الاصطناعي» مجاني؟
نعم — نص درس «نمذجة الجداول باستخدام الذكاء الاصطناعي» كامل متاح مجاناً هنا على الويب. لتمرينه بشكل تفاعلي (محرر أكواد مدمج ومدرس ذكاء اصطناعي متاح 24/7) وفتح باقي دورة Vibe Coding، انتقل إلى CoddyKit PRO. تتضمن دورة Vibe Coding 4 دروس في المجموع.
ماذا ستتعلم في «نمذجة الجداول باستخدام الذكاء الاصطناعي»؟
صمّم schema باللغة العادية تتمرن على Vibe Coding مع أكواد عملية تشغلها مباشرة في المتصفح، ومدرس ذكاء اصطناعي متاح 24/7 يجيب على أسئلتك أثناء عملك.
هل أحتاج إلى خبرة سابقة لأبدأ Vibe Coding؟
لا تُشترط خبرة سابقة. Vibe Coding على CoddyKit منظم للمبتدئين حتى المتقدمين، لذا يمكنك البدء من هنا أو من البداية والتقدم بسرعتك الخاصة. هذا هو الدرس 3 من أصل 4.
كم من الوقت يستغرق درس «نمذجة الجداول باستخدام الذكاء الاصطناعي»؟
معظم دروس CoddyKit تستغرق حوالي 5–10 دقائق. كل منها موجز وتفاعلي، لذا تحرز تقدماً مستمراً وتستأنف من حيث توقفت عبر الويب والتطبيق.
هل يمكنني كتابة وتشغيل أكواد في درس Vibe Coding هذا؟
نعم. كل درس في Vibe Coding يتضمن محرر أكواد مدمج، لذا تكتب وتشغل أكواداً حقيقية مباشرة في متصفحك وتحصل على تعليقات فورية من الذكاء الاصطناعي — بدون إعداد محلي.
جميع الدروس في هذه الدورة
- لماذا تحتاج التطبيقات إلى البيانات
- اختيار قاعدة بيانات باستخدام prompt
- نمذجة الجداول باستخدام الذكاء الاصطناعي
- حفظ السجلات وقراءتها