{"id":1083,"date":"2018-01-13T06:47:39","date_gmt":"2018-01-13T13:47:39","guid":{"rendered":"https:\/\/sqltutorial.org\/?page_id=1083"},"modified":"2025-01-25T01:59:58","modified_gmt":"2025-01-25T08:59:58","slug":"sql-math-functions","status":"publish","type":"page","link":"https:\/\/www.sqltutorial.org\/sql-math-functions\/","title":{"rendered":"SQL Math Functions"},"content":{"rendered":"\n<p>SQL has many mathematical functions that allow you to perform business and engineering calculations.<\/p>\n\n\n\n<p>Not all of the SQL math functions are used in typical day-to-day operations. However, there are several commonly used functions illustrated in the following table:<\/p>\n\n\n\n<p><input id=\"search\" class=\"light-table-filter\" type=\"text\" placeholder=\"Type to search...\" data-table=\"functions\"><\/p>\n\n\n\n<figure class=\"wp-block-table responsive functions\"><table><thead><tr><th><strong>Name<\/strong><\/th><th><strong>Description<\/strong><\/th><\/tr><\/thead><tbody><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-abs\/\" data-wpel-link=\"internal\">ABS<\/a><\/td><td>Returns the absolute value<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-acos\/\" data-wpel-link=\"internal\">ACOS<\/a><\/td><td>Returns the arc cosine&nbsp;of an argument<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-asin\/\" data-wpel-link=\"internal\">ASIN<\/a><\/td><td>Returns the arc sine of an argument<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-atan\/\" data-wpel-link=\"internal\">ATAN<\/a><\/td><td>Returns the arc tangent of an argument<\/td><\/tr><tr><td><a href=\"\/sql-math-functions\/sql-ceil\/\" data-wpel-link=\"internal\">CEIL<\/a>,<a href=\"\/sql-math-functions\/sql-ceil\/\" data-wpel-link=\"internal\">CEILING<\/a><\/td><td>Rounds up a float to the nearest integer value<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-cos\/\" data-wpel-link=\"internal\">COS<\/a><\/td><td>Returns the cosine of an argument<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-cot\/\" data-wpel-link=\"internal\">COT<\/a><\/td><td>Returns the cotangent of an argument<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-exp\/\" data-wpel-link=\"internal\">EXP<\/a><\/td><td>Returns the&nbsp; <code>e<\/code> constant (2.71828\u2026) that raises to a power of a specified number<\/td><\/tr><tr><td>LN<\/td><td>Returns the natural logarithm of the argument<\/td><\/tr><tr><td>LOG<\/td><td>Returns the natural logarithm of the first argument<\/td><\/tr><tr><td>LOG10<\/td><td>Returns the base-10 logarithm of the argument<\/td><\/tr><tr><td>LOG2<\/td><td>Returns the base-2 logarithm of the argument<\/td><\/tr><tr><td><a href=\"\/sql-math-functions\/sql-mod\/\" data-wpel-link=\"internal\">MOD<\/a><\/td><td>Returns the remainder (modulo) of a number divided by another<\/td><\/tr><tr><td>PI<\/td><td>Returns the value of pi which is&nbsp;3.14159265358979<\/td><\/tr><tr><td><a href=\"\/sql-math-functions\/sql-power\/\" data-wpel-link=\"internal\">POWER<\/a><\/td><td>Returns a number raised to a power of a specified number<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-rand\/\" data-wpel-link=\"internal\">RAND<\/a><\/td><td>Returns a random floating-point value<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-round\/\" data-wpel-link=\"internal\">ROUND<\/a><\/td><td>Rounds a number to a specific precision<\/td><\/tr><tr><td>SIGN<\/td><td>Returns the sign of an argument<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-sin\/\" data-wpel-link=\"internal\">SIN<\/a><\/td><td>Returns the sine of an argument<\/td><\/tr><tr><td><a href=\"\/sql-math-functions\/sql-sqrt\/\" data-wpel-link=\"internal\">SQRT<\/a><\/td><td>Returns the square root of an argument<\/td><\/tr><tr><td><a class=\"icon-more\" href=\"\/sql-math-functions\/sql-tan\/\" data-wpel-link=\"internal\">TAN<\/a><\/td><td>Returns the tangent of an argument<\/td><\/tr><tr><td><a href=\"\/sql-math-functions\/sql-truncate\/\">TRUNCATE<\/a><\/td><td>Truncates to a specified number of decimal places<\/td><\/tr><\/tbody><\/table><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>SQL has many mathematical functions that allow you to perform business and engineering calculations.<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":65,"comment_status":"closed","ping_status":"closed","template":"","meta":{"footnotes":""},"class_list":["post-1083","page","type-page","status-publish","hentry"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.2 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>SQL Math Functions<\/title>\n<meta name=\"description\" content=\"This tutorial provides you with commonly used SQL math functions that allow you to perform business and engineering calculations.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.sqltutorial.org\/sql-math-functions\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"SQL Math Functions\" \/>\n<meta property=\"og:description\" content=\"This tutorial provides you with commonly used SQL math functions that allow you to perform business and engineering calculations.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.sqltutorial.org\/sql-math-functions\/\" \/>\n<meta property=\"og:site_name\" content=\"SQL Tutorial\" \/>\n<meta property=\"article:modified_time\" content=\"2025-01-25T08:59:58+00:00\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-math-functions\/\",\"url\":\"https:\/\/www.sqltutorial.org\/sql-math-functions\/\",\"name\":\"SQL Math Functions\",\"isPartOf\":{\"@id\":\"https:\/\/www.sqltutorial.org\/#website\"},\"datePublished\":\"2018-01-13T13:47:39+00:00\",\"dateModified\":\"2025-01-25T08:59:58+00:00\",\"description\":\"This tutorial provides you with commonly used SQL math functions that allow you to perform business and engineering calculations.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.sqltutorial.org\/sql-math-functions\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.sqltutorial.org\/sql-math-functions\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.sqltutorial.org\/sql-math-functions\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.sqltutorial.org\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"SQL Math Functions\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.sqltutorial.org\/#website\",\"url\":\"https:\/\/www.sqltutorial.org\/\",\"name\":\"SQL Tutorial\",\"description\":\"An Interactive SQL Tutorial\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.sqltutorial.org\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"SQL Math Functions","description":"This tutorial provides you with commonly used SQL math functions that allow you to perform business and engineering calculations.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.sqltutorial.org\/sql-math-functions\/","og_locale":"en_US","og_type":"article","og_title":"SQL Math Functions","og_description":"This tutorial provides you with commonly used SQL math functions that allow you to perform business and engineering calculations.","og_url":"https:\/\/www.sqltutorial.org\/sql-math-functions\/","og_site_name":"SQL Tutorial","article_modified_time":"2025-01-25T08:59:58+00:00","twitter_card":"summary_large_image","schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/www.sqltutorial.org\/sql-math-functions\/","url":"https:\/\/www.sqltutorial.org\/sql-math-functions\/","name":"SQL Math Functions","isPartOf":{"@id":"https:\/\/www.sqltutorial.org\/#website"},"datePublished":"2018-01-13T13:47:39+00:00","dateModified":"2025-01-25T08:59:58+00:00","description":"This tutorial provides you with commonly used SQL math functions that allow you to perform business and engineering calculations.","breadcrumb":{"@id":"https:\/\/www.sqltutorial.org\/sql-math-functions\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.sqltutorial.org\/sql-math-functions\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/www.sqltutorial.org\/sql-math-functions\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.sqltutorial.org\/"},{"@type":"ListItem","position":2,"name":"SQL Math Functions"}]},{"@type":"WebSite","@id":"https:\/\/www.sqltutorial.org\/#website","url":"https:\/\/www.sqltutorial.org\/","name":"SQL Tutorial","description":"An Interactive SQL Tutorial","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.sqltutorial.org\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"}]}},"_links":{"self":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages\/1083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/comments?post=1083"}],"version-history":[{"count":0,"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/pages\/1083\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.sqltutorial.org\/wp-json\/wp\/v2\/media?parent=1083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}