{"id":78169,"date":"2025-05-14T16:56:54","date_gmt":"2025-05-14T16:56:54","guid":{"rendered":"http:\/\/bangla.sitestree.com\/?p=78169"},"modified":"2025-05-14T16:56:54","modified_gmt":"2025-05-14T16:56:54","slug":"some-basic-sqls-in-oracle","status":"publish","type":"post","link":"http:\/\/bangla.sitestree.com\/?p=78169","title":{"rendered":"Some Basic SQLs in Oracle"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><strong>&#8212; Find Tables in a Schema<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&#8212; for SH schema<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SELECT owner, table_name<br>FROM all_tables<br>where OWNER = &#8216;SH&#8217;;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&#8212; for HR Schema<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SELECT owner, table_name<br>FROM all_tables<br>where OWNER = &#8216;HR&#8217;;<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&#8212; Create table based on another table<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">DROP TABLE MyCustomer;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&#8212; Create the structure but no data<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">create table MyCustomer AS<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Select Cust_ID, Cust_First_Name, Cust_Last_Name&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FROM sh.Customers<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">where ROWNUM &lt; 0;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SELECT *<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FROM MyCustomer;<\/p>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<p class=\"wp-block-paragraph\">DROP TABLE MyCustomer;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&#8212; Create both structure and bring data<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">create table MyCustomer AS<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Select Cust_ID, Cust_First_Name, Cust_Last_Name&nbsp;&nbsp;&nbsp;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FROM sh.Customers;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SELECT *<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FROM MyCustomer;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>BRING DATA FROM ANOTHER TABLE<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212; REMOVE ALL DATA FROM TABLE MyCustomer<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">TRUNCATE TABLE MyCustomer;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SELECT *<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FROM MyCustomer;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>&#8212; BRING DATA FROM ANOTHER TABLE<\/strong><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">INSERT INTO MyCustomer<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SELECT Cust_ID, Cust_First_Name, Cust_Last_Name<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FROM SH.CUSTOMERS<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FETCH FIRST 10 ROWS ONLY;<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">&#8212; SHOW INSERTED DATA<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">SELECT *<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">FROM MyCustomer;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>&#8212; Find Tables in a Schema &#8212; for SH schema SELECT owner, table_nameFROM all_tableswhere OWNER = &#8216;SH&#8217;; &#8212; for HR Schema SELECT owner, table_nameFROM all_tableswhere OWNER = &#8216;HR&#8217;; &#8212; Create table based on another table DROP TABLE MyCustomer; &#8212; Create the structure but no data create table MyCustomer AS Select Cust_ID, Cust_First_Name, Cust_Last_Name&nbsp;&nbsp;&nbsp; FROM sh.Customers &hellip; <\/p>\n<p><a class=\"more-link btn\" href=\"http:\/\/bangla.sitestree.com\/?p=78169\">Continue reading<\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_feature_clip_id":0,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[1],"tags":[],"class_list":["post-78169","post","type-post","status-publish","format-standard","hentry","category-root","item-wrap"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack-related-posts":[{"id":65664,"url":"http:\/\/bangla.sitestree.com\/?p=65664","url_meta":{"origin":78169,"position":0},"title":"XmlTextReader Overview #Misc .Net","author":"Author-Check- Article-or-Video","date":"July 10, 2021","format":false,"excerpt":"Brought from our old site: http:\/\/salearningschool.com\/displayArticle.php?table=Articles&articleID=626&title=XmlTextReader%20Overview Overview of .Net XmlReader and XmlWriter Object XmlReader Can read XML data both from file or stream. Readonly access. Also, provides information about the XML data. XmlTextReader class is derived from XmlReader. It provides faster access to XML data though it does not support\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69209,"url":"http:\/\/bangla.sitestree.com\/?p=69209","url_meta":{"origin":78169,"position":1},"title":"Steps in Data Warehouse Design and Implementation #44","author":"Author-Check- Article-or-Video","date":"August 14, 2021","format":false,"excerpt":"Most BI projects usually fail. It is not due to the errors in construction steps but due to the inappropriate design steps and methodologies. Waterfall method is not appropriate for BI. A method like developmental spiral may be more appropriate. Ref: [W. A. Giovinazzo ] Steps in developmental spiral: Definition,\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":67636,"url":"http:\/\/bangla.sitestree.com\/?p=67636","url_meta":{"origin":78169,"position":2},"title":"Steps in Data Warehouse Design and Implementation #Data Warehouse #Data Warehouse &#8211; 001 #Data Warehouse #Data Warehouse Misc","author":"Author-Check- Article-or-Video","date":"July 26, 2021","format":false,"excerpt":"\u00a0 Most BI projects usually fail. It is not due to the errors in the construction steps but due to the inappropriate design steps and methodologies. Waterfall method is not appropriate for BI. A method like developmental spiral may be more appropriate. Ref: [W. A. Giovinazzo ] Steps in developmental\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69233,"url":"http:\/\/bangla.sitestree.com\/?p=69233","url_meta":{"origin":78169,"position":3},"title":"Oracle Database Objects #40","author":"Author-Check- Article-or-Video","date":"August 15, 2021","format":false,"excerpt":"Oracle Database ObjectsSchema ObjectsClustersConstraintsDatabase linksDatabase triggersDimensionsExternal procedure librariesIndex-organized tablesIndexesIndextypesJava classes, Java resources, Java sourcesMaterialized viewsMaterialized view logsObject tablesObject typesObject viewsOperatorsPackagesSequencesStored functions, stored proceduresSynonymsTablesViewsNonschema Objects Contexts Directories Parameter files (PFILEs) and server parameter files (SPFILEs) Profiles Roles Rollback segments Tablespaces UsersWhat are schema objects? A collection of logical structures of data,\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":69382,"url":"http:\/\/bangla.sitestree.com\/?p=69382","url_meta":{"origin":78169,"position":4},"title":"XmlTextReader Overview #24","author":"Author-Check- Article-or-Video","date":"August 19, 2021","format":false,"excerpt":"Overview of .Net XmlReader and XmlWriter Object XmlReader Can read XML data both from file or stream. Readonly access. Also, provides information about the XML data. XmlTextReader class is derived from XmlReader. It provides faster access to XML data though it does not support validating DTD or XML schema. XmlValidatingReader\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":67442,"url":"http:\/\/bangla.sitestree.com\/?p=67442","url_meta":{"origin":78169,"position":5},"title":"Topics that You Need to Learn to Develop Service Oriented Architecture (SOA) based Enterprise Applications #Java Short Notes","author":"Author-Check- Article-or-Video","date":"July 22, 2021","format":false,"excerpt":"Topics that you need to learn to develop Service Oriented Architecture (SOA) based Enterprise Applications.[Knowing what to learn is the first step of learning.] Web Service Overview: SOA, Web-services, Web Service Standards, and Standard Managers XML Syntax: XML vs. HTML, W3C and the XML Specification, XML Syntax XML Namespaces: XML\u2026","rel":"","context":"In &quot;FromSitesTree.com&quot;","block_context":{"text":"FromSitesTree.com","link":"http:\/\/bangla.sitestree.com\/?cat=1917"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]}],"_links":{"self":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=78169"}],"version-history":[{"count":1,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78169\/revisions"}],"predecessor-version":[{"id":78170,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=\/wp\/v2\/posts\/78169\/revisions\/78170"}],"wp:attachment":[{"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=78169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=78169"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/bangla.sitestree.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=78169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}