SQL Tutorial for Data Analysis 5: Arithmetic Operations

Veröffentlicht am: 06 September 2020
auf dem Kanal: Ram Kedem
1,537
9

In this SQL Tutorial we're going to learn how to use Arithmetic operations. Arithmetic operations are simply mathematical calculations such as subtraction, addition, or division.

Key Concepts to remember -
On numerical columns it is permitted to perform any mathematical calculation
It is not possible to perform any arithmetic operations on a string datatype
On dates - multiplication or division are not possible. Addition and subtraction adds or subtract days.
Any calculation on a NULL returns NULL.
Calculations do not change the actual data, they only change the way values of columns are displayed.
Different calculations set the column’s header to (No Column Name) We’ll address this issue in our next video

Course Examples -
https://ramkedem.com/en/sql-basics-ex...

ACDB Database -
https://ramkedem.com/en/acdb-sample-d...

Written SQL tutorials including exercises -
http://ramkedem.com/en/sql-server/

About Myself -
https://ramkedem.com/en/about/

My Linkedin Page -
  / ram-kedem-a5b4b33b  

My Facebook Page -
  / ramkedemfeed  

SQL Platform Differences (comparing MySQL & Oracle)

MySQL -
Arithmetic operations over strings - MySQL treats the string as 0. So for example: 'Hello' + 5 would yield 5, 'Hello'*5 would yield: 0
MySQL Arithmetic operations over dates - Every calculation on a date value converts the date into a number, and perform the calculation over the number. so for example: 2006-08-23 00:00:00.000000 + 1 would yield: 20060823000001.000000
Different calculations set the column’s header to the new calculation, so for example, the expression: join_date + 5, sets the column's header to join_date + 5

Oracle -
Different calculations set the column’s header to the new calculation, so for example, the expression: join_date + 5, sets the column's header to join_date + 5


Auf dieser Seite können Sie das Online-Video SQL Tutorial for Data Analysis 5: Arithmetic Operations mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Ram Kedem 06 September 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 1,537 Mal angesehen und es wurde von 9 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!