Okay, great.
Here we'll apply what we learned in the previous lecture.
In an exercise in this simple line, we will create a test table with two columns, numbers and words.
We've written the code on one line with small letters.
Notice how my SQL changed the color of keywords?
Data types.
In numbers.
Now we will not be dealing with an ad hoc software as we are focusing on Workbench.
After having placed the cursor somewhere in this query.
You can press the little brush icon to reformat the script to do the same operation faster.
Remember the control and B shortcut.
Wow.
It worked.
Key words are in capital letters, and the data for each column of the table starts on a new line.
Great.
Imagine you have a further preference regarding the horizontal organization of this code and the alignment
of all data types.
Using the tab button from your keyboard, you can set int and var char to begin at the same horizontal
point.
According to some users, this trick further improves code's readability.
The technical term is called indentation.
We say the column names and their data types were indented to the right.
Amazing.
Another aspect of maintaining good coding style is using comments.
These are lines of text that workbench will not run as code.
They convey a message to someone who reads our code.
Technically in my SQL, you can start a comment by typing a forward slash and a star and close it reciprocally
with a star in a forward slash.
This approach is used mainly for large comments.
For one line comments.
You can use either two dashes or one or more hash signs.
In addition to differentiate them from Mir code, my SQL workbench marks all comments in grey.
Fantastic.
Finally, I would like to elaborate on the lightning symbol, which helps you execute your code.
Let's start from the fact that your code is separated into blocks as marked by the semicolon separator.
Okay.
So if you place your cursor on one block and then press the lightning icon or the control shift, enter
combination.
SCL will run the selected and all remaining queries.
That's why if I click on from an execute the code this way I will see the output from the Select Statement
and we'll drop the test table.
If you would like to run just the statement under the cursor, you must press the adjacent icon where
a lightning and a cursor are depicted.
The corresponding keyboard combination is control and enter.
I can promise you will not stop using this keyboard combination until the very end of the course, as
it allows you to see the output of a certain query quickly without having to run the entire SQL code.
Well, I hope you like these two lectures.
They were aimed at making you aware of the notion of clean coding and coding and good style.
We consider these tools essential for good professional coding, so we would be happy if you can since
you started building good coding style habits.
Great enough about theory and basics.
In our next video, we will show you how to load the employees database, which is rather big and will
serve us for the rest of the lectures in this course.
We will start our data manipulation lessons right after that.
Thank you for watching.