Create a new field in the original field (column) of the database.
Calculated fields are created at run time within a SELECT statement.
Stitching Fields
The Vendors table has field Vend_name, Vend_country, and now you need to create a combination field vend_name (Vend_country) for both, and name it Vend_title
mysql> SELECT Concat(Vend_name, ' (', Vend_country, ') ') as Vend_title
from vendors;
The Concat () function can be used to stitch fields.
The Trim () function strips the spaces on either side of the string, the RTrim () function strips the space to the right of the string, and the LTrim () function removes the space to the left of the string.
mysql> SELECT Concat(trim(vend_name), ' (', trim(vend_country), ') ')
from vendors;
Perform arithmetic calculations
The arithmetic operation supported by MySQL is +-*/
OrderItems contains prod_id, commodity quantity quantity, commodity unit price Item_price, summary Item Price
Mysql> SELECT prod_id, Quantity, Item_price, Quantity*item_price as Expanded_price
from OrderItems;
MySQL Create calculated fields