What are the SQL Order By Clause and Expression Statement Language Elements? (Part 4)

preview_player
Показать описание

=============================

▶ Check out the full blog post over at

=============================

If you are just now joining along with this series of videos, please note that you are going to learn about SQL programming basics.

If you would like to follow along with us, please review the RealPars video, “How to install MySQL and import a sample database”, on how to download and setup MySQL database on your computer.

In the previous videos, we learned about how important, working as an automation professional, relational database management systems are to a world of data that is constantly changing and evolving every second.

In this video, you will learn about some of the more advanced SQL statements and clause commands such as Order by.

Our sample database used in this series of videos was named realparsmodel.

You can find the download links for our sample database and its diagram here:

Realparsmodel database has several tables. These tables are outlined in the enhanced entity-relationship diagram.
This diagram shows the relationships between entities.

The data contained within the sample database consists of the following tables:
– Students: stores student’s data.
– Courses: stores a list of courses.
– Course lines: stores a list of course line categories.
– Orders: stores sales orders placed by customers.
– Order details: stores sales order line items for each sales order.
– Payments: stores payments made by students based on their accounts.
– Employees: stores all employee information and organization structure.
– Offices: stores sales office data.

Every programming language, such as SQL, should follow a unique set of rules called Syntax. One of these rules is that all of the SQL statements start with any of the keywords like SELECT, INSERT, UPDATE, DELETE, etc. and they end with a semicolon.

The most important point to be noted here is that SQL keywords are NOT case sensitive.

The four fundamental operations that apply to any database are:
– SELECT: for reading the data
– INSERT: for inserting new data
– UPDATE: for updating existing data
– DELETE: for removing data

The ORDER BY clause allows you to sort a result set by a single column or multiple columns and sort a result set by different columns in ascending or descending order.

Now using the select statement from Students table and ordering the results by last names and descending the query, would be written like this:
---------------------------------------------------------
SELECT Lastname, Firstname, City
ORDER BY Lastname DESC;
---------------------------------------------------------

The results display the last names in descending order.

=============================

Review the MySQL minimum hardware requirement web page here:

Download the MySQL Installer:

Download the sample database SQL file from here:

Download the sample database diagram file from here:

=============================

Missed our most recent videos? Watch them here:

=============================

How to Install MySQL and Import a Sample Database (Part 1)

What are SQL Programming Basics? (Part 2)

What are SQL Where and Like Statements Basics? (Part 3)

=============================

To stay up to date with our last videos and more lessons, make sure to subscribe to this YouTube channel:

=============================

=============================

#RealPars #SQL #MySQL
Рекомендации по теме
Комментарии
Автор

it's the best industry automation chain
please we need a classic control lessons
i loved the star-delta vidéos

سُنَّةُالْأَوَّلِين
Автор

Realpars proved it is totaly automation expert's thanks

derina.maleek
Автор

hi
please make a video series on FactoryTalk Transition Manager linking with SQL

SimplifyIt
Автор

I am currently seeking my associates degree in automation engineering. My program is focused on manufacturing sector industries. I am interested in the power generation. What would help me to focus my career path on to the power generation.

lukedearinger
Автор

Please RealPars
Is there any chance to teach us the root cause analysis ?

MM-vikh