CC SQL 10. creating calculated fields

  1. concatenating fields
    • SELECT Concat(vend_name, ' (', vend_country, ')')
    • FROM vendors
    • ORDER BY vend_name;
  2. using aliases
    • SELECT Concat(vend_name, ' (', vend_country, ')') AS
    • vend_title
    • FROM vendors
    • ORDER BY vend_name;
  3. performing mathamtical calculations
    • SELECT prod_id,
    • quantity,
    • item_price,
    • quantity*item_price AS expanded_price
    • FROM orderitems
    • WHERE order_num = 20005;


    • Operator Description
    • + Addition
    • - Subtraction
    • * Multiplication
    • / Division
Author
dau108
ID
146330
Card Set
CC SQL 10. creating calculated fields
Description
CC SQL 10. creating calculated fields
Updated