From 397014136e7cf344698c45860c81151545c0f8d0 Mon Sep 17 00:00:00 2001 From: Randell Dawson <5313213+RandellDawson@users.noreply.github.com> Date: Thu, 20 Jun 2019 13:35:05 -0700 Subject: [PATCH] fix: converted single to triple backticks14 (#36241) --- guide/arabic/react-native/touchables/index.md | 48 +++--- guide/arabic/redux/index.md | 39 +++-- guide/arabic/redux/redux-actions/index.md | 5 +- guide/arabic/redux/redux-thunk/index.md | 19 +-- .../arabic/ruby/classes-and-objects/index.md | 5 +- .../arabic/ruby/common-array-methods/index.md | 140 +++++++++------- guide/arabic/ruby/index.md | 35 ++-- .../ruby/managing-ruby-versions/index.md | 26 +-- guide/arabic/ruby/rubocop/index.md | 34 ++-- guide/arabic/ruby/ruby-arrays/index.md | 41 +++-- guide/arabic/ruby/ruby-comments/index.md | 56 ++++--- guide/arabic/ruby/ruby-hash/index.md | 36 +++-- guide/arabic/ruby/ruby-hashes/index.md | 48 +++--- guide/arabic/ruby/ruby-methods/index.md | 27 ++-- guide/arabic/ruby/ruby-on-rails/index.md | 30 ++-- .../ruby/ruby-string-interpolation/index.md | 25 +-- .../arabic/ruby/ruby-string-methods/index.md | 5 +- guide/arabic/ruby/ruby-symbols/index.md | 108 +++++++------ guide/arabic/rust/hello-world/index.md | 21 +-- guide/arabic/rust/index.md | 15 +- guide/arabic/rust/loops/index.md | 49 +++--- guide/arabic/security/oauth2/index.md | 114 +++++++------- .../security/query-parameterization/index.md | 50 +++--- guide/arabic/security/scanning/index.md | 30 ++-- guide/arabic/security/steganography/index.md | 11 +- guide/arabic/semantic-ui/index.md | 29 ++-- .../semantic-ui/semantic-ui-buttons/index.md | 77 +++++---- .../design-patterns/builder/index.md | 119 +++++++------- .../design-patterns/decorator/index.md | 59 +++---- .../design-patterns/factory/index.md | 23 +-- .../design-patterns/singleton/index.md | 48 +++--- .../functional-programming/index.md | 9 +- .../software-engineering/unit-tests/index.md | 26 +-- guide/arabic/sql/sql-aliases/index.md | 72 +++++---- guide/arabic/sql/sql-and-operator/index.md | 21 +-- guide/arabic/sql/sql-avg-function/index.md | 18 ++- .../arabic/sql/sql-between-operator/index.md | 24 +-- .../arabic/sql/sql-check-constraint/index.md | 79 +++++----- guide/arabic/sql/sql-count-function/index.md | 21 +-- .../sql/sql-create-index-statement/index.md | 14 +- guide/arabic/sql/sql-create-index/index.md | 48 +++--- .../sql/sql-create-table-statement/index.md | 22 +-- guide/arabic/sql/sql-create-table/index.md | 5 +- .../sql/sql-create-view-statement/index.md | 9 +- guide/arabic/sql/sql-date-functions/index.md | 39 ++--- .../arabic/sql/sql-delete-statement/index.md | 26 +-- .../sql/sql-drop-view-statement/index.md | 12 +- .../sql/sql-foreign-key-constraint/index.md | 92 ++++++----- .../sql/sql-group-by-statement/index.md | 42 ++--- guide/arabic/sql/sql-having-clause/index.md | 42 ++--- guide/arabic/sql/sql-in-operator/index.md | 66 ++++---- guide/arabic/sql/sql-injection/index.md | 7 +- .../sql/sql-inner-join-keyword/index.md | 14 +- .../sql-insert-into-select-statement/index.md | 11 +- .../sql/sql-insert-into-statement/index.md | 14 +- .../sql/sql-interview-questions/index.md | 60 +++---- guide/arabic/sql/sql-joins/index.md | 65 ++++---- .../arabic/sql/sql-left-join-keyword/index.md | 12 +- guide/arabic/sql/sql-like-operator/index.md | 97 ++++++------ guide/arabic/sql/sql-not-operator/index.md | 9 +- guide/arabic/sql/sql-or-operator/index.md | 18 ++- .../arabic/sql/sql-order-by-keyword/index.md | 76 ++++----- .../sql/sql-primary-key-constraint/index.md | 20 +-- .../sql/sql-replace-view-statement/index.md | 100 ++++++------ .../sql/sql-right-join-keyword/index.md | 54 ++++--- .../sql-select-distinct-statement/index.md | 62 ++++---- .../arabic/sql/sql-select-statement/index.md | 38 ++--- guide/arabic/sql/sql-sum-function/index.md | 42 ++--- guide/arabic/sql/sql-syntax/index.md | 5 +- guide/arabic/sql/sql-union-operator/index.md | 45 +++--- guide/arabic/sql/sql-update-query/index.md | 149 +++++++++--------- .../arabic/sql/sql-update-statement/index.md | 44 +++--- guide/arabic/sql/sql-where-clause/index.md | 72 +++++---- .../ssh/managing-multiple-ssh-keys/index.md | 121 +++++++------- guide/arabic/svg/index.md | 94 +++++------ 75 files changed, 1782 insertions(+), 1506 deletions(-) diff --git a/guide/arabic/react-native/touchables/index.md b/guide/arabic/react-native/touchables/index.md index 08bc830570..401cc228b4 100644 --- a/guide/arabic/react-native/touchables/index.md +++ b/guide/arabic/react-native/touchables/index.md @@ -8,38 +8,42 @@ localeTitle: ملموس React Native ships مع عنصر `Button` يعمل مع العديد من تفاعلات `onPress` القياسية. بشكل افتراضي ، فإنه يعطي ملاحظات المستخدم عن طريق تغيير العتامة لإظهار الضغط على الزر. الاستعمال: - ` -` +``` + +``` * التركيز على زر زر مع مستوى مختلف من التركيز - ` -` +``` + +``` ما سبق هو مجرد رمز الكاميرا @@ -67,37 +72,41 @@ localeTitle: أزرار واجهة المستخدم الدلالية يمكن أن توجد أزرار واجهة المستخدم الدلالية في مجموعة - `
- - - -
-` +``` +
+ + + +
+``` #### يحتوى يمكن أن تحتوي أزرار واجهة المستخدم الدلالية على شرطية - `
- -
- -
-` +``` +
+ +
+ +
+``` #### تنص على يمكن أن توجد أزرار واجهة المستخدم الدلالية في حالات مختلفة ، `active` ، `disabled` ، `loading` . ببساطة إضافة اسم الدولة إلى `class` سمة `of` \`العنصر. - ` -` +``` + +``` #### الاختلافات توجد أزرار UI الدلالي في مجموعة متنوعة من الأحجام، `mini` ، `tiny` ، `small` ، `medium` ، `large` ، `big` ، `huge` ، و `massive` . - ` -` +``` + +``` هناك الكثير حول أزرار UI الدلالية ، قم بزيارة الرابط المقدم في قسم "مزيد من المعلومات" لمعرفة المزيد. diff --git a/guide/arabic/software-engineering/design-patterns/builder/index.md b/guide/arabic/software-engineering/design-patterns/builder/index.md index 843a935bee..33a7737b69 100644 --- a/guide/arabic/software-engineering/design-patterns/builder/index.md +++ b/guide/arabic/software-engineering/design-patterns/builder/index.md @@ -8,62 +8,63 @@ localeTitle: باني هنا مثال على تنفيذ Builder Pattern في Python3. - `# Builder - class CourseBuilder(object): - def __init__(self, teacher): - self.teacher = teacher - - def build_course(self): - self.teacher.provide_homework() - self.teacher.provide_exam() - return self.teacher.course - - # Teacher - class Teacher(object): - def __init__(self, name=None): - self.name = name - self.course = Course() - - def provide_homework(self): - raise NotImplementedError - - def provide_exam(self): - raise NotImplementedError - - - class MathTeacher(Teacher): - def provide_homework(self): - self.course.homework = 'This is Math homework provided by {}.'.format(self.name) - - def provide_exam(self): - self.course.exam = 'This is Math exam tested by {}.'.format(self.name) - - - class HistoryTeacher(Teacher): - def provide_homework(self): - self.course.homework = 'This is History homework provided by {}.'.format(self.name) - - def provide_exam(self): - self.course.exam = 'This is History exam tested by {}.'.format(self.name) - - - # Target objects to be produced - class Course(object): - def __init__(self): - self.homework = None - self.exam = None - - def __str__(self): - return 'Homework: {}\nExam: {}\n'.format(self.homework, self.exam) - - - math_course = CourseBuilder(MathTeacher('Harry')).build_course() - print(math_course) - >>> Homework: This is Math homework provided by Harry. - >>> Exam: This is Math exam tested by Harry. - - history_course = CourseBuilder(HistoryTeacher('Potter')).build_course() - print(history_course) - >>> Homework: This is History homework provided by Potter. - >>> Exam: This is History exam tested by Potter. -` \ No newline at end of file +```python +# Builder +class CourseBuilder(object): + def __init__(self, teacher): + self.teacher = teacher + + def build_course(self): + self.teacher.provide_homework() + self.teacher.provide_exam() + return self.teacher.course + +# Teacher +class Teacher(object): + def __init__(self, name=None): + self.name = name + self.course = Course() + + def provide_homework(self): + raise NotImplementedError + + def provide_exam(self): + raise NotImplementedError + + +class MathTeacher(Teacher): + def provide_homework(self): + self.course.homework = 'This is Math homework provided by {}.'.format(self.name) + + def provide_exam(self): + self.course.exam = 'This is Math exam tested by {}.'.format(self.name) + + +class HistoryTeacher(Teacher): + def provide_homework(self): + self.course.homework = 'This is History homework provided by {}.'.format(self.name) + + def provide_exam(self): + self.course.exam = 'This is History exam tested by {}.'.format(self.name) + + +# Target objects to be produced +class Course(object): + def __init__(self): + self.homework = None + self.exam = None + + def __str__(self): + return 'Homework: {}\nExam: {}\n'.format(self.homework, self.exam) + + +math_course = CourseBuilder(MathTeacher('Harry')).build_course() +print(math_course) +>>> Homework: This is Math homework provided by Harry. +>>> Exam: This is Math exam tested by Harry. + +history_course = CourseBuilder(HistoryTeacher('Potter')).build_course() +print(history_course) +>>> Homework: This is History homework provided by Potter. +>>> Exam: This is History exam tested by Potter. +``` \ No newline at end of file diff --git a/guide/arabic/software-engineering/design-patterns/decorator/index.md b/guide/arabic/software-engineering/design-patterns/decorator/index.md index 85f8b33487..437c8fe2f3 100644 --- a/guide/arabic/software-engineering/design-patterns/decorator/index.md +++ b/guide/arabic/software-engineering/design-patterns/decorator/index.md @@ -8,32 +8,33 @@ localeTitle: مزخرف هنا مثال على تنفيذ Decorator في Python3. - `class MyText(object): - def __init__(self, text=''): - self.text = text - - def __str__(self): - return 'This is {}'.format(self.text) - - - class BracketDecorator(object): - def __init__(self, decoratee): - self._decoratee = decoratee - - def __str__(self): - return '({})'.format(self._decoratee) - - - class QuoteDecorator(object): - def __init__(self, decoratee): - self._decoratee = decoratee - - def __str__(self): - return '\"{}\"'.format(self._decoratee) - - - print(BracketDecorator(MyText('apple'))) - >>> (This is apple) - print(QuoteDecorator(MyText('banana'))) - >>> "This is banana" -` \ No newline at end of file +```python +class MyText(object): + def __init__(self, text=''): + self.text = text + + def __str__(self): + return 'This is {}'.format(self.text) + + +class BracketDecorator(object): + def __init__(self, decoratee): + self._decoratee = decoratee + + def __str__(self): + return '({})'.format(self._decoratee) + + +class QuoteDecorator(object): + def __init__(self, decoratee): + self._decoratee = decoratee + + def __str__(self): + return '\"{}\"'.format(self._decoratee) + + +print(BracketDecorator(MyText('apple'))) +>>> (This is apple) +print(QuoteDecorator(MyText('banana'))) +>>> "This is banana" +``` \ No newline at end of file diff --git a/guide/arabic/software-engineering/design-patterns/factory/index.md b/guide/arabic/software-engineering/design-patterns/factory/index.md index 3adf138715..742ac3c14e 100644 --- a/guide/arabic/software-engineering/design-patterns/factory/index.md +++ b/guide/arabic/software-engineering/design-patterns/factory/index.md @@ -13,8 +13,9 @@ localeTitle: مصنع \`\` \` الواجهة العامة Animal { الفراغ الحديث () ؛ } - `We now need to have "concrete classes" - classes which implement our interface and define the associated functions/ variables. -` +``` +We now need to have "concrete classes" - classes which implement our interface and define the associated functions/ variables. +``` `public class Dog implements Animal { @@ -34,8 +35,9 @@ localeTitle: مصنع } ` - `We now define our "AnimalFactory" - the class which will handle the creation of these classes. -` +``` +We now define our "AnimalFactory" - the class which will handle the creation of these classes. +``` `public class AnimalFactory { @@ -59,12 +61,13 @@ localeTitle: مصنع cat.talk(); ` - `Here we can see that the class with this instance of "Cat" doesn't really know which animal it has. But this doesn't matter - because all the classes the factory creates are concrete classes of the same interface, the parent class doesn't need to know the exact class it is using. - - - ## Factory in Python3 - We can implement a Factory easily with static methods. -` +``` +Here we can see that the class with this instance of "Cat" doesn't really know which animal it has. But this doesn't matter - because all the classes the factory creates are concrete classes of the same interface, the parent class doesn't need to know the exact class it is using. + + +## Factory in Python3 +We can implement a Factory easily with static methods. +``` الثعبان فئة الشراب (الكائن): def **init** (self، name، price = None): self.name = الاسم self.price = السعر diff --git a/guide/arabic/software-engineering/design-patterns/singleton/index.md b/guide/arabic/software-engineering/design-patterns/singleton/index.md index 4a101d7acd..b77b8ff50b 100644 --- a/guide/arabic/software-engineering/design-patterns/singleton/index.md +++ b/guide/arabic/software-engineering/design-patterns/singleton/index.md @@ -92,32 +92,34 @@ Singleton هو نمط تصميم غالبًا ما يستخدم في Android. ي يمكننا استخدام metaclass لتطبيق Singleton في Python3. - `class Singleton(type): - # Mapping from a class to its singleton instance - _instances = {} - - def __call__(cls, *args, **kwargs): - if cls not in Singleton._instances: - Singleton._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) - - return Singleton._instances[cls] - - - class MyClass(metaclass=Singleton): - pass -` +```python +class Singleton(type): + # Mapping from a class to its singleton instance + _instances = {} + + def __call__(cls, *args, **kwargs): + if cls not in Singleton._instances: + Singleton._instances[cls] = super(Singleton, cls).__call__(*args, **kwargs) + + return Singleton._instances[cls] + + +class MyClass(metaclass=Singleton): + pass +``` ### اختبارات - `obj_0 = MyClass() - obj_1 = MyClass() - - In [2]: obj_0 - Out[2]: <__main__.MyClass at 0x111130da0> - - In [3]: obj_1 - Out[3]: <__main__.MyClass at 0x111130da0> -` +```python +obj_0 = MyClass() +obj_1 = MyClass() + +In [2]: obj_0 +Out[2]: <__main__.MyClass at 0x111130da0> + +In [3]: obj_1 +Out[3]: <__main__.MyClass at 0x111130da0> +``` ## سينجلتون في دائرة الرقابة الداخلية diff --git a/guide/arabic/software-engineering/functional-programming/index.md b/guide/arabic/software-engineering/functional-programming/index.md index a4a1619b02..28099141d8 100644 --- a/guide/arabic/software-engineering/functional-programming/index.md +++ b/guide/arabic/software-engineering/functional-programming/index.md @@ -30,10 +30,11 @@ localeTitle: برمجة وظيفية في ما يلي مثال على `map` : - `const myList = [6, 3, 5, 29]; - - let squares = myList.map(num => num * num); // [36, 9, 25, 841] -` +```javascript +const myList = [6, 3, 5, 29]; + +let squares = myList.map(num => num * num); // [36, 9, 25, 841] +``` ### معلومات اكثر: diff --git a/guide/arabic/software-engineering/unit-tests/index.md b/guide/arabic/software-engineering/unit-tests/index.md index 71502727d8..62ec79f5db 100644 --- a/guide/arabic/software-engineering/unit-tests/index.md +++ b/guide/arabic/software-engineering/unit-tests/index.md @@ -20,21 +20,23 @@ localeTitle: اختبارات الوحدة افترض أن هناك وظيفة مكتوبة في ملف **add.js** - `var add = function(number1, number2){ - return number1 + number2; - } -` +```javascript +var add = function(number1, number2){ + return number1 + number2; +} +``` الآن ، من أجل كتابة اختبار الوحدة لهذه الوظيفة تحديدًا ، يمكننا استخدام أدوات الاختبار مثل [mocha](http://mochajs.org/) - `const mocha = require('mocha') - const chai = require('chai') // It is an assertion library - describe('Test to check add function', function(){ - it('should add two numbers', function(){ - (add(2,3)).should.equal(5) //Checking that 2+3 should equal 5 using the given add function - }); - }); -` +```javascript +const mocha = require('mocha') +const chai = require('chai') // It is an assertion library +describe('Test to check add function', function(){ + it('should add two numbers', function(){ + (add(2,3)).should.equal(5) //Checking that 2+3 should equal 5 using the given add function + }); +}); +``` ### التطوير المدفوع بالاختبارات diff --git a/guide/arabic/sql/sql-aliases/index.md b/guide/arabic/sql/sql-aliases/index.md index 9874f55fcf..645c399c13 100644 --- a/guide/arabic/sql/sql-aliases/index.md +++ b/guide/arabic/sql/sql-aliases/index.md @@ -8,46 +8,50 @@ localeTitle: الأسماء المستعارة SQL يمكنك استخدام AS لتعيين اسم لعمود البيانات الذي تقوم بتحديده أو الذي تم حسابه. - `SELECT user_only_num1 AS AgeOfServer, (user_only_num1 - warranty_period) AS NonWarrantyPeriod FROM server_table -` +```sql +SELECT user_only_num1 AS AgeOfServer, (user_only_num1 - warranty_period) AS NonWarrantyPeriod FROM server_table +``` هذه النتائج في الإخراج على النحو التالي. - `+-------------+------------------------+ - | AgeOfServer | NonWarrantyPeriod | - +-------------+------------------------+ - | 36 | 24 | - | 24 | 12 | - | 61 | 49 | - | 12 | 0 | - | 6 | -6 | - | 0 | -12 | - | 36 | 24 | - | 36 | 24 | - | 24 | 12 | - +-------------+------------------------+ -` +```text ++-------------+------------------------+ +| AgeOfServer | NonWarrantyPeriod | ++-------------+------------------------+ +| 36 | 24 | +| 24 | 12 | +| 61 | 49 | +| 12 | 0 | +| 6 | -6 | +| 0 | -12 | +| 36 | 24 | +| 36 | 24 | +| 24 | 12 | ++-------------+------------------------+ +``` يمكنك أيضًا استخدام AS لتعيين اسم لجدول لتسهيل الرجوع إليه في الصلات. - `SELECT ord.product, ord.ord_number, ord.price, cust.cust_name, cust.cust_number FROM customer_table AS cust - - JOIN order_table AS ord ON cust.cust_number = ord.cust_number -` +```sql +SELECT ord.product, ord.ord_number, ord.price, cust.cust_name, cust.cust_number FROM customer_table AS cust + +JOIN order_table AS ord ON cust.cust_number = ord.cust_number +``` هذه النتائج في الإخراج على النحو التالي. - `+-------------+------------+-----------+-----------------+--------------+ - | product | ord_number | price | cust_name | cust_number | - +-------------+------------+-----------+-----------------+--------------+ - | RAM | 12345 | 124 | John Smith | 20 | - | CPU | 12346 | 212 | Mia X | 22 | - | USB | 12347 | 49 | Elise Beth | 21 | - | Cable | 12348 | 0 | Paul Fort | 19 | - | Mouse | 12349 | 66 | Nats Back | 15 | - | Laptop | 12350 | 612 | Mel S | 36 | - | Keyboard| 12351 | 24 | George Z | 95 | - | Keyboard| 12352 | 24 | Ally B | 55 | - | Air | 12353 | 12 | Maria Trust | 11 | - +-------------+------------+-----------+-----------------+--------------+ -` \ No newline at end of file +```text ++-------------+------------+-----------+-----------------+--------------+ +| product | ord_number | price | cust_name | cust_number | ++-------------+------------+-----------+-----------------+--------------+ +| RAM | 12345 | 124 | John Smith | 20 | +| CPU | 12346 | 212 | Mia X | 22 | +| USB | 12347 | 49 | Elise Beth | 21 | +| Cable | 12348 | 0 | Paul Fort | 19 | +| Mouse | 12349 | 66 | Nats Back | 15 | +| Laptop | 12350 | 612 | Mel S | 36 | +| Keyboard| 12351 | 24 | George Z | 95 | +| Keyboard| 12352 | 24 | Ally B | 55 | +| Air | 12353 | 12 | Maria Trust | 11 | ++-------------+------------+-----------+-----------------+--------------+ +``` \ No newline at end of file diff --git a/guide/arabic/sql/sql-and-operator/index.md b/guide/arabic/sql/sql-and-operator/index.md index e4f5cd316b..84fb55e096 100644 --- a/guide/arabic/sql/sql-and-operator/index.md +++ b/guide/arabic/sql/sql-and-operator/index.md @@ -10,25 +10,28 @@ localeTitle: مزود والمشغل في ما يلي جدول الطالب بدون شرط WHERE: - `select * from student; -` +```sql +select * from student; +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/and_operator01.JPG?raw=true) الآن تتم إضافة عبارة WHERE لعرض طلاب البرمجة فقط: - `select * from student - where programOfStudy = 'Programming'; -` +```sql +select * from student +where programOfStudy = 'Programming'; +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/and_operator02.JPG?raw=true) الآن يتم تحديث جملة WHERE بـ AND لعرض نتائج لطلاب البرمجة التي يكون لها أيضًا درجة SAT أكبر من 800: - `select * from student - where programOfStudy = 'Programming' - and sat_score > 800; -` +```sql +select * from student +where programOfStudy = 'Programming' +and sat_score > 800; +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/and_operator03.JPG?raw=true) diff --git a/guide/arabic/sql/sql-avg-function/index.md b/guide/arabic/sql/sql-avg-function/index.md index 2573413acd..1304f5403f 100644 --- a/guide/arabic/sql/sql-avg-function/index.md +++ b/guide/arabic/sql/sql-avg-function/index.md @@ -8,16 +8,18 @@ localeTitle: دالة Avg SQL هنا هو بناء الجملة لاستخدام الوظيفة: - `select groupingField, avg(num_field) - from table1 - group by groupingField -` +```sql +select groupingField, avg(num_field) +from table1 +group by groupingField +``` إليك مثال على ذلك باستخدام جدول الطالب: - `select studentID, FullName, avg(sat_score) - from student - group by studentID, FullName; -` +```sql +select studentID, FullName, avg(sat_score) +from student +group by studentID, FullName; +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/avg_function01.JPG?raw=true) \ No newline at end of file diff --git a/guide/arabic/sql/sql-between-operator/index.md b/guide/arabic/sql/sql-between-operator/index.md index 814dfce53b..81478ccce6 100644 --- a/guide/arabic/sql/sql-between-operator/index.md +++ b/guide/arabic/sql/sql-between-operator/index.md @@ -14,10 +14,11 @@ localeTitle: مزود بين المشغل هنا هو بناء الجملة لاستخدام الدالة في جملة WHERE: - `select field1, testField - from table1 - where testField between min and max -` +```sql +select field1, testField +from table1 +where testField between min and max +``` في ما يلي مثال على استخدام جدول الطالب وعبارة WHERE: @@ -35,12 +36,13 @@ localeTitle: مزود بين المشغل في ما يلي مثال على ذلك باستخدام جدول أموال الحملة والعبارة الفرعية. سيؤدي هذا إلى إرجاع صفوف يتراوح فيها مجموع التبرعات للمرشح بين 3 ملايين و 18 مليون دولار استنادًا إلى شرط HAVING في الجزء GROUP BY من البيان. المزيد عن التجميع في هذا الدليل. - `select Candidate, Office_Sought, Election_Year, format(sum(Total_$),2) - from combined_party_data - where Election_Year = 2016 - group by Candidate, Office_Sought, Election_Year - having sum(Total_$) between 3000000 and 18000000 - order by sum(Total_$) desc; -` +```sql +select Candidate, Office_Sought, Election_Year, format(sum(Total_$),2) +from combined_party_data +where Election_Year = 2016 +group by Candidate, Office_Sought, Election_Year +having sum(Total_$) between 3000000 and 18000000 +order by sum(Total_$) desc; +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/between02.JPG?raw=true) \ No newline at end of file diff --git a/guide/arabic/sql/sql-check-constraint/index.md b/guide/arabic/sql/sql-check-constraint/index.md index 886de3b283..84496815c5 100644 --- a/guide/arabic/sql/sql-check-constraint/index.md +++ b/guide/arabic/sql/sql-check-constraint/index.md @@ -14,38 +14,41 @@ localeTitle: SQL CHECK القيد **الخلية:** - `CREATE TABLE Persons ( - ID int NOT NULL, - LastName varchar(255) NOT NULL, - FirstName varchar(255), - Age int, - CHECK (Age>=18) - ); -` +```sql +CREATE TABLE Persons ( + ID int NOT NULL, + LastName varchar(255) NOT NULL, + FirstName varchar(255), + Age int, + CHECK (Age>=18) +); +``` **SQL Server / Oracle / MS Access:** - `CREATE TABLE Persons ( - ID int NOT NULL, - LastName varchar(255) NOT NULL, - FirstName varchar(255), - Age int CHECK (Age>=18) - ); -` +```sql +CREATE TABLE Persons ( + ID int NOT NULL, + LastName varchar(255) NOT NULL, + FirstName varchar(255), + Age int CHECK (Age>=18) +); +``` للسماح بتسمية قيد CHECK ، ولتحديد قيد CHECK على أعمدة متعددة ، استخدم بناء جملة SQL التالي: **MySQL / SQL Server / Oracle / MS Access:** - `CREATE TABLE Persons ( - ID int NOT NULL, - LastName varchar(255) NOT NULL, - FirstName varchar(255), - Age int, - City varchar(255), - CONSTRAINT CHK_Person CHECK (Age>=18 AND City='Sandnes') - ); -` +```sql +CREATE TABLE Persons ( + ID int NOT NULL, + LastName varchar(255) NOT NULL, + FirstName varchar(255), + Age int, + City varchar(255), + CONSTRAINT CHK_Person CHECK (Age>=18 AND City='Sandnes') +); +``` ### SQL الاختيار على ALTER TABLE @@ -53,17 +56,19 @@ localeTitle: SQL CHECK القيد **MySQL / SQL Server / Oracle / MS Access:** - `ALTER TABLE Persons - ADD CHECK (Age>=18); -` +```sql +ALTER TABLE Persons +ADD CHECK (Age>=18); +``` للسماح بتسمية قيد CHECK ، ولتحديد قيد CHECK على أعمدة متعددة ، استخدم بناء جملة SQL التالي: **MySQL / SQL Server / Oracle / MS Access:** - `ALTER TABLE Persons - ADD CONSTRAINT CHK_PersonAge CHECK (Age>=18 AND City='Sandnes'); -` +```sql +ALTER TABLE Persons +ADD CONSTRAINT CHK_PersonAge CHECK (Age>=18 AND City='Sandnes'); +``` ### انخفاض القيد الاختيار @@ -71,12 +76,14 @@ localeTitle: SQL CHECK القيد **SQL Server / Oracle / MS Access:** - `ALTER TABLE Persons - DROP CONSTRAINT CHK_PersonAge; -` +```sql +ALTER TABLE Persons +DROP CONSTRAINT CHK_PersonAge; +``` **الخلية:** - `ALTER TABLE Persons - DROP CHECK CHK_PersonAge; -` \ No newline at end of file +```sql +ALTER TABLE Persons +DROP CHECK CHK_PersonAge; +``` \ No newline at end of file diff --git a/guide/arabic/sql/sql-count-function/index.md b/guide/arabic/sql/sql-count-function/index.md index 5600e987fd..1d81b9bf58 100644 --- a/guide/arabic/sql/sql-count-function/index.md +++ b/guide/arabic/sql/sql-count-function/index.md @@ -15,15 +15,17 @@ localeTitle: COUNT COUNT Aggregate Function كمرجع ، إليك البيانات الحالية لجميع الصفوف في قاعدة بيانات الطلاب الخاصة بنا. - `select studentID, FullName, programOfStudy, sat_score from student; -- all records with fields of interest -` +```sql +select studentID, FullName, programOfStudy, sat_score from student; -- all records with fields of interest +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/count01.JPG?raw=true) توفر عبارة SQL هذه حسابًا لكل الصفوف. لاحظ أنه يمكنك منح عمود COUNT الناتج اسمًا باستخدام "AS". - `select count(*) AS studentCount from student; -- count of all records -` +```sql +select count(*) AS studentCount from student; -- count of all records +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/count02.JPG?raw=true) @@ -43,11 +45,12 @@ localeTitle: COUNT COUNT Aggregate Function في ما يلي مثال على ذلك باستخدام جدول أموال الحملة. هذا هو مجموع الدولارات في كل معاملة وعدد المساهمات لكل حزب سياسي خلال الحملة الرئاسية الأمريكية لعام 2016. - `select Specific_Party, Election_Year, format(sum(Total_$),2) AS contribution$Total, count(*) AS numberOfContributions - from combined_party_data - group by Specific_Party,Election_Year - having Election_Year = 2016; -` +```sql +select Specific_Party, Election_Year, format(sum(Total_$),2) AS contribution$Total, count(*) AS numberOfContributions +from combined_party_data +group by Specific_Party,Election_Year +having Election_Year = 2016; +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/count05.JPG?raw=true) diff --git a/guide/arabic/sql/sql-create-index-statement/index.md b/guide/arabic/sql/sql-create-index-statement/index.md index 9b15ceff7e..8795270312 100644 --- a/guide/arabic/sql/sql-create-index-statement/index.md +++ b/guide/arabic/sql/sql-create-index-statement/index.md @@ -15,9 +15,10 @@ localeTitle: SQL CREATE INDEX Statement فيما يلي مثال على صيغة بناء بيان الفهرس. لاحظ أن بناء الجملة يسمح لفهرس أن يكون أكثر من عمود واحد. - `CREATE INDEX index_name - ON table_name (column1, column2, ...); -` +```sql +CREATE INDEX index_name +ON table_name (column1, column2, ...); +``` إنشاء فهرس جديد في حقل جدول الطالب ، programOfStudy. كمرجع ، إليك التعريف الحالي لجدول الطالب. @@ -25,9 +26,10 @@ localeTitle: SQL CREATE INDEX Statement إليك بيان لإنشاء الفهرس ، ولقطة شاشة لتعريف الجدول المحدّث: - `create index pStudyIndex - on student (programOfStudy); -` +```sql +create index pStudyIndex +on student (programOfStudy); +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/create-index-statement02.JPG?raw=true) diff --git a/guide/arabic/sql/sql-create-index/index.md b/guide/arabic/sql/sql-create-index/index.md index 5932aa5d7d..0db0163d24 100644 --- a/guide/arabic/sql/sql-create-index/index.md +++ b/guide/arabic/sql/sql-create-index/index.md @@ -12,17 +12,19 @@ localeTitle: SQL CREATE INDEX Statement ينشئ فهرس على جدول. القيم المكررة مسموح بها: - `CREATE INDEX index_name - ON table_name (column1, column2, ...); -` +```sql +CREATE INDEX index_name +ON table_name (column1, column2, ...); +``` #### خلق فريدة من نوعها INDEX البناء ينشئ فهرس فريد على جدول. القيم المكررة غير مسموح بها: - `CREATE UNIQUE INDEX index_name - ON table_name (column1, column2, ...); -` +```sql +CREATE UNIQUE INDEX index_name +ON table_name (column1, column2, ...); +``` > **ملاحظة:** يختلف بناء جملة إنشاء الفهارس بين قواعد بيانات مختلفة. لذلك: تحقق من بناء الجملة لإنشاء فهارس في قاعدة البيانات الخاصة بك. @@ -30,14 +32,16 @@ localeTitle: SQL CREATE INDEX Statement ينشئ عبارة SQL أدناه فهرس المسمى "idx\_lastname" على العمود "اسم العائلة" في جدول "الأشخاص": - `CREATE INDEX idx_lastname - ON Persons (LastName); -` +```sql +CREATE INDEX idx_lastname +ON Persons (LastName); +``` إذا كنت تريد إنشاء فهرس على مجموعة من الأعمدة ، فيمكنك سرد أسماء الأعمدة داخل الأقواس ، مفصولة بفواصل: CREATE INDEX idx\_pname - `ON Persons (LastName, FirstName); -` +```sql +ON Persons (LastName, FirstName); +``` #### DROP INDEX بيان @@ -45,21 +49,25 @@ localeTitle: SQL CREATE INDEX Statement **MS Access:** - `DROP INDEX index_name ON table_name; -` +```sql +DROP INDEX index_name ON table_name; +``` **خادم قاعدة البيانات:** - `DROP INDEX table_name.index_name; -` +```sql +DROP INDEX table_name.index_name; +``` **DB2 / أوراكل:** - `DROP INDEX index_name; -` +```sql +DROP INDEX index_name; +``` **الخلية:** - `ALTER TABLE table_name - DROP INDEX index_name; -` \ No newline at end of file +```sql +ALTER TABLE table_name +DROP INDEX index_name; +``` \ No newline at end of file diff --git a/guide/arabic/sql/sql-create-table-statement/index.md b/guide/arabic/sql/sql-create-table-statement/index.md index 486f0d6999..40af909c70 100644 --- a/guide/arabic/sql/sql-create-table-statement/index.md +++ b/guide/arabic/sql/sql-create-table-statement/index.md @@ -8,19 +8,21 @@ localeTitle: SQL إنشاء بيان جدول لإنشاء جدول في قاعدة بيانات تستخدم عبارة `CREATE TABLE` . يمكنك إعطاء اسم إلى الجدول وقائمة بالأعمدة مع أنواع البيانات الخاصة بها. - `CREATE TABLE TABLENAME(Attribute1 Datatype, Attribute2 Datatype,........); -` +``` +CREATE TABLE TABLENAME(Attribute1 Datatype, Attribute2 Datatype,........); +``` في ما يلي مثال على إنشاء جدول باسم الشخص: - `CREATE TABLE Person( - Id int not null, - Name varchar not null, - DateOfBirth date not null, - Gender bit not null, - PRIMARY KEY( Id ) - ); -` +```sql +CREATE TABLE Person( + Id int not null, + Name varchar not null, + DateOfBirth date not null, + Gender bit not null, + PRIMARY KEY( Id ) +); +``` في المثال أعلاه ، يكون لكل شخص اسم وتاريخ الميلاد وجنس. يعد عمود المعرّف هو المفتاح الذي يحدد شخصًا واحدًا في الجدول. يمكنك استخدام الكلمة الأساسية `PRIMARY KEY` لتكوين عمود واحد أو أكثر كمفتاح أساسي. diff --git a/guide/arabic/sql/sql-create-table/index.md b/guide/arabic/sql/sql-create-table/index.md index 5064cd31eb..9b477dffe0 100644 --- a/guide/arabic/sql/sql-create-table/index.md +++ b/guide/arabic/sql/sql-create-table/index.md @@ -33,8 +33,9 @@ localeTitle: SQL إنشاء جدول سنقوم بإنشاء المخطط للتعلم والاختبار باستخدام الأمر SQL ؛ - `create database fCC_alterTableGuide; -` +``` +create database fCC_alterTableGuide; +``` هذه الأمثلة بنية المخطط قبل تشغيل هذا الأمر diff --git a/guide/arabic/sql/sql-create-view-statement/index.md b/guide/arabic/sql/sql-create-view-statement/index.md index c081a3b846..af65f57896 100644 --- a/guide/arabic/sql/sql-create-view-statement/index.md +++ b/guide/arabic/sql/sql-create-view-statement/index.md @@ -35,10 +35,11 @@ A View هو كائن قاعدة بيانات يقدم البيانات المو _سيغطي هذا الدليل هذا الجزء من البيان ..._ - `CREATE - VIEW view_name [(column_list)] - AS select_statement -` +```sql +CREATE + VIEW view_name [(column_list)] + AS select_statement +``` ### إنشاء نموذج للعرض من جداول الطلاب diff --git a/guide/arabic/sql/sql-date-functions/index.md b/guide/arabic/sql/sql-date-functions/index.md index f7818c8e2b..80e85daca4 100644 --- a/guide/arabic/sql/sql-date-functions/index.md +++ b/guide/arabic/sql/sql-date-functions/index.md @@ -18,14 +18,15 @@ localeTitle: دالات تاريخ SQL الحصول على التاريخ من النظام يمكن أن يكون سهل جدا لمعالجة البيانات باستخدام SQL. - `-- current date - select now(), sysdate(), current_date(), current_time(), -- date and time from the system on execution - dayofyear(now()) as NumDaysSoFarThisYr, - EXTRACT(YEAR FROM now()) as theYearPart, - EXTRACT(YEAR_MONTH FROM now()) as theYrMonPart, - date_format(now(), '%W %M %Y') as oneOfManyFormats; - ; -` +```sql +-- current date +select now(), sysdate(), current_date(), current_time(), -- date and time from the system on execution +dayofyear(now()) as NumDaysSoFarThisYr, +EXTRACT(YEAR FROM now()) as theYearPart, +EXTRACT(YEAR_MONTH FROM now()) as theYrMonPart, +date_format(now(), '%W %M %Y') as oneOfManyFormats; +; +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/date-functions04.JPG) @@ -39,12 +40,13 @@ localeTitle: دالات تاريخ SQL ### تاريخ الرياضيات - `select now(), current_date(), - datediff(now(),'2017-01-01') as daysThisYear, - subdate(current_date(), interval 150 day) as '150DaysAgo', - adddate(now(), interval 7 day) as dateInA_Week -- date in a week - ; -` +```sql +select now(), current_date(), +datediff(now(),'2017-01-01') as daysThisYear, +subdate(current_date(), interval 150 day) as '150DaysAgo', +adddate(now(), interval 7 day) as dateInA_Week -- date in a week +; +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/date-functions02.jpg) @@ -58,10 +60,11 @@ localeTitle: دالات تاريخ SQL فيما يلي مثالان على استخدام تاريخ الرياضيات في مكان جملة: - `select * from student; - to show the current data being used for the example - select * from student where recordCreated < '2017-01-01'; - select * from student where recordCreated < subdate(current_date(), interval 225 day); -` +```sql +select * from student; - to show the current data being used for the example +select * from student where recordCreated < '2017-01-01'; +select * from student where recordCreated < subdate(current_date(), interval 225 day); +``` ![صورة 1](https://github.com/SteveChevalier/guide-images/blob/master/date-functions03.jpg) diff --git a/guide/arabic/sql/sql-delete-statement/index.md b/guide/arabic/sql/sql-delete-statement/index.md index 496dcd017f..807cfc5c12 100644 --- a/guide/arabic/sql/sql-delete-statement/index.md +++ b/guide/arabic/sql/sql-delete-statement/index.md @@ -8,23 +8,27 @@ localeTitle: SQL حذف بيان كن حذرا. يمكنك حذف جميع سجلات الجدول أو مجرد عدد قليل. استخدم شرط `WHERE` لتحديد السجلات التي تريد حذفها. الصيغة هي: - `DELETE FROM table_name - WHERE condition; -` +```sql +DELETE FROM table_name +WHERE condition; +``` إليك مثال على الحذف من الجدول Person the record with Id 3: - `DELETE FROM Person - WHERE Id = 3; -` +```sql +DELETE FROM Person +WHERE Id = 3; +``` باستخدام DELETE لإزالة كافة السجلات من جدول محدد - `DELETE * FROM Person - ; -` +```sql +DELETE * FROM Person +; +``` أو اعتمادًا على RDBMS الخاص بك ، يمكنك استخدام عبارة TRUNCATE TABLE التي تقوم بحذف كافة السجلات من جدول ، كما قد تسمح أو لا تسمح بالتراجع طبقًا لـ RDBMS الخاص بك. DELETE هو DML و TRUNCATE هو DDL. - `TRUNCATE TABLE Person; -` \ No newline at end of file +```sql +TRUNCATE TABLE Person; +``` \ No newline at end of file diff --git a/guide/arabic/sql/sql-drop-view-statement/index.md b/guide/arabic/sql/sql-drop-view-statement/index.md index 29fe19ada7..d1c517436c 100644 --- a/guide/arabic/sql/sql-drop-view-statement/index.md +++ b/guide/arabic/sql/sql-drop-view-statement/index.md @@ -23,16 +23,18 @@ A View هو كائن يقدم البيانات من جدول واحد أو أك ### بناء الجملة الأساسي - `DROP VIEW [IF EXISTS] - view_name [, view_name] ... -` +```sql +DROP VIEW [IF EXISTS] + view_name [, view_name] ... +``` ### إسقاط عرض SQL الجزء الموجود في حالة وجود أخطاء "اعتراض" ، في حالة عدم وجود طريقة العرض. - `drop view if exists students_dropMe_v; -` +```sql +drop view if exists students_dropMe_v; +``` طريقة العرض بعد الإنشاء: diff --git a/guide/arabic/sql/sql-foreign-key-constraint/index.md b/guide/arabic/sql/sql-foreign-key-constraint/index.md index 35eefe4b13..812ccd5ac7 100644 --- a/guide/arabic/sql/sql-foreign-key-constraint/index.md +++ b/guide/arabic/sql/sql-foreign-key-constraint/index.md @@ -18,16 +18,18 @@ localeTitle: SQL الخارجية مفتاح القيد لاحظ أن جدول الطالب يحتوي على مفتاح أساسي عمود واحد للطالب. - `SHOW index FROM student; -` +```sql +SHOW index FROM student; +``` - `+---------+------------+----------+--------------+-------------+ - | Table | Non_unique | Key_name | Seq_in_index | Column_name | - +---------+------------+----------+--------------+-------------+ - | student | 0 | PRIMARY | 1 | studentID | - +---------+------------+----------+--------------+-------------+ - 1 row in set (0.00 sec) (some columns removed on the right for clarity) -` +```text ++---------+------------+----------+--------------+-------------+ +| Table | Non_unique | Key_name | Seq_in_index | Column_name | ++---------+------------+----------+--------------+-------------+ +| student | 0 | PRIMARY | 1 | studentID | ++---------+------------+----------+--------------+-------------+ +1 row in set (0.00 sec) (some columns removed on the right for clarity) +``` ### مفاتيح الجدول الأساسي والأجنبي للطفل @@ -36,29 +38,32 @@ localeTitle: SQL الخارجية مفتاح القيد ``SHOW index FROM `student-contact-info`; `` - `+----------------------+------------+----------+--------------+-------------+ - | Table | Non_unique | Key_name | Seq_in_index | Column_name | - +----------------------+------------+----------+--------------+-------------+ - | student-contact-info | 0 | PRIMARY | 1 | studentID | - +----------------------+------------+----------+--------------+-------------+ - 1 row in set (0.00 sec) (some columns removed on the right for clarity) -` +```text ++----------------------+------------+----------+--------------+-------------+ +| Table | Non_unique | Key_name | Seq_in_index | Column_name | ++----------------------+------------+----------+--------------+-------------+ +| student-contact-info | 0 | PRIMARY | 1 | studentID | ++----------------------+------------+----------+--------------+-------------+ +1 row in set (0.00 sec) (some columns removed on the right for clarity) +``` - `SELECT concat(table_name, '.', column_name) AS 'foreign key', - concat(referenced_table_name, '.', referenced_column_name) AS 'references' - FROM information_schema.key_column_usage - WHERE referenced_table_name IS NOT NULL - AND table_schema = 'fcc_sql_guides_database' - AND table_name = 'student-contact-info'; -` +```sql +SELECT concat(table_name, '.', column_name) AS 'foreign key', +concat(referenced_table_name, '.', referenced_column_name) AS 'references' +FROM information_schema.key_column_usage +WHERE referenced_table_name IS NOT NULL +AND table_schema = 'fcc_sql_guides_database' +AND table_name = 'student-contact-info'; +``` - `+--------------------------------+-------------------+ - | foreign key | references | - +--------------------------------+-------------------+ - | student-contact-info.studentID | student.studentID | - +--------------------------------+-------------------+ - 1 row in set (0.00 sec) -` +```text ++--------------------------------+-------------------+ +| foreign key | references | ++--------------------------------+-------------------+ +| student-contact-info.studentID | student.studentID | ++--------------------------------+-------------------+ +1 row in set (0.00 sec) +``` ### مثال على التقرير باستخدام جدول الطالب الرئيسي والجدول الفرعي للاتصال @@ -68,19 +73,20 @@ localeTitle: SQL الخارجية مفتاح القيد JOIN `student-contact-info` AS b ON a.studentID = b.studentID; `` - `+-----------+------------------------+------------------+--------------------+--------------------+ - | studentID | FullName | programOfStudy | student-phone-cell | student-US-zipcode | - +-----------+------------------------+------------------+--------------------+--------------------+ - | 1 | Monique Davis | Literature | 555-555-5551 | 97111 | - | 2 | Teri Gutierrez | Programming | 555-555-5552 | 97112 | - | 3 | Spencer Pautier | Programming | 555-555-5553 | 97113 | - | 4 | Louis Ramsey | Programming | 555-555-5554 | 97114 | - | 5 | Alvin Greene | Programming | 555-555-5555 | 97115 | - | 6 | Sophie Freeman | Programming | 555-555-5556 | 97116 | - | 7 | Edgar Frank "Ted" Codd | Computer Science | 555-555-5557 | 97117 | - | 8 | Donald D. Chamberlin | Computer Science | 555-555-5558 | 97118 | - +-----------+------------------------+------------------+--------------------+--------------------+ -` +```text ++-----------+------------------------+------------------+--------------------+--------------------+ +| studentID | FullName | programOfStudy | student-phone-cell | student-US-zipcode | ++-----------+------------------------+------------------+--------------------+--------------------+ +| 1 | Monique Davis | Literature | 555-555-5551 | 97111 | +| 2 | Teri Gutierrez | Programming | 555-555-5552 | 97112 | +| 3 | Spencer Pautier | Programming | 555-555-5553 | 97113 | +| 4 | Louis Ramsey | Programming | 555-555-5554 | 97114 | +| 5 | Alvin Greene | Programming | 555-555-5555 | 97115 | +| 6 | Sophie Freeman | Programming | 555-555-5556 | 97116 | +| 7 | Edgar Frank "Ted" Codd | Computer Science | 555-555-5557 | 97117 | +| 8 | Donald D. Chamberlin | Computer Science | 555-555-5558 | 97118 | ++-----------+------------------------+------------------+--------------------+--------------------+ +``` ### استنتاج diff --git a/guide/arabic/sql/sql-group-by-statement/index.md b/guide/arabic/sql/sql-group-by-statement/index.md index d282ed231e..de9e1a4131 100644 --- a/guide/arabic/sql/sql-group-by-statement/index.md +++ b/guide/arabic/sql/sql-group-by-statement/index.md @@ -14,27 +14,29 @@ localeTitle: مجموعة SQL بيان إن ترتيب مجموعة البيانات هذه في ترتيب تنازلي (DESC) يضع المرشحين الذين لديهم أكبر مساهمات إجمالية في أعلى القائمة. - `SELECT Candidate, Election_year, sum(Total_$), count(*) - FROM combined_party_data - WHERE Election_year = 2016 - GROUP BY Candidate, Election_year -- this tells the DBMS to summarize by these two columns - HAVING sum(Total_$) > 20000000 -- limits the rows presented from the summary of money ($20 Million USD) - ORDER BY sum(Total_$) DESC; -- orders the presented rows with the largest ones first. -` +```sql +SELECT Candidate, Election_year, sum(Total_$), count(*) +FROM combined_party_data +WHERE Election_year = 2016 +GROUP BY Candidate, Election_year -- this tells the DBMS to summarize by these two columns +HAVING sum(Total_$) > 20000000 -- limits the rows presented from the summary of money ($20 Million USD) +ORDER BY sum(Total_$) DESC; -- orders the presented rows with the largest ones first. +``` - `+--------------------------------------------------+---------------+-------------------+----------+ - | Candidate | Election_year | sum(Total_$) | count(*) | - +--------------------------------------------------+---------------+-------------------+----------+ - | CLINTON, HILLARY RODHAM & KAINE, TIMOTHY M (TIM) | 2016 | 568135094.4400003 | 126 | - | TRUMP, DONALD J & PENCE, MICHAEL R (MIKE) | 2016 | 366853142.7899999 | 114 | - | SANDERS, BERNARD (BERNIE) | 2016 | 258562022.17 | 122 | - | CRUZ, RAFAEL EDWARD (TED) | 2016 | 93430700.29000005 | 104 | - | CARSON, BENJAMIN S (BEN) | 2016 | 62202411.12999996 | 93 | - | RUBIO, MARCO ANTONIO | 2016 | 44384313.9 | 106 | - | BUSH, JOHN ELLIS (JEB) | 2016 | 34606731.78 | 97 | - +--------------------------------------------------+---------------+-------------------+----------+ - 7 rows in set (0.01 sec) -` +```text ++--------------------------------------------------+---------------+-------------------+----------+ +| Candidate | Election_year | sum(Total_$) | count(*) | ++--------------------------------------------------+---------------+-------------------+----------+ +| CLINTON, HILLARY RODHAM & KAINE, TIMOTHY M (TIM) | 2016 | 568135094.4400003 | 126 | +| TRUMP, DONALD J & PENCE, MICHAEL R (MIKE) | 2016 | 366853142.7899999 | 114 | +| SANDERS, BERNARD (BERNIE) | 2016 | 258562022.17 | 122 | +| CRUZ, RAFAEL EDWARD (TED) | 2016 | 93430700.29000005 | 104 | +| CARSON, BENJAMIN S (BEN) | 2016 | 62202411.12999996 | 93 | +| RUBIO, MARCO ANTONIO | 2016 | 44384313.9 | 106 | +| BUSH, JOHN ELLIS (JEB) | 2016 | 34606731.78 | 97 | ++--------------------------------------------------+---------------+-------------------+----------+ +7 rows in set (0.01 sec) +``` كما هو الحال مع كل هذه الأشياء SQL هناك أكثر من ذلك بكثير من ما هو موجود في هذا الدليل التمهيدي. diff --git a/guide/arabic/sql/sql-having-clause/index.md b/guide/arabic/sql/sql-having-clause/index.md index c87dff5686..f2a12ec4f1 100644 --- a/guide/arabic/sql/sql-having-clause/index.md +++ b/guide/arabic/sql/sql-having-clause/index.md @@ -16,27 +16,29 @@ localeTitle: SQL وجود جملة إن ترتيب مجموعة البيانات هذه في ترتيب تنازلي (DESC) يضع المرشحين الذين لديهم أكبر مساهمات إجمالية في أعلى القائمة. - `SELECT Candidate, Election_year, sum(Total_$), count(*) - FROM combined_party_data - WHERE Election_year = 2016 - GROUP BY Candidate, Election_year -- this tells the DBMS to summarize by these two columns - HAVING sum(Total_$) > 20000000 -- limits the rows presented from the summary of money ($20 Million USD) - ORDER BY sum(Total_$) DESC; -- orders the presented rows with the largest ones first. -` +```sql +SELECT Candidate, Election_year, sum(Total_$), count(*) +FROM combined_party_data +WHERE Election_year = 2016 +GROUP BY Candidate, Election_year -- this tells the DBMS to summarize by these two columns +HAVING sum(Total_$) > 20000000 -- limits the rows presented from the summary of money ($20 Million USD) +ORDER BY sum(Total_$) DESC; -- orders the presented rows with the largest ones first. +``` - `+--------------------------------------------------+---------------+-------------------+----------+ - | Candidate | Election_year | sum(Total_$) | count(*) | - +--------------------------------------------------+---------------+-------------------+----------+ - | CLINTON, HILLARY RODHAM & KAINE, TIMOTHY M (TIM) | 2016 | 568135094.4400003 | 126 | - | TRUMP, DONALD J & PENCE, MICHAEL R (MIKE) | 2016 | 366853142.7899999 | 114 | - | SANDERS, BERNARD (BERNIE) | 2016 | 258562022.17 | 122 | - | CRUZ, RAFAEL EDWARD (TED) | 2016 | 93430700.29000005 | 104 | - | CARSON, BENJAMIN S (BEN) | 2016 | 62202411.12999996 | 93 | - | RUBIO, MARCO ANTONIO | 2016 | 44384313.9 | 106 | - | BUSH, JOHN ELLIS (JEB) | 2016 | 34606731.78 | 97 | - +--------------------------------------------------+---------------+-------------------+----------+ - 7 rows in set (0.01 sec) -` +```text ++--------------------------------------------------+---------------+-------------------+----------+ +| Candidate | Election_year | sum(Total_$) | count(*) | ++--------------------------------------------------+---------------+-------------------+----------+ +| CLINTON, HILLARY RODHAM & KAINE, TIMOTHY M (TIM) | 2016 | 568135094.4400003 | 126 | +| TRUMP, DONALD J & PENCE, MICHAEL R (MIKE) | 2016 | 366853142.7899999 | 114 | +| SANDERS, BERNARD (BERNIE) | 2016 | 258562022.17 | 122 | +| CRUZ, RAFAEL EDWARD (TED) | 2016 | 93430700.29000005 | 104 | +| CARSON, BENJAMIN S (BEN) | 2016 | 62202411.12999996 | 93 | +| RUBIO, MARCO ANTONIO | 2016 | 44384313.9 | 106 | +| BUSH, JOHN ELLIS (JEB) | 2016 | 34606731.78 | 97 | ++--------------------------------------------------+---------------+-------------------+----------+ +7 rows in set (0.01 sec) +``` كما هو الحال مع كل هذه الأشياء SQL هناك أكثر من ذلك بكثير من ما هو موجود في هذا الدليل التمهيدي. diff --git a/guide/arabic/sql/sql-in-operator/index.md b/guide/arabic/sql/sql-in-operator/index.md index 6735f0cc62..fd94650124 100644 --- a/guide/arabic/sql/sql-in-operator/index.md +++ b/guide/arabic/sql/sql-in-operator/index.md @@ -10,39 +10,43 @@ localeTitle: مزود في المشغل في ما يلي قائمة الطلاب الكاملة الحالية لمقارنة مجموعة نتائج `WHERE` : - `select studentID, FullName, sat_score, rcd_updated from student; -` +```sql +select studentID, FullName, sat_score, rcd_updated from student; +``` - `+-----------+------------------------+-----------+---------------------+ - | studentID | FullName | sat_score | rcd_updated | - +-----------+------------------------+-----------+---------------------+ - | 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | - | 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 | - | 3 | Spencer Pautier | 1000 | 2017-08-16 15:34:50 | - | 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 | - | 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | - | 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 | - | 7 | Edgar Frank "Ted" Codd | 2400 | 2017-08-16 15:35:33 | - | 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | - | 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 | - +-----------+------------------------+-----------+---------------------+ - 9 rows in set (0.00 sec) -` +```text ++-----------+------------------------+-----------+---------------------+ +| studentID | FullName | sat_score | rcd_updated | ++-----------+------------------------+-----------+---------------------+ +| 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | +| 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 | +| 3 | Spencer Pautier | 1000 | 2017-08-16 15:34:50 | +| 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 | +| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | +| 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 | +| 7 | Edgar Frank "Ted" Codd | 2400 | 2017-08-16 15:35:33 | +| 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | +| 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 | ++-----------+------------------------+-----------+---------------------+ +9 rows in set (0.00 sec) +``` سيتم عرض الصفوف التي لها نقاط SAT في هذه القائمة (1000 ، 2400): - `select studentID, FullName, sat_score, rcd_updated - from student - where sat_score in (1000, 2400); -` +```sql +select studentID, FullName, sat_score, rcd_updated +from student +where sat_score in (1000, 2400); +``` - `+-----------+------------------------+-----------+---------------------+ - | studentID | FullName | sat_score | rcd_updated | - +-----------+------------------------+-----------+---------------------+ - | 3 | Spencer Pautier | 1000 | 2017-08-16 15:34:50 | - | 7 | Edgar Frank "Ted" Codd | 2400 | 2017-08-16 15:35:33 | - | 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | - | 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 | - +-----------+------------------------+-----------+---------------------+ - 4 rows in set (0.00 sec) -` \ No newline at end of file +```text ++-----------+------------------------+-----------+---------------------+ +| studentID | FullName | sat_score | rcd_updated | ++-----------+------------------------+-----------+---------------------+ +| 3 | Spencer Pautier | 1000 | 2017-08-16 15:34:50 | +| 7 | Edgar Frank "Ted" Codd | 2400 | 2017-08-16 15:35:33 | +| 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | +| 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 | ++-----------+------------------------+-----------+---------------------+ +4 rows in set (0.00 sec) +``` \ No newline at end of file diff --git a/guide/arabic/sql/sql-injection/index.md b/guide/arabic/sql/sql-injection/index.md index c87ff20efb..3d968b661d 100644 --- a/guide/arabic/sql/sql-injection/index.md +++ b/guide/arabic/sql/sql-injection/index.md @@ -10,9 +10,10 @@ localeTitle: حقن SQL المثال التالي هو أحد مقتطفات التعليمات البرمجية التي سيتم استرداد مستخدم من قاعدة بيانات تستند إلى `AccountId` . - `passedInAccountId = getRequestString("AccountId"); - sql = "select * from Accounts where AccountId = " + passedInAccountId; -` +``` +passedInAccountId = getRequestString("AccountId"); +sql = "select * from Accounts where AccountId = " + passedInAccountId; +``` يمكن استخدام حقن SQL لخرق هذا الرمز عن طريق حقن `1=1;` بيان `AccountId` . diff --git a/guide/arabic/sql/sql-inner-join-keyword/index.md b/guide/arabic/sql/sql-inner-join-keyword/index.md index c5ae64218f..3a72f888a1 100644 --- a/guide/arabic/sql/sql-inner-join-keyword/index.md +++ b/guide/arabic/sql/sql-inner-join-keyword/index.md @@ -24,15 +24,17 @@ localeTitle: SQL الداخلية الانضمام إلى الكلمات الر "انضم" البيانات \`\` \`النص + ----------- + ------------------------ + ------------ ------ + -------------------- + -------------------- + | studentID | FullName | programOfStudy | خلية هاتف الطالب student-US-zipcode | + ----------- + ------------------------ + ------------ ------ + -------------------- + -------------------- + | 1 | مونيك ديفيز الأدب | 555-555-5551 | 97111 | | 2 | تيري جوتيريز | برمجة | 555-555-5552 | 97112 | | 3 | سبنسر باوتير | برمجة | 555-555-5553 | 97113 | | 4 | لويس رمزي برمجة | 555-555-5554 | 97114 | | 5 | ألفين غرين | برمجة | 555-555-5555 | 97115 | | 6 | صوفي فريمان برمجة | 555-555-5556 | 97116 | | 7 | إدغار فرانك "تيد" كود علوم الكمبيوتر | 555-555-5557 | 97117 | | 8 | دونالد د. شامبرلين علوم الكمبيوتر | 555-555-5558 | 97118 | + ----------- + ------------------------ + ------------ ------ + -------------------- + -------------------- + - `### Complete table listings for reference - - Student table SQL -` +``` +### Complete table listings for reference + +Student table SQL +``` مزود SELECT a.studentID، a.FullName، sat\_score، a.programOfStudy، schoolEmailAdr من الطالب AS - `student or LEFT table -` +``` +student or LEFT table +``` نص + ----------- + ------------------------ + ----------- + ------------------ + ------------------------ + | studentID | FullName | sat\_score | programOfStudy | schoolEmailAdr | + ----------- + ------------------------ + ----------- + ------------------ + ------------------------ + | 1 | مونيك ديفيز 400 | الأدب | Monique@someSchool.edu | | 2 | تيري جوتيريز | 800 | برمجة | Teri@someSchool.edu | | 3 | سبنسر باوتير | 1000 | برمجة | Spencer@someSchool.edu | | 4 | لويس رمزي 1200 | برمجة | Louis@someSchool.edu | | 5 | ألفين غرين | 1200 | برمجة | Alvin@someSchool.edu | | 6 | صوفي فريمان 1200 | برمجة | Sophie@someSchool.edu | | 7 | إدغار فرانك "تيد" كود 2400 | علوم الكمبيوتر | Edgar@someSchool.edu | | 8 | دونالد د. شامبرلين 2400 | علوم الكمبيوتر | Donald@someSchool.edu | | 9 | ريمون ف. بويس 2400 | علوم الكمبيوتر | Raymond@someSchool.edu | + ----------- + ------------------------ + ----------- + ------------------ + ------------------------ + 9 صفوف في مجموعة (0.00 ثانية) diff --git a/guide/arabic/sql/sql-insert-into-select-statement/index.md b/guide/arabic/sql/sql-insert-into-select-statement/index.md index a233d43ca3..cc147bad50 100644 --- a/guide/arabic/sql/sql-insert-into-select-statement/index.md +++ b/guide/arabic/sql/sql-insert-into-select-statement/index.md @@ -8,11 +8,12 @@ localeTitle: إدراج SQL في تحديد البيان يجمع `INSERT INTO SELECT` بين `INSERT INTO` و `SELECT` ، ويمكنك استخدام أي شروط تريدها. الصيغة هي: - `INSERT INTO table2 (column1, column2, column3, ...) - SELECT column1, column2, column3, ... - FROM table1 - WHERE condition; -` +```sql +INSERT INTO table2 (column1, column2, column3, ...) +SELECT column1, column2, column3, ... +FROM table1 +WHERE condition; +``` هنا مثال يحتذى به في الجدول الشخص كل الطلاب الذكور من الجدول الطلاب. diff --git a/guide/arabic/sql/sql-insert-into-statement/index.md b/guide/arabic/sql/sql-insert-into-statement/index.md index 87fd69b697..7c516fe8ee 100644 --- a/guide/arabic/sql/sql-insert-into-statement/index.md +++ b/guide/arabic/sql/sql-insert-into-statement/index.md @@ -8,15 +8,17 @@ localeTitle: إدراج SQL في بيان يمكنك القيام بذلك بطريقتين ، إذا أردت إدراج قيم في بعض الأعمدة فقط ، فيجب عليك إدراج أسمائها بما في ذلك جميع الأعمدة الإلزامية. الصيغة هي: - `INSERT INTO table_name (column1, column2, column3, ...) - VALUES (value1, value2, value3, ...); -` +```sql +INSERT INTO table_name (column1, column2, column3, ...) +VALUES (value1, value2, value3, ...); +``` والطريقة الأخرى هي إدراج قيم لجميع الأعمدة في الجدول ، وليس من الضروري تحديد أسماء الأعمدة. الصيغة هي: - `INSERT INTO table_name - VALUES (value1, value2, value3, ...); -` +```sql +INSERT INTO table_name +VALUES (value1, value2, value3, ...); +``` في ما يلي مثال على إدراج سجل في الجدول الشخص بطريقتين: diff --git a/guide/arabic/sql/sql-interview-questions/index.md b/guide/arabic/sql/sql-interview-questions/index.md index 4692ee49ca..9217397c72 100644 --- a/guide/arabic/sql/sql-interview-questions/index.md +++ b/guide/arabic/sql/sql-interview-questions/index.md @@ -8,51 +8,56 @@ localeTitle: أسئلة مقابلة SQL هذا هو نوع الارتباط الافتراضي إذا لم يتم تحديد صلة. تقوم بإرجاع كافة الصفوف التي توجد تطابق واحد على الأقل في كلا الجدولين. - `SELECT * FROM A x JOIN B y ON y.aId = x.Id -` +```sql +SELECT * FROM A x JOIN B y ON y.aId = x.Id +``` ### ما هو انضمام اليسار في SQL؟ يقوم الرابط الأيسر بإرجاع جميع الصفوف من الجدول الأيسر ، والصفوف المتطابقة من الجدول الصحيح. سيتم إرجاع الصفوف في الجدول الأيسر حتى في حالة عدم وجود تطابق في الجدول الصحيح. الصفوف من الجدول الأيسر بدون تطابق في الجدول الصحيح ستكون `null` لقيم الجدول الصحيح. - `SELECT * FROM A x LEFT JOIN B y ON y.aId = x.Id -` +```sql +SELECT * FROM A x LEFT JOIN B y ON y.aId = x.Id +``` ### ما هو الانضمام الصحيح في SQL؟ يقوم الربط الأيمن بإرجاع جميع الصفوف من الجدول الصحيح والصفوف المتطابقة من الجدول الأيسر. مقابل صلة اليسار ، سيؤدي هذا إلى إرجاع كافة الصفوف من الجدول الصحيح حتى عندما لا يوجد تطابق في الجدول الأيسر. الصفوف في الجدول الأيمن التي ليس لها أي تطابق في الجدول الأيسر سيكون لها قيم `null` الجدول الأيسر. - `SELECT * FROM A x RIGHT JOIN B y ON y.aId = x.Id -` +```sql +SELECT * FROM A x RIGHT JOIN B y ON y.aId = x.Id +``` ### ما هو الانضمام الكامل في SQL؟ إرجاع صلة كاملة كافة الصفوف التي توجد تطابق في أي من الجداول. لذلك إذا كانت هناك صفوف في الجدول الأيسر لا تحتوي على تطابقات في الجدول الصحيح ، فسيتم تضمينها. وكذلك إذا كانت هناك صفوف في الجدول الأيمن لا تحتوي على تطابقات في الجدول الأيسر ، فسيتم تضمينها. - `SELECT Customers.CustomerName, Orders.OrderID - FROM Customers - FULL OUTER JOIN Orders - ON Customers.CustomerID=Orders.CustomerID - ORDER BY Customers.CustomerName -` +```sql +SELECT Customers.CustomerName, Orders.OrderID +FROM Customers +FULL OUTER JOIN Orders +ON Customers.CustomerID=Orders.CustomerID +ORDER BY Customers.CustomerName +``` ### ما هي نتيجة الأمر التالي؟ \`\` \` إسقاط عرض view\_name - `Here it'll be an error because we can't perform a DML operation on a view. - - ### Can we perform a rollback after using ALTER command? - No, because ALTER is a DDL command and Oracle server performs an automatic COMMIT when the DDL statements are executed. - - - ### Which is the only constraint that enforces rules at column level? - NOT NULL is the only constraint that works at the column level. - - - ### What are the pseudocolumns in SQL? Give some examples? - A pseudocolumn is a function which returns a system generated value. The reason it is known as so because a pseudocolumn is an Oracle assigned value used in the same context as an Oracle database column but not stored on disk. -` +``` +Here it'll be an error because we can't perform a DML operation on a view. + +### Can we perform a rollback after using ALTER command? +No, because ALTER is a DDL command and Oracle server performs an automatic COMMIT when the DDL statements are executed. + + +### Which is the only constraint that enforces rules at column level? +NOT NULL is the only constraint that works at the column level. + + +### What are the pseudocolumns in SQL? Give some examples? +A pseudocolumn is a function which returns a system generated value. The reason it is known as so because a pseudocolumn is an Oracle assigned value used in the same context as an Oracle database column but not stored on disk. +``` بعض الأمثلة على ذلك هي: ROWNUM، ROWID، USER، CURRVAL، NEXTVAL etc. \`\` \` @@ -114,8 +119,9 @@ localeTitle: أسئلة مقابلة SQL هنا خيار CASCADE ضروري لإزالة كافة كائنات المستخدم في قاعدة البيانات. \`\` \`sql انخفاض المستخدم ريتا CASCADE - `### Write SQL query to find the nth highest salary from table. -` +``` +### Write SQL query to find the nth highest salary from table. +``` مزود SELECT TOP 1 الراتب من عند ( SELECT DISTINCT TOP N Salary من الموظف ORDER BY Salary DESC ) ORDER BY الراتب ASC \`\` \` \ No newline at end of file diff --git a/guide/arabic/sql/sql-joins/index.md b/guide/arabic/sql/sql-joins/index.md index 12a9dd849d..93251a1dce 100644 --- a/guide/arabic/sql/sql-joins/index.md +++ b/guide/arabic/sql/sql-joins/index.md @@ -10,11 +10,12 @@ localeTitle: ينضم SQL ### بناء جملة SQL مع التركيز على الانضمام - `SELECT col1, col2, col3, etc.... - FROM tableNameOne AS a - JOIN tableNameTwo AS b ON a.primeKey = b.primeKey - etc... -` +```sql +SELECT col1, col2, col3, etc.... +FROM tableNameOne AS a +JOIN tableNameTwo AS b ON a.primeKey = b.primeKey +etc... +``` يمكن أن يكون عبارة JOIN مجرد JOIN أو INNER JOIN ، والتي هي نفسها ، أو LEFT JOIN (الموضحة أدناه). @@ -49,11 +50,12 @@ localeTitle: ينضم SQL بيانات "انضم": \`\` \`النص + ----------- + ------------------------ + ------------ ------ + -------------------- + -------------------- + | studentID | FullName | programOfStudy | خلية هاتف الطالب student-US-zipcode | + ----------- + ------------------------ + ------------ ------ + -------------------- + -------------------- + | 1 | مونيك ديفيز الأدب | 555-555-5551 | 97111 | | 2 | تيري جوتيريز | برمجة | 555-555-5552 | 97112 | | 3 | سبنسر باوتير | برمجة | 555-555-5553 | 97113 | | 4 | لويس رمزي برمجة | 555-555-5554 | 97114 | | 5 | ألفين غرين | برمجة | 555-555-5555 | 97115 | | 6 | صوفي فريمان برمجة | 555-555-5556 | 97116 | | 7 | إدغار فرانك "تيد" كود علوم الكمبيوتر | 555-555-5557 | 97117 | | 8 | دونالد د. شامبرلين علوم الكمبيوتر | 555-555-5558 | 97118 | + ----------- + ------------------------ + ------------ ------ + -------------------- + -------------------- + - `### Left Join - Using the keyword LEFT before JOIN causes the system to start with the student (LEFT) table but will return NULL from the RIGHT table if there are no rows for the LEFT table student. - - Note that studentID 9 appears here but the data from the contact table is just shown as NULL. -` +``` +### Left Join +Using the keyword LEFT before JOIN causes the system to start with the student (LEFT) table but will return NULL from the RIGHT table if there are no rows for the LEFT table student. + +Note that studentID 9 appears here but the data from the contact table is just shown as NULL. +``` مزود حدد a.studentID ، a.FullName ، a.programOfStudy ، ب. `student-phone-cell` ، ب. `student-US-zipcode` من الطالب ك LEFT JOIN `student-contact-info` AS b ON a.studentID = b.studentID؛ @@ -78,32 +80,35 @@ localeTitle: ينضم SQL قوائم جدول الطلاب - `SELECT a.studentID, a.FullName, sat_score, a.programOfStudy, schoolEmailAdr - FROM student AS a; -` +```sql +SELECT a.studentID, a.FullName, sat_score, a.programOfStudy, schoolEmailAdr +FROM student AS a; +``` طالب أو يسار الجدول - `+-----------+------------------------+-----------+------------------+------------------------+ - | studentID | FullName | sat_score | programOfStudy | schoolEmailAdr | - +-----------+------------------------+-----------+------------------+------------------------+ - | 1 | Monique Davis | 400 | Literature | Monique@someSchool.edu | - | 2 | Teri Gutierrez | 800 | Programming | Teri@someSchool.edu | - | 3 | Spencer Pautier | 1000 | Programming | Spencer@someSchool.edu | - | 4 | Louis Ramsey | 1200 | Programming | Louis@someSchool.edu | - | 5 | Alvin Greene | 1200 | Programming | Alvin@someSchool.edu | - | 6 | Sophie Freeman | 1200 | Programming | Sophie@someSchool.edu | - | 7 | Edgar Frank "Ted" Codd | 2400 | Computer Science | Edgar@someSchool.edu | - | 8 | Donald D. Chamberlin | 2400 | Computer Science | Donald@someSchool.edu | - | 9 | Raymond F. Boyce | 2400 | Computer Science | Raymond@someSchool.edu | - +-----------+------------------------+-----------+------------------+------------------------+ - 9 rows in set (0.00 sec) -` +```text ++-----------+------------------------+-----------+------------------+------------------------+ +| studentID | FullName | sat_score | programOfStudy | schoolEmailAdr | ++-----------+------------------------+-----------+------------------+------------------------+ +| 1 | Monique Davis | 400 | Literature | Monique@someSchool.edu | +| 2 | Teri Gutierrez | 800 | Programming | Teri@someSchool.edu | +| 3 | Spencer Pautier | 1000 | Programming | Spencer@someSchool.edu | +| 4 | Louis Ramsey | 1200 | Programming | Louis@someSchool.edu | +| 5 | Alvin Greene | 1200 | Programming | Alvin@someSchool.edu | +| 6 | Sophie Freeman | 1200 | Programming | Sophie@someSchool.edu | +| 7 | Edgar Frank "Ted" Codd | 2400 | Computer Science | Edgar@someSchool.edu | +| 8 | Donald D. Chamberlin | 2400 | Computer Science | Donald@someSchool.edu | +| 9 | Raymond F. Boyce | 2400 | Computer Science | Raymond@someSchool.edu | ++-----------+------------------------+-----------+------------------+------------------------+ +9 rows in set (0.00 sec) +``` مزود SELECT \* from `student-contact-info` AS b؛ - `student contact or RIGHT table -` +``` +student contact or RIGHT table +``` نص + ----------- + ---------------------------------- + - ------------------ + -------------------- + | studentID | studentEmailAddr | خلية هاتف الطالب student-US-zipcode | + ----------- + ---------------------------------- + - ------------------ + -------------------- + | 1 | Monique.Davis@freeCodeCamp.org | 555-555-5551 | 97111 | | 2 | Teri.Gutierrez@freeCodeCamp.org | 555-555-5552 | 97112 | | 3 | Spencer.Pautier@freeCodeCamp.org | 555-555-5553 | 97113 | | 4 | Louis.Ramsey@freeCodeCamp.org | 555-555-5554 | 97114 | | 5 | Alvin.Green@freeCodeCamp.org | 555-555-5555 | 97115 | | 6 | Sophie.Freeman@freeCodeCamp.org | 555-555-5556 | 97116 | | 7 | Maximo.Smith@freeCodeCamp.org | 555-555-5557 | 97117 | | 8 | Michael.Roach@freeCodeCamp.ort | 555-555-5558 | 97118 | + ----------- + ---------------------------------- + - ------------------ + -------------------- + 8 صفوف في مجموعة (0.00 ثانية) \`\` \` diff --git a/guide/arabic/sql/sql-left-join-keyword/index.md b/guide/arabic/sql/sql-left-join-keyword/index.md index 431ddc1218..0f1ac8305c 100644 --- a/guide/arabic/sql/sql-left-join-keyword/index.md +++ b/guide/arabic/sql/sql-left-join-keyword/index.md @@ -22,14 +22,16 @@ localeTitle: SQL Left Join \`\` \`النص + ----------- + ------------------------ + ------------ ------ + -------------------- + -------------------- + | studentID | FullName | programOfStudy | خلية هاتف الطالب student-US-zipcode | + ----------- + ------------------------ + ------------ ------ + -------------------- + -------------------- + | 1 | مونيك ديفيز الأدب | 555-555-5551 | 97111 | | 2 | تيري جوتيريز | برمجة | 555-555-5552 | 97112 | | 3 | سبنسر باوتير | برمجة | 555-555-5553 | 97113 | | 4 | لويس رمزي برمجة | 555-555-5554 | 97114 | | 5 | ألفين غرين | برمجة | 555-555-5555 | 97115 | | 6 | صوفي فريمان برمجة | 555-555-5556 | 97116 | | 7 | إدغار فرانك "تيد" كود علوم الكمبيوتر | 555-555-5557 | 97117 | | 8 | دونالد د. شامبرلين علوم الكمبيوتر | 555-555-5558 | 97118 | | 9 | ريمون ف. بويس علوم الكمبيوتر | فارغة فارغة + ----------- + ------------------------ + ------------ ------ + -------------------- + -------------------- + 9 صفوف في مجموعة (0.00 ثانية) - `### Complete table listings for reference - student or LEFT table SQL -` +``` +### Complete table listings for reference +student or LEFT table SQL +``` مزود SELECT a.studentID، a.FullName، sat\_score، a.programOfStudy، schoolEmailAdr من الطالب AS - `student or LEFT table data -` +``` +student or LEFT table data +``` نص + ----------- + ------------------------ + ----------- + ------------------ + ------------------------ + | studentID | FullName | sat\_score | programOfStudy | schoolEmailAdr | + ----------- + ------------------------ + ----------- + ------------------ + ------------------------ + | 1 | مونيك ديفيز 400 | الأدب | Monique@someSchool.edu | | 2 | تيري جوتيريز | 800 | برمجة | Teri@someSchool.edu | | 3 | سبنسر باوتير | 1000 | برمجة | Spencer@someSchool.edu | | 4 | لويس رمزي 1200 | برمجة | Louis@someSchool.edu | | 5 | ألفين غرين | 1200 | برمجة | Alvin@someSchool.edu | | 6 | صوفي فريمان 1200 | برمجة | Sophie@someSchool.edu | | 7 | إدغار فرانك "تيد" كود 2400 | علوم الكمبيوتر | Edgar@someSchool.edu | | 8 | دونالد د. شامبرلين 2400 | علوم الكمبيوتر | Donald@someSchool.edu | | 9 | ريمون ف. بويس 2400 | علوم الكمبيوتر | Raymond@someSchool.edu | + ----------- + ------------------------ + ----------- + ------------------ + ------------------------ + 9 صفوف في مجموعة (0.00 ثانية) diff --git a/guide/arabic/sql/sql-like-operator/index.md b/guide/arabic/sql/sql-like-operator/index.md index 3726e1e27f..e4c205beed 100644 --- a/guide/arabic/sql/sql-like-operator/index.md +++ b/guide/arabic/sql/sql-like-operator/index.md @@ -18,66 +18,73 @@ localeTitle: SQL LIKE المشغل سيحدد هذا SQL الطلاب الذين لديهم `FullName` بدءًا من "Monique" أو تنتهي بـ "Greene". - `SELECT studentID, FullName, sat_score, rcd_updated - FROM student - WHERE - FullName LIKE 'Monique%' OR -- note the % at the end but not the beginning - FullName LIKE '%Greene'; -- note the % at the beginning but not the end -` +```sql +SELECT studentID, FullName, sat_score, rcd_updated +FROM student +WHERE +FullName LIKE 'Monique%' OR -- note the % at the end but not the beginning +FullName LIKE '%Greene'; -- note the % at the beginning but not the end +``` - `+-----------+---------------+-----------+---------------------+ - | studentID | FullName | sat_score | rcd_updated | - +-----------+---------------+-----------+---------------------+ - | 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | - | 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | - +-----------+---------------+-----------+---------------------+ - 2 rows in set (0.00 sec) -` +```text ++-----------+---------------+-----------+---------------------+ +| studentID | FullName | sat_score | rcd_updated | ++-----------+---------------+-----------+---------------------+ +| 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | +| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | ++-----------+---------------+-----------+---------------------+ +2 rows in set (0.00 sec) +``` ### يوجد نمط سلسلة في منتصف العمود سيحدد هذا SQL الطلاب الذين لديهم "ree" في أي مكان في الاسم. - `SELECT studentID, FullName, sat_score, rcd_updated - FROM student - WHERE FullName LIKE '%ree%'; -- note the % at the beginning AND at the end -` +```sql +SELECT studentID, FullName, sat_score, rcd_updated +FROM student +WHERE FullName LIKE '%ree%'; -- note the % at the beginning AND at the end +``` - `+-----------+----------------+-----------+---------------------+ - | studentID | FullName | sat_score | rcd_updated | - +-----------+----------------+-----------+---------------------+ - | 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | - | 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 | - +-----------+----------------+-----------+---------------------+ - 2 rows in set (0.00 sec) -` +```text ++-----------+----------------+-----------+---------------------+ +| studentID | FullName | sat_score | rcd_updated | ++-----------+----------------+-----------+---------------------+ +| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | +| 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 | ++-----------+----------------+-----------+---------------------+ +2 rows in set (0.00 sec) +``` ### السلسلة ليست في العمود يمكنك وضع "NOT" قبل LIKE لاستبعاد الصفوف بنمط السلسلة بدلاً من تحديدها. يستثني هذا SQL السجلات التي تحتوي على "cer Pau" و "Ted" في العمود FullName. - `SELECT studentID, FullName, sat_score, rcd_updated - FROM student - WHERE FullName NOT LIKE '%cer Pau%' AND FullName NOT LIKE '%"Ted"%'; -` +```sql +SELECT studentID, FullName, sat_score, rcd_updated +FROM student +WHERE FullName NOT LIKE '%cer Pau%' AND FullName NOT LIKE '%"Ted"%'; +``` - `+-----------+----------------------+-----------+---------------------+ - | studentID | FullName | sat_score | rcd_updated | - +-----------+----------------------+-----------+---------------------+ - | 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | - | 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 | - | 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 | - | 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | - | 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 | - | 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | - | 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 | - +-----------+----------------------+-----------+---------------------+ - 7 rows in set (0.00 sec) -` +```text ++-----------+----------------------+-----------+---------------------+ +| studentID | FullName | sat_score | rcd_updated | ++-----------+----------------------+-----------+---------------------+ +| 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | +| 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 | +| 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 | +| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | +| 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 | +| 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | +| 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 | ++-----------+----------------------+-----------+---------------------+ +7 rows in set (0.00 sec) +``` _في ما يلي قائمة الطلاب الكاملة الحالية للمقارنة مع مكان تعيين نتيجة الجملة أعلاه._ - `SELECT studentID, FullName, sat_score, rcd_updated FROM student; -` +```sql +SELECT studentID, FullName, sat_score, rcd_updated FROM student; +``` \`\` \`النص + ----------- + ------------------------ + ----------- + --------------------- + | studentID | FullName | _درجة_ جلس _|_ تحديث _Rcd_ | + ----------- + ------------------------ + ----------- + --------------------- + | 1 | مونيك ديفيز 400 | 2017-08-16 15:34:50 | | 2 | تيري جوتيريز | 800 | 2017-08-16 15:34:50 | | 3 | سبنسر باوتير | 1000 | 2017-08-16 15:34:50 | | 4 | لويس رمزي 1200 | 2017-08-16 15:34:50 | | 5 | ألفين غرين | 1200 | 2017-08-16 15:34:50 | | 6 | صوفي فريمان 1200 | 2017-08-16 15:34:50 | | 7 | إدغار فرانك "تيد" كود 2400 | 2017-08-16 15:35:33 | | 8 | دونالد د. شامبرلين 2400 | 2017-08-16 15:35:33 | | 9 | ريمون ف. بويس 2400 | 2017-08-16 15:35:33 | + ----------- + ------------------------ + ----------- + --------------------- + 9 صفوف في مجموعة (0.00 ثانية) \ No newline at end of file diff --git a/guide/arabic/sql/sql-not-operator/index.md b/guide/arabic/sql/sql-not-operator/index.md index eac3f8bff2..77e822ed12 100644 --- a/guide/arabic/sql/sql-not-operator/index.md +++ b/guide/arabic/sql/sql-not-operator/index.md @@ -8,7 +8,8 @@ localeTitle: SQL لا المشغل في ما يلي مثال يختار جميع الأشخاص غير الذكور: - `SELECT Id, Name, DateOfBirth, Gender - FROM Person - WHERE NOT Gender = "M" -` \ No newline at end of file +```sql +SELECT Id, Name, DateOfBirth, Gender +FROM Person +WHERE NOT Gender = "M" +``` \ No newline at end of file diff --git a/guide/arabic/sql/sql-or-operator/index.md b/guide/arabic/sql/sql-or-operator/index.md index d6bd832160..eacf59e73e 100644 --- a/guide/arabic/sql/sql-or-operator/index.md +++ b/guide/arabic/sql/sql-or-operator/index.md @@ -8,16 +8,18 @@ localeTitle: SQL أو المشغل في ما يلي مثال يحدد جميع السجلات من جدول "الأشخاص" الذين هم إما ذكور أو الذين لديهم اسم "ماري": - `SELECT Id, Name, DateOfBirth, Gender - FROM Person - WHERE Gender = “M” OR Name = “Mary” -` +```sql +SELECT Id, Name, DateOfBirth, Gender +FROM Person +WHERE Gender = “M” OR Name = “Mary” +``` يمكنك دمج عوامل تشغيل أخرى في `WHERE` (استخدم الأقواس للإشارة إلى ترتيب العمليات) كما في هذا المثال: - `SELECT Id, Name, DateOfBirth, Gender - FROM Person - WHERE Gender = “M” AND (Name = “Peter” OR Name = “John”) -` +```sql +SELECT Id, Name, DateOfBirth, Gender +FROM Person +WHERE Gender = “M” AND (Name = “Peter” OR Name = “John”) +``` يختار هذا المثال جميع السجلات التي يكون فيها الجنس "M" والاسم "Peter" ، وكذلك الجنس حيث يكون "M" والاسم "John". \ No newline at end of file diff --git a/guide/arabic/sql/sql-order-by-keyword/index.md b/guide/arabic/sql/sql-order-by-keyword/index.md index a910719732..5834ccdbb6 100644 --- a/guide/arabic/sql/sql-order-by-keyword/index.md +++ b/guide/arabic/sql/sql-order-by-keyword/index.md @@ -8,47 +8,51 @@ localeTitle: ترتيب SQL بالكلمات الرئيسية ORDER BY يعطينا طريقة ل SORT النتيجة المحددة بواسطة واحد أو أكثر من العناصر في قسم SELECT. هنا هو مزود فرز الفرز للطلاب من خلال FullName بترتيب تنازلي. ترتيب الفرز الافتراضي هو تصاعدي (ASC) ولكن لفرز بالترتيب المعاكس (تنازلي) تستخدم DESC. - `SELECT studentID, FullName, sat_score - FROM student - ORDER BY FullName DESC; -` +```sql +SELECT studentID, FullName, sat_score +FROM student +ORDER BY FullName DESC; +``` - `+-----------+------------------------+-----------+ - | studentID | FullName | sat_score | - +-----------+------------------------+-----------+ - | 2 | Teri Gutierrez | 800 | - | 3 | Spencer Pautier | 1000 | - | 6 | Sophie Freeman | 1200 | - | 9 | Raymond F. Boyce | 2400 | - | 1 | Monique Davis | 400 | - | 4 | Louis Ramsey | 1200 | - | 7 | Edgar Frank "Ted" Codd | 2400 | - | 8 | Donald D. Chamberlin | 2400 | - | 5 | Alvin Greene | 1200 | - +-----------+------------------------+-----------+ - 9 rows in set (0.00 sec) -` +```text ++-----------+------------------------+-----------+ +| studentID | FullName | sat_score | ++-----------+------------------------+-----------+ +| 2 | Teri Gutierrez | 800 | +| 3 | Spencer Pautier | 1000 | +| 6 | Sophie Freeman | 1200 | +| 9 | Raymond F. Boyce | 2400 | +| 1 | Monique Davis | 400 | +| 4 | Louis Ramsey | 1200 | +| 7 | Edgar Frank "Ted" Codd | 2400 | +| 8 | Donald D. Chamberlin | 2400 | +| 5 | Alvin Greene | 1200 | ++-----------+------------------------+-----------+ +9 rows in set (0.00 sec) +``` _وفيما يلي قائمة الطلاب المسجلين من الأمم المتحدة ، الحالية ، الكاملة للمقارنة مع ما سبق._ - `SELECT studentID, FullName, sat_score, rcd_updated FROM student; -` +```sql +SELECT studentID, FullName, sat_score, rcd_updated FROM student; +``` - `+-----------+------------------------+-----------+---------------------+ - | studentID | FullName | sat_score | rcd_updated | - +-----------+------------------------+-----------+---------------------+ - | 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | - | 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 | - | 3 | Spencer Pautier | 1000 | 2017-08-16 15:34:50 | - | 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 | - | 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | - | 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 | - | 7 | Edgar Frank "Ted" Codd | 2400 | 2017-08-16 15:35:33 | - | 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | - | 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 | - +-----------+------------------------+-----------+---------------------+ - 9 rows in set (0.00 sec) -` +```text ++-----------+------------------------+-----------+---------------------+ +| studentID | FullName | sat_score | rcd_updated | ++-----------+------------------------+-----------+---------------------+ +| 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | +| 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 | +| 3 | Spencer Pautier | 1000 | 2017-08-16 15:34:50 | +| 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 | +| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | +| 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 | +| 7 | Edgar Frank "Ted" Codd | 2400 | 2017-08-16 15:35:33 | +| 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | +| 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 | ++-----------+------------------------+-----------+---------------------+ +9 rows in set (0.00 sec) +``` كما هو الحال مع كل هذه الأشياء SQL هناك أكثر من ذلك بكثير من ما هو موجود في هذا الدليل التمهيدي. diff --git a/guide/arabic/sql/sql-primary-key-constraint/index.md b/guide/arabic/sql/sql-primary-key-constraint/index.md index 2f201f6572..31f548a98c 100644 --- a/guide/arabic/sql/sql-primary-key-constraint/index.md +++ b/guide/arabic/sql/sql-primary-key-constraint/index.md @@ -22,12 +22,13 @@ localeTitle: SQL مفتاح القيد الرئيسي فيما يلي أمر إنشاء جدول يقوم أيضًا بإنشاء مفتاح أساسي باستخدام حقلين. - `CREATE TABLE priKeyExample( - rcdKey_id_a INT NOT NULL, - rcdKeySeq_id INT NOT NULL, - someData varchar(256) NOT NULL, - PRIMARY KEY(rcdKey_id_a,rcdKeySeq_id)); -` +```sql +CREATE TABLE priKeyExample( +rcdKey_id_a INT NOT NULL, +rcdKeySeq_id INT NOT NULL, +someData varchar(256) NOT NULL, +PRIMARY KEY(rcdKey_id_a,rcdKeySeq_id)); +``` ### مثال مع جدول التغيير @@ -38,9 +39,10 @@ localeTitle: SQL مفتاح القيد الرئيسي الآن سنقوم بإضافة واحدة جديدة. - `ALTER TABLE priKeyExample - ADD CONSTRAINT myPriKey PRIMARY KEY(rcdKey_id_a,rcdKeySeq_id); -` +```sql +ALTER TABLE priKeyExample +ADD CONSTRAINT myPriKey PRIMARY KEY(rcdKey_id_a,rcdKeySeq_id); +``` كما هو الحال مع كل هذه الأشياء SQL هناك أكثر من ذلك بكثير من ما هو موجود في هذا الدليل التمهيدي. diff --git a/guide/arabic/sql/sql-replace-view-statement/index.md b/guide/arabic/sql/sql-replace-view-statement/index.md index cf6503b5fc..71ce7d6afe 100644 --- a/guide/arabic/sql/sql-replace-view-statement/index.md +++ b/guide/arabic/sql/sql-replace-view-statement/index.md @@ -14,11 +14,12 @@ A View هو كائن قاعدة بيانات يقدم البيانات من جد ### Sytax العام - `CREATE OR REPLACE VIEW view_name AS - SELECT column1, column2, ... - FROM table_name - WHERE condition; -` +```sql +CREATE OR REPLACE VIEW view_name AS +SELECT column1, column2, ... +FROM table_name +WHERE condition; +``` ### يستخدم SQL لإنشاء العرض والبيانات الحالية @@ -33,32 +34,35 @@ A View هو كائن قاعدة بيانات يقدم البيانات من جد البيانات الحالية: - `+-----------------+----------------+ - | FullName | programOfStudy | - +-----------------+----------------+ - | Teri Gutierrez | Programming | - | Spencer Pautier | Programming | - | Louis Ramsey | Programming | - | Alvin Greene | Programming | - | Sophie Freeman | Programming | - +-----------------+----------------+ - 5 rows in set (0.00 sec) -` +```text ++-----------------+----------------+ +| FullName | programOfStudy | ++-----------------+----------------+ +| Teri Gutierrez | Programming | +| Spencer Pautier | Programming | +| Louis Ramsey | Programming | +| Alvin Greene | Programming | +| Sophie Freeman | Programming | ++-----------------+----------------+ +5 rows in set (0.00 sec) +``` قائمة من وجهات النظر الحالية: - `SHOW FULL TABLES IN fcc_sql_guides_database WHERE TABLE_TYPE LIKE 'VIEW'; -` +```sql +SHOW FULL TABLES IN fcc_sql_guides_database WHERE TABLE_TYPE LIKE 'VIEW'; +``` - `+-----------------------------------+------------+ - | Tables_in_fcc_sql_guides_database | Table_type | - +-----------------------------------+------------+ - | programming-students-v | VIEW | - | students-contact-info_v | VIEW | - | students_dropme_v | VIEW | - +-----------------------------------+------------+ - 3 rows in set (0.00 sec) -` +```text ++-----------------------------------+------------+ +| Tables_in_fcc_sql_guides_database | Table_type | ++-----------------------------------+------------+ +| programming-students-v | VIEW | +| students-contact-info_v | VIEW | +| students_dropme_v | VIEW | ++-----------------------------------+------------+ +3 rows in set (0.00 sec) +``` ### استبدال العرض @@ -73,28 +77,30 @@ A View هو كائن قاعدة بيانات يقدم البيانات من جد ملاحظة: تعرض طريقة العرض الآن sat\_score. - `+-----------------+----------------+-----------+ - | FullName | programOfStudy | sat_score | - +-----------------+----------------+-----------+ - | Teri Gutierrez | Programming | 800 | - | Spencer Pautier | Programming | 1000 | - | Louis Ramsey | Programming | 1200 | - | Alvin Greene | Programming | 1200 | - | Sophie Freeman | Programming | 1200 | - +-----------------+----------------+-----------+ -` +```text ++-----------------+----------------+-----------+ +| FullName | programOfStudy | sat_score | ++-----------------+----------------+-----------+ +| Teri Gutierrez | Programming | 800 | +| Spencer Pautier | Programming | 1000 | +| Louis Ramsey | Programming | 1200 | +| Alvin Greene | Programming | 1200 | +| Sophie Freeman | Programming | 1200 | ++-----------------+----------------+-----------+ +``` ملاحظة: قائمة وجهات النظر لم تتغير ، يتم استبدال وجهة نظرنا. - `mysql> SHOW FULL TABLES IN fcc_sql_guides_database WHERE TABLE_TYPE LIKE 'VIEW'; - +-----------------------------------+------------+ - | Tables_in_fcc_sql_guides_database | Table_type | - +-----------------------------------+------------+ - | programming-students-v | VIEW | - | students-contact-info_v | VIEW | - | students_dropme_v | VIEW | - +-----------------------------------+------------+ - 3 rows in set (0.00 sec) -` +```text +mysql> SHOW FULL TABLES IN fcc_sql_guides_database WHERE TABLE_TYPE LIKE 'VIEW'; ++-----------------------------------+------------+ +| Tables_in_fcc_sql_guides_database | Table_type | ++-----------------------------------+------------+ +| programming-students-v | VIEW | +| students-contact-info_v | VIEW | +| students_dropme_v | VIEW | ++-----------------------------------+------------+ +3 rows in set (0.00 sec) +``` \* كما هو الحال مع جميع هذه الأشياء SQL هناك أكثر من ذلك بكثير من ما هو موجود في هذا الدليل التمهيدي. آمل أن يمنحك هذا على الأقل ما يكفي للبدء. يرجى الاطلاع على دليل مدير قاعدة البيانات الخاص بك والمتعة محاولة خيارات مختلفة بنفسك. \ No newline at end of file diff --git a/guide/arabic/sql/sql-right-join-keyword/index.md b/guide/arabic/sql/sql-right-join-keyword/index.md index 6a07ef48a2..42193aa4e9 100644 --- a/guide/arabic/sql/sql-right-join-keyword/index.md +++ b/guide/arabic/sql/sql-right-join-keyword/index.md @@ -12,42 +12,46 @@ localeTitle: مزود حق الانضمام تقوم الكلمة الأساسية RIGHT JOIN بإرجاع كافة السجلات من الجدول الصحيح (table2) ، والسجلات المتطابقة من الجدول الأيسر (table1). والنتيجة هي NULL من الجانب الأيسر ، عندما لا يكون هناك أي تطابق. - `SELECT * - FROM table1 - RIGHT JOIN table2 - ON table1.column_name = table2.column_name; -` +```sql +SELECT * +FROM table1 +RIGHT JOIN table2 +ON table1.column_name = table2.column_name; +``` ### استكمال قوائم الجدول لتكون مرجعا الغذاء أو بيانات الجدول الأيسر - `+---------+--------------+-----------+------------+ - | ITEM_ID | ITEM_NAME | ITEM_UNIT | COMPANY_ID | - +---------+--------------+-----------+------------+ - | 1 | Chex Mix | Pcs | 16 | - | 6 | Cheez-It | Pcs | 15 | - | 2 | BN Biscuit | Pcs | 15 | - | 3 | Mighty Munch | Pcs | 17 | - | 4 | Pot Rice | Pcs | 15 | - | 5 | Jaffa Cakes | Pcs | 18 | - | 7 | Salt n Shake | Pcs | | - +---------+--------------+-----------+------------+ - - - - company or RIGHT table data -` +```text ++---------+--------------+-----------+------------+ +| ITEM_ID | ITEM_NAME | ITEM_UNIT | COMPANY_ID | ++---------+--------------+-----------+------------+ +| 1 | Chex Mix | Pcs | 16 | +| 6 | Cheez-It | Pcs | 15 | +| 2 | BN Biscuit | Pcs | 15 | +| 3 | Mighty Munch | Pcs | 17 | +| 4 | Pot Rice | Pcs | 15 | +| 5 | Jaffa Cakes | Pcs | 18 | +| 7 | Salt n Shake | Pcs | | ++---------+--------------+-----------+------------+ + + + +company or RIGHT table data +``` نص + ------------ + --------------- + -------------- + | _معرف_ الشركة _|_ اسم _الشركة_ | COMPANY\_CITY | + ------------ + --------------- + -------------- + | 18 | ترتيب كل | بوسطن | 15 | جاك هيل المحدودة لندن | | 16 | أكاس للأغذية | دلهي | | 17 | عشاق الطعام. | لندن | | 19 | رشفة ن دغة. | نيويورك + ------------ + --------------- + -------------- + - `To get company name from company table and company ID, item name columns from foods table, the following SQL statement can be used: -` +``` +To get company name from company table and company ID, item name columns from foods table, the following SQL statement can be used: +``` مزود SELECT company.company _id ، company.company_ name ، company.company _city، foods.company_ id، foods.item _name من الشركة الحق في الانضمام إلى الأطعمة على company.company_ id = foods.company\_id؛ - `OUTPUT -` +``` +OUTPUT +``` نص COMPANY _ID COMPANY_ NAME COMPANY _CITY COMPANY_ ID ITEM\_NAME diff --git a/guide/arabic/sql/sql-select-distinct-statement/index.md b/guide/arabic/sql/sql-select-distinct-statement/index.md index b329665afc..16b48f9f09 100644 --- a/guide/arabic/sql/sql-select-distinct-statement/index.md +++ b/guide/arabic/sql/sql-select-distinct-statement/index.md @@ -10,40 +10,44 @@ localeTitle: SQL حدد بيان مميز ### عرض كامل للبيانات في جدول الطالب - `USE fcc_sql_guides_database; - SELECT studentID, FullName, sat_score, programOfStudy, rcd_Created, rcd_Updated FROM student; -` +```sql +USE fcc_sql_guides_database; +SELECT studentID, FullName, sat_score, programOfStudy, rcd_Created, rcd_Updated FROM student; +``` - `+-----------+------------------------+-----------+------------------+---------------------+---------------------+ - | studentID | FullName | sat_score | programOfStudy | rcd_Created | rcd_Updated | - +-----------+------------------------+-----------+------------------+---------------------+---------------------+ - | 1 | Monique Davis | 400 | Literature | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 2 | Teri Gutierrez | 800 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 3 | Spencer Pautier | 1000 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 4 | Louis Ramsey | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 5 | Alvin Greene | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 6 | Sophie Freeman | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 7 | Edgar Frank "Ted" Codd | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | - | 8 | Donald D. Chamberlin | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | - | 9 | Raymond F. Boyce | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | - +-----------+------------------------+-----------+------------------+---------------------+---------------------+ - 9 rows in set (0.00 sec) -` +```text ++-----------+------------------------+-----------+------------------+---------------------+---------------------+ +| studentID | FullName | sat_score | programOfStudy | rcd_Created | rcd_Updated | ++-----------+------------------------+-----------+------------------+---------------------+---------------------+ +| 1 | Monique Davis | 400 | Literature | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 2 | Teri Gutierrez | 800 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 3 | Spencer Pautier | 1000 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 4 | Louis Ramsey | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 5 | Alvin Greene | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 6 | Sophie Freeman | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 7 | Edgar Frank "Ted" Codd | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | +| 8 | Donald D. Chamberlin | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | +| 9 | Raymond F. Boyce | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | ++-----------+------------------------+-----------+------------------+---------------------+---------------------+ +9 rows in set (0.00 sec) +``` ### الحصول على قائمة من مجالات الدراسة - `SELECT DISTINCT programOfStudy FROM student; -` +```sql +SELECT DISTINCT programOfStudy FROM student; +``` - `+------------------+ - | programOfStudy | - +------------------+ - | Literature | - | Programming | - | Computer Science | - +------------------+ - 3 rows in set (0.00 sec) -` +```text ++------------------+ +| programOfStudy | ++------------------+ +| Literature | +| Programming | +| Computer Science | ++------------------+ +3 rows in set (0.00 sec) +``` كما هو الحال مع كل هذه الأشياء SQL هناك أكثر من ذلك بكثير من ما هو موجود في هذا الدليل التمهيدي. diff --git a/guide/arabic/sql/sql-select-statement/index.md b/guide/arabic/sql/sql-select-statement/index.md index 9b08488eb2..54fae84080 100644 --- a/guide/arabic/sql/sql-select-statement/index.md +++ b/guide/arabic/sql/sql-select-statement/index.md @@ -10,25 +10,27 @@ localeTitle: تحديد بيان SQL يوضح هذا المثال ثلاثة أعمدة محددة من جدول "الطالب" وعمود واحد محسوب. تقوم قاعدة البيانات بتخزين الطالب ID ، و FirstName ، و LastName للطالب. يمكننا دمج الأعمدة الأول واسم العائلة لإنشاء العمود المحتسب لـ FullName. - `select studentID, FirstName, LastName, FirstName + ' ' + LastName as FullName - from student; -` +```sql +select studentID, FirstName, LastName, FirstName + ' ' + LastName as FullName +from student; +``` - `+-----------+-------------------+------------+------------------------+ - | studentID | FirstName | LastName | FullName | - +-----------+-------------------+------------+------------------------+ - | 1 | Monique | Davis | Monique Davis | - | 2 | Teri | Gutierrez | Teri Gutierrez | - | 3 | Spencer | Pautier | Spencer Pautier | - | 4 | Louis | Ramsey | Louis Ramsey | - | 5 | Alvin | Greene | Alvin Greene | - | 6 | Sophie | Freeman | Sophie Freeman | - | 7 | Edgar Frank "Ted" | Codd | Edgar Frank "Ted" Codd | - | 8 | Donald D. | Chamberlin | Donald D. Chamberlin | - | 9 | Raymond F. | Boyce | Raymond F. Boyce | - +-----------+-------------------+------------+------------------------+ - 9 rows in set (0.00 sec) -` +```text ++-----------+-------------------+------------+------------------------+ +| studentID | FirstName | LastName | FullName | ++-----------+-------------------+------------+------------------------+ +| 1 | Monique | Davis | Monique Davis | +| 2 | Teri | Gutierrez | Teri Gutierrez | +| 3 | Spencer | Pautier | Spencer Pautier | +| 4 | Louis | Ramsey | Louis Ramsey | +| 5 | Alvin | Greene | Alvin Greene | +| 6 | Sophie | Freeman | Sophie Freeman | +| 7 | Edgar Frank "Ted" | Codd | Edgar Frank "Ted" Codd | +| 8 | Donald D. | Chamberlin | Donald D. Chamberlin | +| 9 | Raymond F. | Boyce | Raymond F. Boyce | ++-----------+-------------------+------------+------------------------+ +9 rows in set (0.00 sec) +``` \* كما هو الحال مع جميع هذه الأشياء SQL هناك أكثر من ذلك بكثير من ما هو موجود في هذا الدليل التمهيدي. diff --git a/guide/arabic/sql/sql-sum-function/index.md b/guide/arabic/sql/sql-sum-function/index.md index 78572a2ede..f26a6277c1 100644 --- a/guide/arabic/sql/sql-sum-function/index.md +++ b/guide/arabic/sql/sql-sum-function/index.md @@ -16,27 +16,29 @@ localeTitle: دالة Sum Sum إن ترتيب مجموعة البيانات هذه في ترتيب تنازلي (DESC) يضع المرشحين الذين لديهم أكبر مساهمات إجمالية في أعلى القائمة. - `SELECT Candidate, Election_year, sum(Total_$), count(*) - FROM combined_party_data - WHERE Election_year = 2016 - GROUP BY Candidate, Election_year -- this tells the DBMS to summarize by these two columns - HAVING sum(Total_$) > 20000000 -- limits the rows presented from the summary of money ($20 Million USD) - ORDER BY sum(Total_$) DESC; -- orders the presented rows with the largest ones first. -` +```sql +SELECT Candidate, Election_year, sum(Total_$), count(*) +FROM combined_party_data +WHERE Election_year = 2016 +GROUP BY Candidate, Election_year -- this tells the DBMS to summarize by these two columns +HAVING sum(Total_$) > 20000000 -- limits the rows presented from the summary of money ($20 Million USD) +ORDER BY sum(Total_$) DESC; -- orders the presented rows with the largest ones first. +``` - `+--------------------------------------------------+---------------+-------------------+----------+ - | Candidate | Election_year | sum(Total_$) | count(*) | - +--------------------------------------------------+---------------+-------------------+----------+ - | CLINTON, HILLARY RODHAM & KAINE, TIMOTHY M (TIM) | 2016 | 568135094.4400003 | 126 | - | TRUMP, DONALD J & PENCE, MICHAEL R (MIKE) | 2016 | 366853142.7899999 | 114 | - | SANDERS, BERNARD (BERNIE) | 2016 | 258562022.17 | 122 | - | CRUZ, RAFAEL EDWARD (TED) | 2016 | 93430700.29000005 | 104 | - | CARSON, BENJAMIN S (BEN) | 2016 | 62202411.12999996 | 93 | - | RUBIO, MARCO ANTONIO | 2016 | 44384313.9 | 106 | - | BUSH, JOHN ELLIS (JEB) | 2016 | 34606731.78 | 97 | - +--------------------------------------------------+---------------+-------------------+----------+ - 7 rows in set (0.01 sec) -` +```text ++--------------------------------------------------+---------------+-------------------+----------+ +| Candidate | Election_year | sum(Total_$) | count(*) | ++--------------------------------------------------+---------------+-------------------+----------+ +| CLINTON, HILLARY RODHAM & KAINE, TIMOTHY M (TIM) | 2016 | 568135094.4400003 | 126 | +| TRUMP, DONALD J & PENCE, MICHAEL R (MIKE) | 2016 | 366853142.7899999 | 114 | +| SANDERS, BERNARD (BERNIE) | 2016 | 258562022.17 | 122 | +| CRUZ, RAFAEL EDWARD (TED) | 2016 | 93430700.29000005 | 104 | +| CARSON, BENJAMIN S (BEN) | 2016 | 62202411.12999996 | 93 | +| RUBIO, MARCO ANTONIO | 2016 | 44384313.9 | 106 | +| BUSH, JOHN ELLIS (JEB) | 2016 | 34606731.78 | 97 | ++--------------------------------------------------+---------------+-------------------+----------+ +7 rows in set (0.01 sec) +``` كما هو الحال مع كل هذه الأشياء SQL هناك أكثر من ذلك بكثير من ما هو موجود في هذا الدليل التمهيدي. diff --git a/guide/arabic/sql/sql-syntax/index.md b/guide/arabic/sql/sql-syntax/index.md index a6b1453cc1..48ba67c0ce 100644 --- a/guide/arabic/sql/sql-syntax/index.md +++ b/guide/arabic/sql/sql-syntax/index.md @@ -22,8 +22,9 @@ localeTitle: بناء جملة SQL يتم استخدام هذا لتحديد قاعدة البيانات التي تحتوي على جداول عبارات SQL الخاصة بك: - `use fcc_sql_guides_database; -- select the guide sample database -` +```sql +use fcc_sql_guides_database; -- select the guide sample database +``` ### اختر من جمل diff --git a/guide/arabic/sql/sql-union-operator/index.md b/guide/arabic/sql/sql-union-operator/index.md index 0c8769b3b7..5bfa18b551 100644 --- a/guide/arabic/sql/sql-union-operator/index.md +++ b/guide/arabic/sql/sql-union-operator/index.md @@ -16,21 +16,23 @@ localeTitle: مشغل اتحاد SQL بيان SQL - `SELECT 'aaaaa' - UNION - SELECT 'bbbbbbbbb'; -` +```sql +SELECT 'aaaaa' +UNION +SELECT 'bbbbbbbbb'; +``` انتاج | - `+-----------+ - | aaaaa | - +-----------+ - | aaaaa | - | bbbbbbbbb | - +-----------+ - 2 rows in set (0.00 sec) -` +```text ++-----------+ +| aaaaa | ++-----------+ +| aaaaa | +| bbbbbbbbb | ++-----------+ +2 rows in set (0.00 sec) +``` ### مثال باستخدام جداول الطلاب @@ -45,15 +47,16 @@ localeTitle: مشغل اتحاد SQL \`\` \`النص + ----------- + -------------------------------- + | StudentID | FullName | + ----------- + -------------------------------- + | 1 | مونيك ديفيز | 2 | تيري جوتيريز | | 3 | سبنسر باوتير | | 4 | لويس رمزي | 5 | ألفين غرين | | 7 | Maximo.Smith@freeCodeCamp.org | | 8 | Michael.Roach@freeCodeCamp.ort | + ----------- + -------------------------------- + 7 صفوف في مجموعة (0.00 ثانية) - `## SQL UNION ALL Operator - - The UNION ALL operator is an extension to UNION operator where it should result you a A+B of rows in the ouptput assuming A and B is your input, in simple terms UNION ALL doesn't deduplicate. - - - ### Basic Syntax - - SQL Statement -` +``` +## SQL UNION ALL Operator + +The UNION ALL operator is an extension to UNION operator where it should result you a A+B of rows in the ouptput assuming A and B is your input, in simple terms UNION ALL doesn't deduplicate. + + +### Basic Syntax + +SQL Statement +``` مزود SELECT expression1، expression2،… expression _n من الجداول \[حيث الظروف\] الاتحاد كله SELECT expression1، expression2،… expression_ n من الجداول \[حيث الظروف\] ؛ \`\` \` diff --git a/guide/arabic/sql/sql-update-query/index.md b/guide/arabic/sql/sql-update-query/index.md index 9f899f148a..3d857866a0 100644 --- a/guide/arabic/sql/sql-update-query/index.md +++ b/guide/arabic/sql/sql-update-query/index.md @@ -18,24 +18,26 @@ localeTitle: استعلام تحديث SQL هذا هو جدول الطلاب ونحن نبدأ هذه العملية - `SELECT * FROM student; -` +```sql +SELECT * FROM student; +``` - `+-----------+------------------------+-----------+------------------+---------------------+---------------------+ - | studentID | FullName | sat_score | programOfStudy | rcd_Created | rcd_Updated | - +-----------+------------------------+-----------+------------------+---------------------+---------------------+ - | 1 | Monique Davis | 400 | Literature | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 2 | Teri Gutierrez | 800 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 3 | Spencer Pautier | 1000 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 4 | Louis Ramsey | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 5 | Alvin Greene | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 6 | Sophie Freeman | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | - | 7 | Edgar Frank "Ted" Codd | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | - | 8 | Donald D. Chamberlin | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | - | 9 | Raymond F. Boyce | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | - +-----------+------------------------+-----------+------------------+---------------------+---------------------+ - 9 rows in set (0.00 sec) -` +```text ++-----------+------------------------+-----------+------------------+---------------------+---------------------+ +| studentID | FullName | sat_score | programOfStudy | rcd_Created | rcd_Updated | ++-----------+------------------------+-----------+------------------+---------------------+---------------------+ +| 1 | Monique Davis | 400 | Literature | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 2 | Teri Gutierrez | 800 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 3 | Spencer Pautier | 1000 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 4 | Louis Ramsey | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 5 | Alvin Greene | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 6 | Sophie Freeman | 1200 | Programming | 2017-08-16 15:34:50 | 2017-08-16 15:34:50 | +| 7 | Edgar Frank "Ted" Codd | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | +| 8 | Donald D. Chamberlin | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | +| 9 | Raymond F. Boyce | 2400 | Computer Science | 2017-08-16 15:35:33 | 2017-08-16 15:35:33 | ++-----------+------------------------+-----------+------------------+---------------------+---------------------+ +9 rows in set (0.00 sec) +``` ### تغيير الجدول وإضافة حقل جديد @@ -45,45 +47,48 @@ localeTitle: استعلام تحديث SQL يتم تنفيذ جدول الطالب بعد التعديل. - `mysql> SELECT FullName, sat_score, programOfStudy, schoolEmailAdr FROM student; - +------------------------+-----------+------------------+----------------+ - | FullName | sat_score | programOfStudy | schoolEmailAdr | - +------------------------+-----------+------------------+----------------+ - | Monique Davis | 400 | Literature | NULL | - | Teri Gutierrez | 800 | Programming | NULL | - | Spencer Pautier | 1000 | Programming | NULL | - | Louis Ramsey | 1200 | Programming | NULL | - | Alvin Greene | 1200 | Programming | NULL | - | Sophie Freeman | 1200 | Programming | NULL | - | Edgar Frank "Ted" Codd | 2400 | Computer Science | NULL | - | Donald D. Chamberlin | 2400 | Computer Science | NULL | - | Raymond F. Boyce | 2400 | Computer Science | NULL | - +------------------------+-----------+------------------+----------------+ - 9 rows in set (0.00 sec) -` +```text +mysql> SELECT FullName, sat_score, programOfStudy, schoolEmailAdr FROM student; ++------------------------+-----------+------------------+----------------+ +| FullName | sat_score | programOfStudy | schoolEmailAdr | ++------------------------+-----------+------------------+----------------+ +| Monique Davis | 400 | Literature | NULL | +| Teri Gutierrez | 800 | Programming | NULL | +| Spencer Pautier | 1000 | Programming | NULL | +| Louis Ramsey | 1200 | Programming | NULL | +| Alvin Greene | 1200 | Programming | NULL | +| Sophie Freeman | 1200 | Programming | NULL | +| Edgar Frank "Ted" Codd | 2400 | Computer Science | NULL | +| Donald D. Chamberlin | 2400 | Computer Science | NULL | +| Raymond F. Boyce | 2400 | Computer Science | NULL | ++------------------------+-----------+------------------+----------------+ +9 rows in set (0.00 sec) +``` ### اختبار المنطق (خطوة مهمة جدا!) - `SELECT FullName, instr(FullName," ") AS firstSpacePosition, - concat(substring(FullName,1,instr(FullName," ")-1),"@someSchool.edu") AS schoolEmail - FROM student; -` +```sql +SELECT FullName, instr(FullName," ") AS firstSpacePosition, +concat(substring(FullName,1,instr(FullName," ")-1),"@someSchool.edu") AS schoolEmail +FROM student; +``` - `+------------------------+--------------------+------------------------+ - | FullName | firstSpacePosition | schoolEmail | - +------------------------+--------------------+------------------------+ - | Monique Davis | 8 | Monique@someSchool.edu | - | Teri Gutierrez | 5 | Teri@someSchool.edu | - | Spencer Pautier | 8 | Spencer@someSchool.edu | - | Louis Ramsey | 6 | Louis@someSchool.edu | - | Alvin Greene | 6 | Alvin@someSchool.edu | - | Sophie Freeman | 7 | Sophie@someSchool.edu | - | Edgar Frank "Ted" Codd | 6 | Edgar@someSchool.edu | - | Donald D. Chamberlin | 7 | Donald@someSchool.edu | - | Raymond F. Boyce | 8 | Raymond@someSchool.edu | - +------------------------+--------------------+------------------------+ - 9 rows in set (0.00 sec) -` +```text ++------------------------+--------------------+------------------------+ +| FullName | firstSpacePosition | schoolEmail | ++------------------------+--------------------+------------------------+ +| Monique Davis | 8 | Monique@someSchool.edu | +| Teri Gutierrez | 5 | Teri@someSchool.edu | +| Spencer Pautier | 8 | Spencer@someSchool.edu | +| Louis Ramsey | 6 | Louis@someSchool.edu | +| Alvin Greene | 6 | Alvin@someSchool.edu | +| Sophie Freeman | 7 | Sophie@someSchool.edu | +| Edgar Frank "Ted" Codd | 6 | Edgar@someSchool.edu | +| Donald D. Chamberlin | 7 | Donald@someSchool.edu | +| Raymond F. Boyce | 8 | Raymond@someSchool.edu | ++------------------------+--------------------+------------------------+ +9 rows in set (0.00 sec) +``` _ملاحظة حول concat (): في MySQL يتم استخدام هذا الأمر في سلاسل مدمجة ، وليس كذلك في إصدارات SQL الأخرى (راجع الدليل). في هذا الاستخدام يعمل مثل هذا: يتم دمج السلسلة الفرعية للحقل FullName مع عدم تضمين المساحة الأولى مع "@ someSchool.edu". في العالم الحقيقي سيكون هذا أكثر تعقيدًا وستحتاج إلى التأكد من أن عنوان البريد الإلكتروني فريد من نوعه._ @@ -91,28 +96,30 @@ _ملاحظة حول concat (): في MySQL يتم استخدام هذا الأم سنتظاهر بأن هذا ما نريده ونحدّث الجدول بهذه المعلومات: - `UPDATE student SET schoolEmailAdr = concat(substring(FullName,1,instr(FullName," ")-1),"@someSchool.edu") - WHERE schoolEmailAdr is NULL; -` +```sql +UPDATE student SET schoolEmailAdr = concat(substring(FullName,1,instr(FullName," ")-1),"@someSchool.edu") +WHERE schoolEmailAdr is NULL; +``` نجاح! - `mysql> SELECT FullName, sat_score, programOfStudy, schoolEmailAdr FROM student; - +------------------------+-----------+------------------+------------------------+ - | FullName | sat_score | programOfStudy | schoolEmailAdr | - +------------------------+-----------+------------------+------------------------+ - | Monique Davis | 400 | Literature | Monique@someSchool.edu | - | Teri Gutierrez | 800 | Programming | Teri@someSchool.edu | - | Spencer Pautier | 1000 | Programming | Spencer@someSchool.edu | - | Louis Ramsey | 1200 | Programming | Louis@someSchool.edu | - | Alvin Greene | 1200 | Programming | Alvin@someSchool.edu | - | Sophie Freeman | 1200 | Programming | Sophie@someSchool.edu | - | Edgar Frank "Ted" Codd | 2400 | Computer Science | Edgar@someSchool.edu | - | Donald D. Chamberlin | 2400 | Computer Science | Donald@someSchool.edu | - | Raymond F. Boyce | 2400 | Computer Science | Raymond@someSchool.edu | - +------------------------+-----------+------------------+------------------------+ - 9 rows in set (0.00 sec) -` +```text +mysql> SELECT FullName, sat_score, programOfStudy, schoolEmailAdr FROM student; ++------------------------+-----------+------------------+------------------------+ +| FullName | sat_score | programOfStudy | schoolEmailAdr | ++------------------------+-----------+------------------+------------------------+ +| Monique Davis | 400 | Literature | Monique@someSchool.edu | +| Teri Gutierrez | 800 | Programming | Teri@someSchool.edu | +| Spencer Pautier | 1000 | Programming | Spencer@someSchool.edu | +| Louis Ramsey | 1200 | Programming | Louis@someSchool.edu | +| Alvin Greene | 1200 | Programming | Alvin@someSchool.edu | +| Sophie Freeman | 1200 | Programming | Sophie@someSchool.edu | +| Edgar Frank "Ted" Codd | 2400 | Computer Science | Edgar@someSchool.edu | +| Donald D. Chamberlin | 2400 | Computer Science | Donald@someSchool.edu | +| Raymond F. Boyce | 2400 | Computer Science | Raymond@someSchool.edu | ++------------------------+-----------+------------------+------------------------+ +9 rows in set (0.00 sec) +``` كما هو الحال مع كل هذه الأشياء SQL هناك أكثر من ذلك بكثير من ما هو موجود في هذا الدليل التمهيدي. diff --git a/guide/arabic/sql/sql-update-statement/index.md b/guide/arabic/sql/sql-update-statement/index.md index e82d0e740f..6b18189715 100644 --- a/guide/arabic/sql/sql-update-statement/index.md +++ b/guide/arabic/sql/sql-update-statement/index.md @@ -8,32 +8,36 @@ localeTitle: SQL Update Statement كن حذرا. يمكنك تحديث جميع سجلات الجدول أو عدد قليل فقط. استخدم شرط `WHERE` لتحديد السجلات التي تريد تحديثها. من الممكن تحديث عمود واحد أو أكثر في كل مرة. الصيغة هي: - `UPDATE table_name - SET column1 = value1, - column2 = value2, ... - WHERE condition; -` +```sql +UPDATE table_name +SET column1 = value1, + column2 = value2, ... +WHERE condition; +``` في ما يلي مثال على تحديث اسم السجل الذي يحمل الرقم التعريفي 4: - `UPDATE Person - SET Name = “Elton John” - WHERE Id = 4; -` +```sql +UPDATE Person +SET Name = “Elton John” +WHERE Id = 4; +``` يمكنك أيضًا تحديث الأعمدة في جدول باستخدام القيم من الجداول الأخرى. استخدم جملة `JOIN` للحصول على البيانات من جداول متعددة. الصيغة هي: - `UPDATE table_name1 - SET table_name1.column1 = table_name2.columnA - table_name1.column2 = table_name2.columnB - FROM table_name1 - JOIN table_name2 ON table_name1.ForeignKey = table_name2.Key -` +```sql +UPDATE table_name1 +SET table_name1.column1 = table_name2.columnA + table_name1.column2 = table_name2.columnB +FROM table_name1 +JOIN table_name2 ON table_name1.ForeignKey = table_name2.Key +``` في ما يلي مثال على تحديث مدير جميع السجلات: - `UPDATE Person - SET Person.Manager = Department.Manager - FROM Person - JOIN Department ON Person.DepartmentID = Department.ID -` \ No newline at end of file +```sql +UPDATE Person +SET Person.Manager = Department.Manager +FROM Person +JOIN Department ON Person.DepartmentID = Department.ID +``` \ No newline at end of file diff --git a/guide/arabic/sql/sql-where-clause/index.md b/guide/arabic/sql/sql-where-clause/index.md index 3979130815..4173ccde45 100644 --- a/guide/arabic/sql/sql-where-clause/index.md +++ b/guide/arabic/sql/sql-where-clause/index.md @@ -12,24 +12,26 @@ localeTitle: SQL حيث البند في ما يلي قائمة الطلاب الكاملة الحالية لمقارنة مجموعة نتائج `WHERE` : - `select studentID, FullName, sat_score, rcd_updated from student; -` +```sql +select studentID, FullName, sat_score, rcd_updated from student; +``` - `+-----------+------------------------+-----------+---------------------+ - | studentID | FullName | sat_score | rcd_updated | - +-----------+------------------------+-----------+---------------------+ - | 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | - | 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 | - | 3 | Spencer Pautier | 1000 | 2017-08-16 15:34:50 | - | 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 | - | 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | - | 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 | - | 7 | Edgar Frank "Ted" Codd | 2400 | 2017-08-16 15:35:33 | - | 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | - | 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 | - +-----------+------------------------+-----------+---------------------+ - 9 rows in set (0.00 sec) -` +```text ++-----------+------------------------+-----------+---------------------+ +| studentID | FullName | sat_score | rcd_updated | ++-----------+------------------------+-----------+---------------------+ +| 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | +| 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 | +| 3 | Spencer Pautier | 1000 | 2017-08-16 15:34:50 | +| 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 | +| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | +| 6 | Sophie Freeman | 1200 | 2017-08-16 15:34:50 | +| 7 | Edgar Frank "Ted" Codd | 2400 | 2017-08-16 15:35:33 | +| 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | +| 9 | Raymond F. Boyce | 2400 | 2017-08-16 15:35:33 | ++-----------+------------------------+-----------+---------------------+ +9 rows in set (0.00 sec) +``` سيتم تقديم الصفوف التي ... @@ -38,24 +40,26 @@ localeTitle: SQL حيث البند في ما يلي طلب بحث محدّث ، حيث لن يتم عرض أي سجل يحتوي على درجة SAT في هذه القائمة (1000 ، 1400): - `select studentID, FullName, sat_score, recordUpdated - from student - where (studentID between 1 and 5 or studentID = 8) - and - sat_score NOT in (1000, 1400); -` +```sql +select studentID, FullName, sat_score, recordUpdated +from student +where (studentID between 1 and 5 or studentID = 8) + and + sat_score NOT in (1000, 1400); +``` - `+-----------+----------------------+-----------+---------------------+ - | studentID | FullName | sat_score | rcd_updated | - +-----------+----------------------+-----------+---------------------+ - | 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | - | 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 | - | 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 | - | 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | - | 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | - +-----------+----------------------+-----------+---------------------+ - 5 rows in set (0.00 sec) -` +```text ++-----------+----------------------+-----------+---------------------+ +| studentID | FullName | sat_score | rcd_updated | ++-----------+----------------------+-----------+---------------------+ +| 1 | Monique Davis | 400 | 2017-08-16 15:34:50 | +| 2 | Teri Gutierrez | 800 | 2017-08-16 15:34:50 | +| 4 | Louis Ramsey | 1200 | 2017-08-16 15:34:50 | +| 5 | Alvin Greene | 1200 | 2017-08-16 15:34:50 | +| 8 | Donald D. Chamberlin | 2400 | 2017-08-16 15:35:33 | ++-----------+----------------------+-----------+---------------------+ +5 rows in set (0.00 sec) +``` \* كما هو الحال مع جميع هذه الأشياء SQL هناك أكثر من ذلك بكثير من ما هو موجود في هذا الدليل التمهيدي. diff --git a/guide/arabic/ssh/managing-multiple-ssh-keys/index.md b/guide/arabic/ssh/managing-multiple-ssh-keys/index.md index aff9f0e3da..de19ae07c7 100644 --- a/guide/arabic/ssh/managing-multiple-ssh-keys/index.md +++ b/guide/arabic/ssh/managing-multiple-ssh-keys/index.md @@ -24,25 +24,28 @@ localeTitle: إدارة عدة مفاتيح SSH لبدء عملك ، عليك استنساخ مستودع git باستخدام SSH: - `git clone git@github.com:steve/raspberry-spy.git -` +```bash +git clone git@github.com:steve/raspberry-spy.git +``` في هذه اللحظة ، سيكون GitHub مثل: "Yo ، هذا مستودع خاص! نحن بحاجة إلى تشفير حركة المرور باستخدام هذا المفتاح العام الذي أمتلكه هنا ومفتاحك الخاص" لقد قمت بإضافة المفتاح العام إلى ملف التعريف الخاص بك على GitHub ، ولكن SSH لديه بطريقة أو بأخرى معرفة أين يوجد المفتاح الخاص المقابل الخاص بك. نظرًا لأننا لا نملك أي فكرة عن المفتاح الخاص الذي يجب استخدامه عند استخدام SSH في `git@github.com` ، يحاول عميل SSH العثور على مفتاح في الموقع الافتراضي ، وهو `~/.ssh/id_rsa` - إنه أفضل تخمين له. إذا لم يكن هناك ملف في هذا الموقع ، فستتلقى خطأً: - `Cloning into 'raspberry-spy'... - Permission denied (publickey). - fatal: Could not read from remote repository. - - Please make sure you have the correct access rights - and the repository exists. -` +```bash +Cloning into 'raspberry-spy'... +Permission denied (publickey). +fatal: Could not read from remote repository. + +Please make sure you have the correct access rights +and the repository exists. +``` إذا كان لديك _بعض_ المفاتيح الخاصة المخزنة في الملف `~/.ssh/id_rsa` ، `~/.ssh/id_rsa` عميل SSH هذا المفتاح الخاص لتشفير الاتصالات. إذا كان هذا المفتاح مرتبطًا بكلمة مرور (كما ينبغي أن يكون) ، فستتم مطالبتك بكلمة مرور ، مثل: - `Enter passphrase for key '/Users/steve/.ssh/id_rsa': -` +```bash +Enter passphrase for key '/Users/steve/.ssh/id_rsa': +``` إذا أدخلت عبارة المرور الصحيحة وإذا كان هذا المفتاح الخاص هو بالفعل المفتاح الذي يتوافق مع المفتاح العام الذي أرفقته بملفك الشخصي ، فسيتم سداد كل شيء بشكل جيد وسيتم استنساخ المستودع بنجاح. @@ -50,8 +53,9 @@ localeTitle: إدارة عدة مفاتيح SSH إذا كنت تريد استخدام مفتاح خاص سميته بشكل مختلف ، فيجب عليك إضافته يدويًا: - `ssh-add ~/.ssh/_id_rsa -` +```bash +ssh-add ~/.ssh/_id_rsa +``` بعد إدخال عبارة المرور ، يمكنك التحقق مما إذا كان المفتاح قد تمت إضافته إلى `ssh-agent` (عميل SSH) عن طريق تنفيذ `ssh-add -l` . يقوم هذا الأمر بإدراج جميع المفاتيح المتوفرة حاليًا لعميل SSH. @@ -77,21 +81,23 @@ localeTitle: إدارة عدة مفاتيح SSH أول شيء سنقوم بحله باستخدام ملف `config` هذا هو تجنب الاضطرار إلى إضافة مفاتيح SSH ذات اسم مخصص باستخدام `ssh-add` . بفرض افتراض أن مفتاح SSH الخاص بك هو `~/.ssh/_id_rsa` ، أضف المتابعة إلى ملف `config` : - `Host github.com - HostName github.com - User git - IdentityFile ~/.ssh/_id_rsa - IdentitiesOnly yes -` +```bash +Host github.com + HostName github.com + User git + IdentityFile ~/.ssh/_id_rsa + IdentitiesOnly yes +``` الآن تأكد من أن `~/.ssh/_id_rsa` ليس في `ssh-agent` بتنفيذ `ssh-add -D` . سيؤدي هذا الأمر إلى إزالة كافة المفاتيح من جلسة عمل `ssh-agent` النشطة حاليًا. يتم إعادة ضبط الجلسة في كل مرة تقوم فيها بتسجيل الخروج أو إعادة التشغيل (أو إذا قمت بقتل عملية `ssh-agent` يدوياً). يمكننا "محاكاة" إعادة التشغيل عن طريق تنفيذ الأمر المذكور. إذا حاولت استنساخ مستودع GitHub الخاص بك الآن ، فسيكون ذلك كما لو قمنا بإضافة المفتاح يدويًا (كما فعلنا من قبل). سيُطلب منك كلمة المرور: - `git clone git@github.com:steve/raspberry-spy.git - Cloning into 'raspberry-spy'... - Enter passphrase for key '/Users/steve/.ssh/_id_rsa': -` +```bash +git clone git@github.com:steve/raspberry-spy.git +Cloning into 'raspberry-spy'... +Enter passphrase for key '/Users/steve/.ssh/_id_rsa': +``` ستلاحظ أن المفتاح الذي نطالب بكلمة المرور الخاصة به هو نفس المفتاح الذي حددناه في ملف `config` بنا. بعد إدخال كلمة مرور مفتاح SSH الصحيحة ، سيتم استنساخ المستودع بنجاح. @@ -101,32 +107,35 @@ localeTitle: إدارة عدة مفاتيح SSH هذا يفتح البوابات. عندما تقوم بإعادة هذا ، فإن ذهنك يتسابق ويفكر في كيفية انتهاء كل مشاكلك مع مفاتيح SSH. فيما يلي بعض أمثلة التكوين المفيدة: - `Host bitbucket-corporate - HostName bitbucket.org - User git - IdentityFile ~/.ssh/id_rsa_corp - IdentitiesOnly yes -` +```bash +Host bitbucket-corporate + HostName bitbucket.org + User git + IdentityFile ~/.ssh/id_rsa_corp + IdentitiesOnly yes +``` الآن يمكنك استخدام `git clone git@bitbucket-corporate:company/project.git` - `Host bitbucket-personal - HostName bitbucket.org - User git - IdentityFile ~/.ssh/id_rsa_personal - IdentitiesOnly yes -` +```bash +Host bitbucket-personal + HostName bitbucket.org + User git + IdentityFile ~/.ssh/id_rsa_personal + IdentitiesOnly yes +``` الآن يمكنك استخدام `git clone git@bitbucket-personal:steve/other-pi-project.git` - `Host myserver - HostName ssh.steve.com - Port 1111 - IdentityFile ~/.ssh/id_rsa_personal - IdentitiesOnly yes - User steve - IdentitiesOnly yes -` +``` +Host myserver + HostName ssh.steve.com + Port 1111 + IdentityFile ~/.ssh/id_rsa_personal + IdentitiesOnly yes + User steve + IdentitiesOnly yes +``` الآن يمكنك SSH في الخادم الخاص بك باستخدام `ssh myserver` . كم ذلك رائع؟ لا تحتاج إلى إدخال المنفذ واسم المستخدم يدويًا في كل مرة تقوم فيها بتنفيذ الأمر `ssh` . @@ -134,14 +143,16 @@ localeTitle: إدارة عدة مفاتيح SSH يمكنك أيضًا تحديد المفتاح المحدد الذي يجب استخدامه لمخزون معين ، وتجاوز أي شيء في `config` SSH. يمكن تحديد أمر SSH محدد عن طريق تعيين `sshCommand` تحت `core` في `/.git/config` . مثال: - `[core] - sshCommand = ssh -i ~/.ssh/id_rsa_corp -` +```bash +[core] + sshCommand = ssh -i ~/.ssh/id_rsa_corp +``` هذا ممكن مع git 2.10 أو في وقت لاحق. يمكنك أيضًا استخدام هذا الأمر لتجنب تعديل الملف يدويًا: - `git config core.sshCommand 'ssh -i ~/.ssh/id_rsa_corp' -` +```bash +git config core.sshCommand 'ssh -i ~/.ssh/id_rsa_corp' +``` ### إدارة كلمة المرور @@ -149,8 +160,9 @@ localeTitle: إدارة عدة مفاتيح SSH ابدأ بإضافة مفتاحك إلى keychain عبر تمرير الخيار `-K` إلى الأمر `ssh-add` : - `ssh-add -K ~/.ssh/id_rsa_whatever -` +```bash +ssh-add -K ~/.ssh/id_rsa_whatever +``` يمكنك الآن رؤية مفتاح SSH في keychain. على MacOS ، يبدو الأمر كالتالي: ![Keychain Access](https://raw.githubusercontent.com/fvoska/guides/master/static/images/pages/ssh/managing-multiple-ssh-keys/keychain-access.png "الوصول إلى سلسلة المفاتيح") @@ -158,10 +170,11 @@ localeTitle: إدارة عدة مفاتيح SSH اتضح أن هناك طارة واحدة أكثر من القفز. افتح ملف SSH `config` الخاص بك وقم بإضافة ما يلي: - `Host * - AddKeysToAgent yes - UseKeychain yes -` +```bash +Host * + AddKeysToAgent yes + UseKeychain yes +``` الآن ، سوف تبحث SSH عن المفتاح في keychain وإذا وجدت أنه لن تتم مطالبتك بكلمة المرور. مفتاح سيضاف أيضا إلى `ssh-agent` . على MacOS ، سيعمل هذا على MacOS Sierra 10.12.2 أو ما بعده. في Linux ، يمكنك استخدام شيء ما مثل `gnome-keyring` وقد يعمل حتى بدون إجراء هذا التعديل الأخير على `config` SSH. أما بالنسبة لنظام التشغيل Windows - من يدري ، أليس كذلك؟ diff --git a/guide/arabic/svg/index.md b/guide/arabic/svg/index.md index d06c0b4c95..7c898c5e3d 100644 --- a/guide/arabic/svg/index.md +++ b/guide/arabic/svg/index.md @@ -10,10 +10,11 @@ SVG أو Scalable Vector Graphics هو معيار ويب لتعريف الرسو يبدأ المطوّرون رسم SVG باستخدام العلامة `` ومساحة اسم XML كما يلي: - ` - - -` +```svg + + + +``` يتضمن النموذج أيضًا سمة `version` . سمة `version` اختيارية ولكن يُنصح باستخدامها مع مواصفات XML. @@ -67,16 +68,17 @@ SVG أو Scalable Vector Graphics هو معيار ويب لتعريف الرسو جزء. - `

Before canvas .

- < canvas width ="120" height ="60" > -

After canvas .

- < script > - var canvas = document . querySelector (" canvas ") ; - var context = canvas . getContext ("2 d ") ; - context . fillStyle = " red "; - context . fillRect (10 , 10 , 100 , 50) ; - -` +``` +

Before canvas .

+< canvas width ="120" height ="60" > +

After canvas .

+< script > +var canvas = document . querySelector (" canvas ") ; +var context = canvas . getContext ("2 d ") ; +context . fillStyle = " red "; +context . fillRect (10 , 10 , 100 , 50) ; + +``` ![](http://www.crwflags.com/fotw/images/s/sly@stt.gif) @@ -86,40 +88,42 @@ SVG أو Scalable Vector Graphics هو معيار ويب لتعريف الرسو يحتوي متغير النتائج على مصفوفة من الكائنات التي تمثل ردود المسح. - `var results = [ - { name : " Satisfied " , count : 1043 , color : " lightblue "} , - { name : " Neutral " , count : 563 , color : " lightgreen "} , - { name : " Unsatisfied " , count : 510 , color : " pink "} , - { name : " No comment " , count : 175 , color : " silver "} - ]; -` +``` +var results = [ +{ name : " Satisfied " , count : 1043 , color : " lightblue "} , +{ name : " Neutral " , count : 563 , color : " lightgreen "} , +{ name : " Unsatisfied " , count : 510 , color : " pink "} , +{ name : " No comment " , count : 175 , color : " silver "} +]; +``` لرسم مخطط دائري ، نرسم عددًا من الشرائح الدائرية ، تتكون كل منها من قوس وزوج من الخطوط إلى مركز هذا القوس. يمكننا حساب الزاوية المأخوذة من كل قوس بقسمة دائرة كاملة (2 π) على العدد الإجمالي للاستجابات ثم ضرب ذلك العدد (زاوية لكل استجابة) بعدد الأشخاص الذين اختاروا اختيارًا معينًا. - `< canvas width ="200" height ="200" > - < script > - var cx = document . querySelector (" canvas ") . getContext ("2 d ") ; - var total = results . reduce ( function ( sum , choice ) { - return sum + choice . count ; - } , 0) ; - - // Start at the top - - var currentAngle = -0.5 * Math . PI ; - results . forEach ( function ( result ) { - var sliceAngle = ( result . count / total ) * 2 * Math . PI ; - cx . beginPath () ; - // center =100 ,100 , radius =100 - // from current angle , clockwise by slice ' s angle - cx . arc (100 , 100 , 100 , - currentAngle , currentAngle + sliceAngle ); - currentAngle += sliceAngle ; - cx . lineTo (100 , 100) ; - cx . fillStyle = result . color ; - cx . fill () ; - }) ; - -` +``` +< canvas width ="200" height ="200" > +< script > +var cx = document . querySelector (" canvas ") . getContext ("2 d ") ; +var total = results . reduce ( function ( sum , choice ) { +return sum + choice . count ; +} , 0) ; + +// Start at the top + +var currentAngle = -0.5 * Math . PI ; +results . forEach ( function ( result ) { +var sliceAngle = ( result . count / total ) * 2 * Math . PI ; +cx . beginPath () ; +// center =100 ,100 , radius =100 +// from current angle , clockwise by slice ' s angle +cx . arc (100 , 100 , 100 , +currentAngle , currentAngle + sliceAngle ); +currentAngle += sliceAngle ; +cx . lineTo (100 , 100) ; +cx . fillStyle = result . color ; +cx . fill () ; +}) ; + +``` هذا يرسم المخطط التالي: ![](https://pbs.twimg.com/media/CTDvkA8UwAAdJg5.png)