{"id":13120,"date":"2019-12-14T17:53:32","date_gmt":"2019-12-14T17:53:32","guid":{"rendered":"https:\/\/ittutorial.org\/?p=13120"},"modified":"2019-12-14T17:57:25","modified_gmt":"2019-12-14T17:57:25","slug":"oracle-introduction-to-sql-tutorial-4","status":"publish","type":"post","link":"https:\/\/ittutorial.org\/oracle-introduction-to-sql-tutorial-4\/","title":{"rendered":"Oracle Introduction to SQL Tutorial \u2013 4"},"content":{"rendered":"<p>Hi everyone, we continue with the topic of functions. You can read the previous functions article here.<\/p>\n<p>&nbsp;<\/p>\n<h3>Raund Function<\/h3>\n<p>Used to round the numeric values that result from a SQL query to an upper or lower integer.<\/p>\n<pre><strong>Usage of: <\/strong>Select <span style=\"color: #ff0000\">round<\/span>(column_name, number of digits to exclude) from table name<\/pre>\n<pre>SELECT PROD_LIST_PRICE FROM SH.PRODUCTS;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13123\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_4-7.png\" alt=\"\" width=\"888\" height=\"657\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_4-7.png 888w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_4-7-300x222.png 300w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_4-7-768x568.png 768w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><\/p>\n<p>If you want to print on the screen by round function according to the upper or lower value.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13124\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_3-7.png\" alt=\"\" width=\"776\" height=\"594\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_3-7.png 776w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_3-7-300x230.png 300w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_3-7-768x588.png 768w\" sizes=\"auto, (max-width: 776px) 100vw, 776px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h3>Trunct Function<\/h3>\n<p>It is used to shorten the numerical values that result from the SQL query according to the desired decimal number.<\/p>\n<p><strong>Usage of: <\/strong>Select trunc (column_name,<span style=\"color: #008000\"> number of digits to subtract<span style=\"color: #000000\">) from table_name;<\/span><\/span><\/p>\n<p>SELECT PROD_LIST_PRICE FROM SH.PRODUCTS;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13123\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_4-7.png\" alt=\"\" width=\"888\" height=\"657\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_4-7.png 888w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_4-7-300x222.png 300w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_4-7-768x568.png 768w\" sizes=\"auto, (max-width: 888px) 100vw, 888px\" \/><\/p>\n<pre>SELECT TRUNC(PROD_LIST_PRICE,1) FROM SH.PRODUCTS ORDER BY PROD_LIST_PRICE ASC;<\/pre>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13126\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_5-6.png\" alt=\"\" width=\"841\" height=\"653\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_5-6.png 841w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_5-6-300x233.png 300w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_5-6-768x596.png 768w\" sizes=\"auto, (max-width: 841px) 100vw, 841px\" \/><\/p>\n<p>As shown in the picture, a digit was omitted after the comma.<\/p>\n<p>&nbsp;<\/p>\n<h3>Mod function<\/h3>\n<p>Used to represent the remainder of the numerical values from the integer part.<\/p>\n<p><strong>Usage of: <\/strong>Select Mod (column_name, <span style=\"color: #008000\">integer to divide<\/span>) from table_name;<\/p>\n<p>Let&#8217;s create a query by combining the functions we just saw.<\/p>\n<p>&nbsp;<\/p>\n<pre>SELECT PROD_LIST_PRICE FROM SH.PRODUCTS order by prod_list_price;<\/pre>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13127\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_6-4.png\" alt=\"\" width=\"902\" height=\"586\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_6-4.png 902w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_6-4-300x195.png 300w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_6-4-768x499.png 768w\" sizes=\"auto, (max-width: 902px) 100vw, 902px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>Let&#8217;s use multiple function,<\/p>\n<pre>select mod(round(prod_list_price,0),3) from sh.products order by prod_list_price;<\/pre>\n<p><span style=\"color: #008000\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-13128\" src=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_7-4.png\" alt=\"\" width=\"1016\" height=\"553\" srcset=\"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_7-4.png 1016w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_7-4-300x163.png 300w, https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/Screenshot_7-4-768x418.png 768w\" sizes=\"auto, (max-width: 1016px) 100vw, 1016px\" \/><\/span><\/p>\n<p>As shown in the picture, we first rounded with the round function, then we took the mode of the rounded number.<\/p>\n<p>&nbsp;<\/p>\n<p>See you in the next article..<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Hi everyone, we continue with the topic of functions. You can read the previous functions article here. &nbsp; Raund Function Used to round the numeric values that result from a SQL query to an upper or lower integer. Usage of: Select round(column_name, number of digits to exclude) from table name SELECT PROD_LIST_PRICE FROM SH.PRODUCTS; If &hellip;<\/p>\n","protected":false},"author":67,"featured_media":12330,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"_uf_show_specific_survey":0,"_uf_disable_surveys":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[3019],"tags":[4936,4929,4875,4883,4873,4869,4910,1340,4870,4895,4905,4935,4926,4915,4921,4919,4920,4918,4917,3192,4872,4916,4928,4876,4912,4881,4880,4890,4867,3062,4879,4891,4923,4924,4922,4925,4909,4911,4877,4896,4908,4882,4884,4897,4901,4900,4898,4902,4903,4899,4871,3015,3018,4868,4904,4906,4893,4930,4934,4914,4933,4885,4887,4913,3000,4931,4889,4927,4907,4888,4886,4892,4874,4878,4894,4932],"class_list":["post-13120","post","type-post","status-publish","format-standard","has-post-thumbnail","","category-oracle-sql","tag-case-insensetive","tag-create-view","tag-database-nedir","tag-insert-nedir","tag-kolay-sql","tag-mysql-sql","tag-or","tag-oracle-sql","tag-php-sql","tag-plsql","tag-right-outer-join","tag-selecting-multiple-colum","tag-sql-all-drop","tag-sql-all-statements","tag-sql-alter","tag-sql-alter-colum","tag-sql-alter-database","tag-sql-alter-statement","tag-sql-alter-table","tag-sql-and","tag-sql-baslangic-dersleri","tag-sql-creat-table","tag-sql-create-view","tag-sql-database","tag-sql-date-functions","tag-sql-dcl","tag-sql-ddl","tag-sql-delete","tag-sql-dersleri","tag-sql-distinct","tag-sql-dml","tag-sql-dml-nedir","tag-sql-drop-colum","tag-sql-drop-database","tag-sql-drop-statement","tag-sql-drop-table","tag-sql-filtering-data","tag-sql-functions","tag-sql-ifadeleri","tag-sql-ile-ne-yapilir","tag-sql-in-statement","tag-sql-insert","tag-sql-insert-nasil-yapilir","tag-sql-is-ilanlari","tag-sql-join-yapisi","tag-sql-kaynaklari","tag-sql-kullanmak","tag-sql-lef-join","tag-sql-left-outer-join","tag-sql-makaleleri","tag-sql-nasil-ogrenilir","tag-sql-nedir","tag-sql-ogrenme","tag-sql-ogrenmek","tag-sql-right-join","tag-sql-right-outer-join","tag-sql-select-islemi","tag-sql-set-auto-increment","tag-sql-sorting-results","tag-sql-subqueries","tag-sql-syntaxt-rule","tag-sql-tablo-olusturma","tag-sql-tablo-yapisi","tag-sql-to_char-function","tag-sql-tutorial","tag-sql-union-statement","tag-sql-update-islemi","tag-sql-view","tag-sql-where-statement","tag-sql-yapisi","tag-tablo-nedr","tag-tablodan-veri-cekmek","tag-temel-seviye-sql","tag-temel-seviyede-sql","tag-tsql","tag-union-table"],"aioseo_notices":[],"jetpack_featured_media_url":"https:\/\/ittutorial.org\/wp-content\/uploads\/2019\/11\/sql.png","jetpack_sharing_enabled":true,"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/13120","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/users\/67"}],"replies":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/comments?post=13120"}],"version-history":[{"count":3,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/13120\/revisions"}],"predecessor-version":[{"id":13344,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/posts\/13120\/revisions\/13344"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media\/12330"}],"wp:attachment":[{"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/media?parent=13120"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/categories?post=13120"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/ittutorial.org\/wp-json\/wp\/v2\/tags?post=13120"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}