SQL is a powerful programming language dedicated to data in relational databases. It is a language that has existed for decades and is relied upon by many large companies around the world. Data analysts use it to access, read, process and analyze data saved in the database to form a comprehensive view that helps make the right decisions.
We will discuss in detail the mechanism and stages of working on this tool in terms of its query capabilities with databases, while mentioning the types of data analysis.
data analysis
All companies of all sizes and specializations seek advancement and growth, so their primary goal in this approach is to satisfy customers and provide them with the best services. By expanding the customer base, the company grows and thrives, and therefore most companies intend to examine, purify, transform and model data to extract valuable information that helps in making critical decisions, this process It’s called data analysis
Types of data analysis
This classification is done according to the types of data and terms of reference for the analysis process
Descriptive analysis:
It is the main analysis on which the rest of the types of analyzes are based, and it is the simplest, so it is the most used for data in all commercial activities at the present time. This analysis allows extracting trends between the raw data and giving a view of the events in their time. Here, the initial answer to “what happened” appears by summarizing the previous data, and it is usually represented in the form of a dashboard
Diagnostic analysis:
It is the step that immediately follows the previous step, which is to delve deeper into the previous question, “What happened?” This step is embodied in asking another question, which is “Why did it happen?” Diagnostic analysis, then, is the one that completes the work of the descriptive analysis by taking the initial readings resulting from the descriptive analysis and deepening them to interpret and analyze them in order to reach more correlations between the data, so that features of behavior patterns begin to form for us, and from the learned aspects also is that if problems arise during work, then you are Now you have enough data related to this problem, so the solution becomes easier, and thus this saves you from having to re-work
Predictive analytics:
It is complementary to the work of the two previous analyses, and from its name it seems that it makes probabilities and predictions about the events that will come later based on previous predictions in addition to the current variables. Thus, this analysis represents the answer to the third question, which is “what might happen in the future”?
This type of analysis helps companies make more accurate and effective decisions
Mandatory Analysis:
It is the final limit of data analysis capabilities, as it is not satisfied with forecasting or forecasting, but rather proposes options to benefit from the results of previous analyzes, and determines the steps that must be implemented in the event of a potential problem or forming a plan to develop work. This is done by using advanced techniques such as machine learning algorithms. Especially when dealing with huge amounts of data
So this analysis is the answer to the question “what should we do next”? Which defines the general approach to the company’s business plan
What are the advantages of SQL when used in data analysis?
* Easy and uncomplicated language
* Speed in query processing
* Ability to call up big data from different databases
* Providing various documents to analysts
Explain the use of SQL in data analysis
Temporary tables
Temporary tables in SQL are defined as tables that are created to perform a temporary task and persist for a specific period of time or during a session by storing and processing intermediate results using the same join, select, and update techniques.
Assembly as per requirement
For example, this phrase is used to count the number of employees in each department or to obtain the salaries of the department in total, so it is used to extract summary data based on different groups, whether on one or more columns
aggregation functions
Its task is to perform an arithmetic operation on a set of values to extract a single value
String functions and operations
The task of SQL string operators is to perform matching on the form, sequence, capitalize the string, and other matching functions
Date and time operations
Some of the services offered by SQL are many types of date and time tasks such as
SYSUTCDATETIME()
CURRENT_TIMESTAMP
GETDATE()
DAY()
MONTH()
YEAR()
DATEFROMPARTS()
DATETIME2FROMPARTS()
TIMEFROMPARTS()
DATEDIFF()
DATEADD()
ISDATE()
etc. It is used to implement date and time entries
Display and indexing methods
The database is the main repository for the index, so indexing the view helps speed up work and improve the performance of queries and applications that use it
Join:
This statement is used to combine different tables in databases using a primary key and a foreign key
The following explains the different types of JOINs in SQL with an example of data in left and right tables
(INNER) JOIN: Returns records that contain identical values in both tables
LEFT (OUTER) JOIN: Returns all records from the left table and matching records from the right table
RIGHT (OUTER) JOIN : Returns all records from the right table and matching records from the left table
FULL (OUTER) JOIN : Returns all records when there is a match in the left or right table
windows functionality
They are intended to work within an array of rows to extract one value per row from the underlying query so they simplify queries as much as possible
nested queries
It is a query inside another query, and the result of the inner query is used by the outer query
Data analysis tools:
SQL: The standard programming language for performing programming used to communicate with relational databases, and it also has a major role in retrieving the required information.
Python: a versatile programming language, which is very popular in the field of technology and programming, and no data analyst can do without it. It relies on the principle of its work on readability, so it is not classified within complex programming languages. different analysis
R: Its tasks and features are not much different from Python, except that it is specialized in performing statistical analysis of data
Microsoft Excel: The most famous program in the world in the field of spreadsheets. It has many different features, ranging from scheduling, performing calculations, and typical graphing functions for data analysis.
Tableau: It is intended for creating visualizations and interactive dashboards without the need for high coding expertise, so it is the perfect tool for commercial data analysis
In conclusion
We put in your hands, dear reader, everything related to the SQL language
If you see that there is information that we did not mention regarding this programming language, share it with us in the comments to exchange information and benefit everyone, Thank you.
لتحليل البيانات SQL إضاءة شاملة على
هي لغة برمجة قوية SQL
مخصصة للبيانات الموجودة في قواعد البيانات العلائقية وهي لغة موجودة منذ عشرات السنين وتعتمد عليها الكثير من الشركات الكبرى في جميع أنحاء العالم إذ يستخدمها محللو البيانات للوصول إلى البيانات المحفوظة في قاعدة البيانات وقراءتها ومعالجتها وتحليلها لتكوين رؤية شاملة تساعد على اتخاذ القرارات الصحيحة
وسنتناول بالتفصيل آلية ومراحل العمل على هذه الأداة من حيث إمكانات استعلاماتها مع قواعد البيانات مع ذِكر أنوع تحليل البيانات
تحليل البيانات
تسعى جميع الشركات على مختلف أحجامها واختصاصاتها إلى الارتقاء والنمو لذا هدفها الأساسي في هذا النهج هو إرضاء العملاء وتقديم أفضل الخدمات لهم فبتوسع قاعدة العملاء تنمو الشركة وتزدهر وبالتالي تعمد معظم الشركات على فحص وتنقية وتحويل ونمذجة البيانات لاستخراج معلومات قيّمة تساعد في اتخاذ القرارات الحاسمة، هذه العملية تسمى تحليل البيانات
أنواع تحليل البيانات
ويتم هذا التصنيف حسب أنواع البيانات والاختصاصات المحددة لعملية التحليل
:التحليل الوصفي
هو التحليل الرئيسي الذي ترتكز عليه باقي أنواع التحليلات وهو أبسطها لذا فهو الأكثر استعمالاً للبيانات في كافة النشاطات التجارية في الوقت الراهن. يسمح هذا التحليل باستخلاص الاتجاهات بين البيانات الأولية وإعطاء نظرة عن الأحداث في وقتها وهنا تظهر الإجابة الأولية على “ماذا حدث” من خلال تلخيص البيانات السابقة وتتمثل عادة على شكل لوحة معلومات
:التحليل التشخيصي
وهو الخطوة التي تلي الخطوة السابقة مباشرة والتي تتمثل في التعمق أكثر في السؤال السابق “ماذا حدث” فتتجسد هذه الخطوة في طرح سؤال آخر وهو “لماذا حدث”؟ فالتحليل التشخيصي إذاً هو الذي يتمم عمل التحليل الوصفي من خلال أخذ القراءات الأولية الناتجة عن التحليل الوصفي والتعمق بها لتفسيرها وتحليلها بغية الوصول إلى المزيد من ترابطات بين البيانات فتبدأ تتشكل لنا معالم أنماط السلوك ومن الجوانب المستفادة أيضاً هو أنه في حال ظهور مشكلات أثناء العمل فحكماً أنت أصبح لديك البيانات الكافية المتعلقة بهذه المشكلة فيصبح الحل أسهل وبالتالي هذا يغنيك عن تضطر لإعادة العمل
:التحليلات التنبؤية
وهو متمم لعمل التحليلين السابقين، ومن اسمه يبدو أن يقوم بوضع احتمالات وتنبؤات حول الأحداث التي ستأتي فيما بعد بناءً على تنبؤات سابقة إلى جانب المتغيرات الراهنة وبالتالي يمثل هذا التحليل الإجابة عن السؤال الثالث وهو “ماذا يمكن أن يحدث في المستقبل”؟
يساعد هذا النوع من التحليل على اتخاذ قرارات أكثر دقة وفاعلية للشركات
:التحليل الإلزامي
وهو الحد النهائي لقدرات تحليل البيانات، حيث أنه لا يكتفي بالتوقّع أو التنبؤ بل يقوم باقتراح خيارات للاستفادة من النتائج التحليلات السابقة، وتحديد الخطوات التي يجب تنفيذها في حال حدوث مشكلة محتملة أو تشكيل خطة لتطوير العمل، يتم ذلك عن طريق استخدام تقنيات متطورة كخوارزميات التعليم الآلي وخصوصاً عند التعامل مع كميات ضخمة من البيانات
إذاً هذا التحليل هو الإجابة عن السؤال “ماذا يجب أن نفعل بعد ذلك”؟ والذي يحدد النهج العام لخطة عمل الشركة
عند استخدامه في تحليل البيانات؟ SQL ماهي ميزات
لغة سهلة وغير معقدة *
السرعة في معالجة الاستعلام *
القدرة على استدعاء البيانات الضخمة من قواعد البيانات مختلفة *
توفير وثائق متنوعة للمحللين *
في تحليل البيانات SQL شرح استخدام
الجداول المؤقتة
SQL تعرف الجداول المؤقتة في
على أنها الجداول التي يتم انشاؤها لتنفيذ مهمة مؤقتة ويستمر وجودها لمدة زمنية محددة أو خلال جلسة ما عن طريق تخزين النتائج الوسيطة ومعالجتها باستخدام نفس تقنيات الانضمام والتحديد والتحديث
التجميع حسب الشرط
على سبيل المثال تستخدم هذه العبارة لإحصاء عدد الموظفين في كل قسم أو الحصول على رواتب القسم بالمجمل، إذاً هي تستخدم لاستخراج بيانات التلخيص بناءً على مجموعات مختلفة سواء على عمود أو أكثر
وظائف التجميع
مهمتها تنفيذ عملية حسابية على مجموعة من القيم لاستخراج قيمة واحدة
وظائف وعمليات السلسلة
SQL مهمة عوامل تشغيل السلسلة في
هي تنفيذ المطابقة على النموذج والتسلسل وجعل السلسلة تبتدئ بحروف كبيرة وغيرها من وظائف المطابقة الأخرى
عمليات التاريخ والوقت
SQL من الخدمات التي يقدمها
أنواع عديدة من مهام التاريخ والوقت مثل
SYSUTCDATETIME ()
CURRENT_TIMESTAMP
GETDATE ()
DAY ()
MONTH ()
YEAR ()
DATEFROMPARTS ()
DATETIME2FROMPARTS ()
TIMEFROMPARTS ()
DATEDIFF ()
DATEADD ()
ISDATE ()
وغيرها وهي تستخدم لتنفيذ إدخالات التاريخ والوقت
طرق العرض والفهرسة
تعتبر قاعدة البيانات المستودع الرئيسي للفهرس لذا فعملية فهرسة العرض تساعد على تسريع العمل وتحسين أداء الاستعلامات والتطبيقات التي تستخدمها
:Joins
تستخدم هذه العبارة لدمج جداول مختلفة في قواعد البيانات ويتم ذلك باستخدام مفتاح أساسي ومفتاح خارجي
SQL في JOINS فيما يلي شرح الأنواع المختلفة من
ضمن مثال على بيانات في جدولين يميني ويساري
: (INNER) JOIN
إرجاع السجلات التي تحتوي على قيم متطابقة في كلا الجدولين
: LEFT (OUTER) JOIN
إرجاع كافة السجلات من الجدول الأيسر والسجلات المتطابقة من الجدول الأيمن
: RIGHT (OUTER) JOIN
إرجاع كافة السجلات من الجدول الأيمن والسجلات المتطابقة من الجدول الأيسر
: FULL (OUTER) JOIN
إرجاع كافة السجلات عند وجود تطابق في الجدول الأيمن أو الأيسر
وظائف النوافذ
مخصصة للعمل ضمن مجموعة من الصفوف لاستخراج قيمة واحدة لكل صف من الاستعلام الأساسي لذا فهي تبسط الاستعلامات قدر الإمكان
الاستعلامات المتداخلة
وهو استعلام داخل استعلام آخر ويتم استخدام نتيجة استعلام الداخلي بواسطة الاستعلام الخارجي
:أدوات تحليل البيانات
لغة البرمجة النموذجية : SQL
لإجراء البرمجة المستخدمة للتواصل مع قواعد البيانات العلائقية، كما ولها دور رئيسي في استرجاع الملومات المطلوبة
: بايثون
لغة برمجة متعددة الاستخدامات، تلقى رواجاً كبيراً في مجال التكنولوجيا والبرمجة ولا يمكن لأي محلل بيانات الاستغناء عنها، تعتمد في مبدأ عملها على قابلية القراءة لذا لا تصنف ضمن لغات البرمجة المعقدة، تضم عدد كبير من المكتبات المتنوعة وفق متطلبات المهمة المراد تنفيذها في عمليات التحليل المختلفة
: R لغة
لا تختلف مهامها وميزاتها كثيراً عن بايثون إلا أنها متخصصة في إجراء عمليات التحليل الإحصائي للبيانات
مايكروسوفت إكسل: البرامج الأشهر على مستوى العالم في مجال الجداول، يتمتع بميزات عديدة ومختلفة تتنوع بين الجدولة وتنفيذ العمليات الحسابية ووظائف الرسوم البيانية النموذجية لتحليل البيانات
: Tableau
وهو مخصص لإنشاء التصورات ولوحات المعلومات التفاعلية دون الحاجة إلى خبرة عالية في الترميز إذاً يعتبر الأداة الأمثل لتحليل البيانات التجارية
ختاماً
وضعنا بين يديك عزيزي القارئ
SQL كل ما يتعلق بلغة
فإن كنت ترى أن هناك معلومات لم نقم بذكرها فيما يتعلق بلغة البرمجة هذه شاركنا بها في التعليقات لنتبادل المعلومات ولتعم الاستفادة للجميع وشكراً