{"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":74657,"url":"http:\/\/bangla.sitestree.com\/?p=74657","url_meta":{"origin":78169,"position":3},"title":"Python and MySQL Operations. Code Examples","author":"Sayed","date":"May 17, 2022","format":false,"excerpt":"#!\/usr\/bin\/env python# coding: utf-8# In[1]: import mysql.connector # In[2]: # create a database connection # In[3]: import mysql.connectormydb = mysql.connector.connect(\u00a0 host=\"localhost\",\u00a0 user=\"root\",\u00a0 password=\"\")print(mydb) # In[4]: import mysql.connectormydb = mysql.connector.connect(\u00a0 host=\"localhost\",\u00a0 user=\"root\",\u00a0 password=\"\")mycursor = mydb.cursor()mycursor.execute(\"drop DATABASE mydatabase\");mycursor.execute(\"CREATE DATABASE mydatabase\"); # In[5]: # check if database exists # In[6]: import mysql.connectormydb =\u2026","rel":"","context":"In &quot;Python&quot;","block_context":{"text":"Python","link":"http:\/\/bangla.sitestree.com\/?cat=1428"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":5965,"url":"http:\/\/bangla.sitestree.com\/?p=5965","url_meta":{"origin":78169,"position":4},"title":": SQL Views","author":"Author-Check- Article-or-Video","date":"January 30, 2015","format":false,"excerpt":"Title: SQL Views \u0985\u09a8\u09c1\u09ac\u09be\u09a6\u0995: \u09ab\u09df\u09b8\u09be\u09b2 \u09b0\u0995\u09bf (\u098f\u09ae.\u098f) Total words in the article: 478 SQL \u098f view \u09ac\u09b2\u09a4\u09c7 virtual table \u098f\u09b0 view \u0995\u09c7 \u09ac\u09cb\u099d\u09be\u09df, \u0985\u09b0\u09cd\u09a5\u09be\u09ce real table \u0995\u09c7 virtually \u09a6\u09c7\u0996\u09be\u09a8\u09cb \u09b9\u09df\u0964 \u0995\u09bf\u09ad\u09be\u09ac\u09c7 view create, update \u09ac\u09be delete \u0995\u09b0\u09be \u09b9\u09df \u09a4\u09be \u098f\u0987 \u0985\u09a7\u09cd\u09af\u09be\u09df\u09c7 \u0986\u09b2\u09cb\u099a\u09a8\u09be \u0995\u09b0\u09be \u09b9\u09ac\u09c7\u0964 SQL CREATE VIEW Statement SQL statement\u2026","rel":"","context":"In &quot;\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001&quot;","block_context":{"text":"\u098f\u09b8 \u0995\u09bf\u0989 \u098f\u09b2 - \u09e6\u09e6\u09e7 \u0964 SQL - 001","link":"http:\/\/bangla.sitestree.com\/?cat=155"},"img":{"alt_text":"","src":"","width":0,"height":0},"classes":[]},{"id":68483,"url":"http:\/\/bangla.sitestree.com\/?p=68483","url_meta":{"origin":78169,"position":5},"title":"Access 2007: How to #90","author":"Author-Check- Article-or-Video","date":"August 4, 2021","format":false,"excerpt":"Access 2007: How toHow to compact and repair database?File menu (Alt+F) -> Manage -> Compact and Repair Database. Why? To reduce file\/database size. Helpful - when you want to upload to a remote server. Compacting and Repairing databases many times can solve many database issues. Use the feature once in\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}]}}