Choosing columns · اختيار الأعمدة
Picking columns
SELECT * returns every column. Usually you want only a few. Instead of *, list the columns you want, separated by commas:
The result has just those columns, in the order you wrote them.
اختيار الأعمدة
SELECT * يعيد كل عمود. عادة ما تريد بضعة عمود فقط. بدلاً من *، اذكر الأعمدة التي تريدها، مفصولة بفاصلة:
SELECT name, score FROM student;
النتيجة تحتوي فقط على تلك الأعمدة، بنفس الترتيب الذي كتبتها فيه.
Renaming a column with AS
You can rename a column in the result with AS. This does not change the table — only the heading shown:
The headings become pupil and mark. This is handy for clear reports.
إعادة تسمية عمود باستخدام AS
يمكنك إعادة تسمية عمود في النتيجة باستخدام AS. هذا لا يغير الجدول — فقط العنوان المعروض:
SELECT name AS pupil, score AS mark FROM student;
تصبح العناوين pupil وmark. هذا مفيد للتقارير الواضحة.
Common mistakes
- List the columns you want, separated by commas.
ASrenames a column in the result.
أخطاء شائعة
- اذكر الأعمدة التي تريدها، مفصولة بفاصلة.
ASيعيد تسمية عمود في النتيجة.
SELECT picks columns · SELECT يختار الأعمدة
Choosing columns keeps only the fields you name. · اختيار الأعمدة يحتفظ فقط بالمجالات التي تسميها.
Select only the name and score columns from student, in that order. · اختر فقط عمودي name وscore من student، بنفس الترتيب.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.
Select name and score, but rename the headings to pupil and mark using AS. · اختر name وscore، لكن أعد تسمية العناوين إلى pupil وmark باستخدام AS.
Click Run to see the output here. · اضغط تشغيل لرؤية المخرجات هنا.