<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-5965985333096197782</id><updated>2024-10-24T01:07:32.532-07:00</updated><title type='text'>Welcome to the World of SQL</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://rkreddy-sql.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://rkreddy-sql.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>rkreddy</name><uri>http://www.blogger.com/profile/00332810489717834751</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>5</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-5965985333096197782.post-7459078992949149695</id><published>2010-03-29T11:14:00.000-07:00</published><updated>2010-03-29T11:24:35.595-07:00</updated><title type='text'>Integrity Constraints</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp6018500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;Integrity constraints are used to ensure accuracy and consistency of data in a relational database. Data integrity is handled in a relational database through the concept of referential integrity. There are many types of integrity constraints that play a role in referential integrity (RI).&lt;/p&gt;&lt;div id=&quot;wbp6018600&quot; class=&quot;SECTION&quot;&gt;&lt;h3 class=&quot;SECT3-TITLE&quot; id=&quot;758-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;ul&gt;&lt;li&gt;Primary Key Constraints&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-weight: normal; font-size: small; &quot;&gt;&lt;h3 class=&quot;SECT3-TITLE&quot; id=&quot;783-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;Unique Constraints&lt;/h3&gt;&lt;/span&gt;&lt;/li&gt;&lt;li&gt;Foreign Key Constraints&lt;/li&gt;&lt;li&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-weight: normal; font-size: small; &quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;823-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NOT NULL&lt;/span&gt; Constraints&lt;/h3&gt;&lt;div&gt;&lt;h3 class=&quot;SECT3-TITLE&quot; id=&quot;758-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;SECT3-TITLE&quot; id=&quot;758-1&quot; style=&quot;text-align: justify;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;Primary Key Constraints&lt;/h3&gt;&lt;p id=&quot;wbp6018700&quot; class=&quot;first-para&quot; style=&quot;text-align: justify;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a id=&quot;760&quot; name=&quot;760&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;EMPHASIS&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;b&gt;Primary key&lt;/b&gt;&lt;/i&gt;&lt;/span&gt; is the term used to identify one or more columns in a table that make a row of data unique. Although the primary key typically consists of one column in a table, more than one column can comprise the primary key. For example, either the employee&#39;s Social Security number or an assigned employee identification number is the logical primary key for an employee table. The objective is for every record to have a unique primary key or value for the employee&#39;s identification number. Because there is probably no need to have more than one record for each employee in an employee table, the employee identification number makes a logical primary key. The primary key is assigned at table creation.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp6018800&quot; style=&quot;text-align: justify;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;761&quot; id=&quot;761&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a id=&quot;wbp6018800&quot; name=&quot;WBP601880041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The following example identifies the &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; column as the &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;PRIMARY KEY&lt;/span&gt; for the &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMPLOYEES&lt;/span&gt; table:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;761-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;CREATE TABLE EMPLOYEE_TBL&lt;/div&gt;&lt;a name=&quot;WBP6019000&quot; id=&quot;wbp6019000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;(EMP_ID        CHAR(9)        NOT NULL PRIMARY KEY,&lt;/div&gt;&lt;/a&gt;&lt;a id=&quot;wbp6019100&quot; name=&quot;wbp601910041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;EMP_NAME       VARCHAR2(40)   NOT NULL,&lt;/div&gt;&lt;/a&gt;&lt;a name=&quot;WBP601920041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; id=&quot;wbp6019200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;EMP_ST_ADDR    VARCHAR2(20)   NOT NULL,&lt;/div&gt;&lt;/a&gt;&lt;a id=&quot;wbp6019300&quot; name=&quot;wbp6019300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;EMP_CITY       VARCHAR2(15)   NOT NULL,&lt;/div&gt;&lt;/a&gt;&lt;a name=&quot;WBP6019400&quot; id=&quot;wbp6019400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;EMP_ST         CHAR(2)        NOT NULL,&lt;/div&gt;&lt;/a&gt;&lt;a id=&quot;wbp6019500&quot; name=&quot;wbp601950041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;EMP_ZIP        NUMBER(5)      NOT NULL,&lt;/div&gt;&lt;/a&gt;&lt;a name=&quot;WBP601960041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; id=&quot;wbp6019600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;EMP_PHONE      NUMBER(10)     NULL,&lt;/div&gt;&lt;/a&gt;&lt;a id=&quot;wbp6019700&quot; name=&quot;wbp601970041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;EMP_PAGER      NUMBER(10)     NULL);&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;&lt;/div&gt;&lt;/a&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;a id=&quot;wbp6019700&quot; name=&quot;wbp601970041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; white-space: normal; &quot;&gt;&lt;h3 class=&quot;SECT3-TITLE&quot; id=&quot;783-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;Unique Constraints&lt;/h3&gt;&lt;/span&gt;&lt;/a&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp6022000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a id=&quot;793&quot; name=&quot;793&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;A &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;unique column&lt;/span&gt;&lt;/b&gt; constraint&lt;/i&gt;&lt;/span&gt; in a table is similar to a primary key in that the value in that column for every row of data in the table must have a unique value. While a primary key constraint is placed on one column, you can place a unique constraint on another column even though it is not actually for use as the primary key.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp6022100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a id=&quot;794&quot; name=&quot;794&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp602210041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; id=&quot;wbp6022100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Study the following example:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;794-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;CREATE TABLE EMPLOYEE_TBL &lt;a id=&quot;wbp6022300&quot; name=&quot;wbp602230041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;(EMP_ID        CHAR(9)        NOT NULL     PRIMARY KEY, &lt;a id=&quot;wbp6022400&quot; name=&quot;WBP602240041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;EMP_NAME       VARCHAR2(40)   NOT NULL, &lt;a id=&quot;wbp6022500&quot; name=&quot;wbp602250041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;EMP_ST_ADDR    VARCHAR2(20)   NOT NULL, &lt;a name=&quot;wbp602260041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; id=&quot;wbp6022600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;EMP_CITY       VARCHAR2(15)   NOT NULL, &lt;a id=&quot;wbp6022700&quot; name=&quot;wbp6022700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;EMP_ST         CHAR(2)        NOT NULL, &lt;a id=&quot;wbp6022800&quot; name=&quot;wbp602280041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;EMP_ZIP        NUMBER(5)      NOT NULL, &lt;a id=&quot;wbp6022900&quot; name=&quot;WBP602290041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;EMP_PHONE      NUMBER(10)     NULL         UNIQUE, &lt;a name=&quot;wbp602300041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; id=&quot;wbp6023000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;EMP_PAGER      NUMBER(10)     NULL);&lt;/pre&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;794-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;&lt;br /&gt;&lt;/pre&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;794-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; white-space: normal; &quot;&gt;&lt;h3 id=&quot;804-1&quot; class=&quot;sect3-title&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;Foreign Key Constraints&lt;/h3&gt;&lt;p id=&quot;wbp6023300&quot; class=&quot;first-para&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;806&quot; id=&quot;806&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;A &lt;span class=&quot;EMPHASIS&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;b&gt;foreign key&lt;/b&gt;&lt;/i&gt;&lt;/span&gt; is a column in a child table that references a primary key in the parent table. A &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;foreign key constraint&lt;/i&gt;&lt;/span&gt; is the main mechanism used to enforce referential integrity between tables in a relational database. A column defined as a foreign key is used to reference a column defined as a primary key in another table.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp6023400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a id=&quot;807&quot; name=&quot;807&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp602340041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; id=&quot;wbp6023400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Study the creation of the foreign key in the following example:&lt;/p&gt;&lt;div id=&quot;N268&quot; class=&quot;WIDECONTENT&quot;&gt;&lt;pre id=&quot;807-1&quot; class=&quot;PROGRAMLISTING&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;CREATE TABLE EMPLOYEE_PAY_TBL &lt;a name=&quot;WBP602360041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; id=&quot;wbp6023600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;(EMP_ID           CHAR(9)        NOT NULL, &lt;a name=&quot;WBP602370041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; id=&quot;wbp6023700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;POSITION           VARCHAR2(15)   NOT NULL, &lt;a id=&quot;wbp6023800&quot; name=&quot;WBP602380041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;DATE_HIRE          DATE           NULL, &lt;a name=&quot;wbp6023900&quot; id=&quot;wbp6023900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;PAY_RATE           NUMBER(4,2)    NOT NULL, &lt;a id=&quot;wbp6024000&quot; name=&quot;WBP6024000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;DATE_LAST_RAISE    DATE           NULL, &lt;a name=&quot;wbp602410041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; id=&quot;wbp6024100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;CONSTRAINT EMP_ID_FK FOREIGN KEY (EMP_ID) REFERENCES EMPLOYEE_TBL (EMP_ID));&lt;/pre&gt;&lt;/div&gt;&lt;p id=&quot;wbp6024200&quot; class=&quot;PARA&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;815&quot; id=&quot;815&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;WBP602420041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; id=&quot;wbp6024200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; column in this example has been designated as the foreign key for the &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMPLOYEE_PAY_TBL&lt;/span&gt; table. This foreign key, as you can see, references the &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; co-lumn in the &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMPLOYEE_TBL&lt;/span&gt; table. This foreign key ensures that for every &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; in the &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMPLOYEE_PAY_TBL&lt;/span&gt;, there is a corresponding &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; in the &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMPLOYEE_TBL&lt;/span&gt;. This is called a &lt;span class=&quot;EMPHASIS&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;parent/child relationship&lt;/i&gt;&lt;/span&gt;. The parent table is the &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMPLOYEE_TBL&lt;/span&gt; table, and the child table is the&lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMPLOYEE_PAY_TBL&lt;/span&gt; table. Study Table  for a better understanding of the parent table/child table relationship.&lt;/p&gt;&lt;div class=&quot;figure&quot; id=&quot;wbp6024400&quot; style=&quot;margin-left: 0.25in; &quot;&gt;&lt;a name=&quot;816&quot; id=&quot;816&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;WBP6024400&quot; id=&quot;wbp6024400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;figuremediaobject&quot;&gt;&lt;a id=&quot;817&quot; name=&quot;817&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;WBP6024300&quot; id=&quot;wbp6024300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;img id=&quot;IMG_6$&quot; src=&quot;http://images.books24x7.com/bookimages/id_1412/f03-02-6_544_264_0.jpg&quot; width=&quot;544&quot; height=&quot;264&quot; alt=&quot;Click to collapse&quot; title=&quot;Click to collapse&quot; style=&quot;display: inline; &quot; /&gt;&lt;/span&gt; &lt;br /&gt;&lt;span class=&quot;figure-title&quot; id=&quot;817-1&quot; style=&quot;margin-left: 0em; margin-right: 8em; &quot;&gt;&lt;span class=&quot;figure-titlelabel&quot; style=&quot;font-weight: bold; &quot;&gt;Figure 3.2: &lt;/span&gt;  The parent/child table relationship.&lt;/span&gt;&lt;/div&gt;&lt;p id=&quot;wbp6024500&quot; class=&quot;PARA&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a id=&quot;818&quot; name=&quot;818&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp6024500&quot; id=&quot;wbp6024500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;In this figure, the &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; column in the child table references the &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; column in the parent table. In order for a value to be inserted for &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; in the child table, there must first exist a value for &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; in the parent table. Likewise, for a value to be removed for &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; in the parent table, all corresponding values for &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMP_ID&lt;/span&gt; must first be removed from the child table. This is how referential integrity works.&lt;/p&gt;&lt;p id=&quot;wbp6024600&quot; class=&quot;PARA&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a id=&quot;819&quot; name=&quot;819&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a id=&quot;wbp6024600&quot; name=&quot;wbp602460041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;A foreign key can be added to a table using the &lt;span class=&quot;FIXED&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;ALTER TABLE&lt;/span&gt; command, as shown in the following example:&lt;/p&gt;&lt;pre id=&quot;819-1&quot; class=&quot;PROGRAMLISTING&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;ALTER TABLE EMPLOYEE_PAY_TBL &lt;a id=&quot;wbp6024800&quot; name=&quot;wbp602480041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;ADD CONSTRAINT ID_FK FOREIGN KEY (EMP_ID) &lt;a name=&quot;wbp6024900&quot; id=&quot;wbp6024900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;REFERENCES EMPLOYEE_TBL (EMP_ID);&lt;/pre&gt;&lt;a name=&quot;823&quot; id=&quot;823&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a id=&quot;wbp6025000&quot; name=&quot;wbp602500041C54AA7-2C19-4B40-8462-E3EBCDA596B6&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;table cellpadding=&quot;0&quot; border=&quot;0&quot; cellspacing=&quot;0&quot; class=&quot;note&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-check&quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-title&quot; style=&quot;color: rgb(0, 0, 128); font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: small; &quot;&gt;&lt;br /&gt;&lt;/td&gt;&lt;td class=&quot;admon-body&quot; valign=&quot;top&quot;&gt;&lt;p id=&quot;823-1&quot; class=&quot;first-para&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;The options available with the &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;ALTER TABLE&lt;/span&gt; command differ among different implementations of SQL, particularly when dealing with constraints.In addition, the actual use and definitions of constraints also vary, but the concept of referential integrity should be the same with all relational databases.&lt;/p&gt;&lt;p id=&quot;823-1&quot; class=&quot;first-para&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;/p&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;823-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NOT NULL&lt;/span&gt; Constraints&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp6025200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a id=&quot;825&quot; name=&quot;825&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The keywords &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;NULL&lt;/b&gt;&lt;/span&gt;&lt;b&gt; and &lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;NOT NULL&lt;/b&gt;&lt;/span&gt; listed on the same line as each column and after the data type. &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NOT NULL&lt;/span&gt; is a constraint that you can place on a table&#39;s column. This constraint disallows the entrance of &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt;values into a column; in other words, data is required in a &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NOT NULL&lt;/span&gt; column for each row of data in the table. &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt; is generally the default for a column if &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NOT NULL&lt;/span&gt; is not specified, allowing &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt; values in a column.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/span&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/pre&gt;&lt;/div&gt;&lt;/span&gt;&lt;/li&gt;&lt;/ul&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-weight: normal; font-size: small; &quot;&gt;&lt;div&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;823-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;/h3&gt;&lt;/div&gt;&lt;/span&gt;&lt;/h3&gt;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkreddy-sql.blogspot.com/feeds/7459078992949149695/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rkreddy-sql.blogspot.com/2010/03/integrity-constraints.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default/7459078992949149695'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default/7459078992949149695'/><link rel='alternate' type='text/html' href='http://rkreddy-sql.blogspot.com/2010/03/integrity-constraints.html' title='Integrity Constraints'/><author><name>rkreddy</name><uri>http://www.blogger.com/profile/00332810489717834751</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5965985333096197782.post-7701093278222769755</id><published>2010-03-25T13:00:00.000-07:00</published><updated>2010-03-25T14:30:36.376-07:00</updated><title type='text'>What Are Database Objects?</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;i&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;A &lt;/span&gt;&lt;/i&gt;&lt;/b&gt;&lt;span class=&quot;emphasis&quot;&gt;&lt;i&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;database object&lt;/span&gt;&lt;/b&gt;&lt;/i&gt;&lt;/span&gt; is any defined object in a database that is used to store or reference data. Some examples of database objects include tables, views, clusters, sequences, indexes, and synonyms. &lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot; ;font-size:small;&quot;&gt;&lt;h2 class=&quot;first-section-title&quot; id=&quot;annotationlabel-first&quot; style=&quot;color: rgb(0, 0, 128); font-size: medium; font-weight: bold; background-color: rgb(255, 255, 255); &quot;&gt;What Is a Schema?&lt;/h2&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp6001400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;583&quot; id=&quot;583&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;A &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;b&gt;schema&lt;/b&gt;&lt;/i&gt;&lt;/span&gt; is a collection of database objects  associated with one particular database username. This username is called the &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;schema owner&lt;/i&gt;&lt;/span&gt;, or the owner of the related group of objects. You may have one or multiple schemas in a database. Basically, any user who creates an object has just created his or her own schema. A schema can consist of a single table and has no limits to the number of objects that it may contain, unless restricted by a specific database implementation.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp6001500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;584&quot; id=&quot;584&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600150058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6001500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Say you have been issued a database username and password by the database administrator. Your username is &lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;USER1&lt;/span&gt;. Suppose you log on to the database and then create a table called &lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;EMPLOYEE_TBL&lt;/span&gt;. Your table&#39;s actual name is&lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;USER1.EMPLOYEE_TBL&lt;/span&gt;. The schema name for that table is &lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;USER1&lt;/span&gt;, which is also the owner of that table. You have just created the first table of a schema.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp6001600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;585&quot; id=&quot;585&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600160058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6001600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The good thing about schemas is that when you access a table that you own (in your own schema), you do not have to refer to the schema name. For instance, you could refer to your table as either one of the following:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;585-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;EMPLOYEE_TBL &lt;a name=&quot;wbp600180058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6001800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;USER1.EMPLOYEE_TBL&lt;/pre&gt;&lt;p class=&quot;para&quot; id=&quot;wbp6001900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;588&quot; id=&quot;588&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600190058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6001900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The first option is preferred because it requires fewer keystrokes. If another user were to query one of your tables, the user would have to specify the schema, as follows:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;588-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;USER1.EMPLOYEE_TBL&lt;/pre&gt;&lt;p class=&quot;para&quot; id=&quot;wbp6002100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;590&quot; id=&quot;590&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;div class=&quot;figure&quot; id=&quot;wbp6002300&quot; style=&quot;margin-left: 0.25in; &quot;&gt;&lt;a name=&quot;591&quot; id=&quot;591&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600230058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;figuremediaobject&quot;&gt;&lt;a name=&quot;592&quot; id=&quot;592&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600220058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;img alt=&quot;Image from book&quot; id=&quot;IMG_5&quot; src=&quot;http://images.books24x7.com/bookimages/id_1412/f03-01-5_261_244.jpg&quot; height=&quot;135&quot; width=&quot;145&quot; title=&quot;Click To expand&quot; border=&quot;0&quot; /&gt;&lt;/span&gt;&lt;br /&gt;&lt;span class=&quot;figure-title&quot; id=&quot;592-1&quot; style=&quot;margin-left: 0em; margin-right: 8em; &quot;&gt; Schemas in a database.&lt;/span&gt;&lt;/div&gt;&lt;p class=&quot;para&quot; id=&quot;wbp6002400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;593&quot; id=&quot;593&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600240058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;There are, in Fig, two user accounts in the database that own tables: USER1 and USER2. Each user account has its own schema. Some examples for how the two users can access their own tables and tables owned by the other user follow:&lt;/p&gt;&lt;div class=&quot;informaltable&quot; id=&quot;N116&quot;&gt;&lt;table width=&quot;100%&quot; border=&quot;1&quot; style=&quot;font-family: Verdana, Arial, Helvetica, sans-serif; font-size: 11px; &quot;&gt;&lt;tbody&gt;&lt;tr valign=&quot;top&quot;&gt;&lt;td class=&quot;td&quot; width=&quot;35%&quot; align=&quot;left&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;594&quot; id=&quot;594&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600250058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;table-para&quot; id=&quot;wbp6002500&quot; style=&quot;margin-left: 0.3em; margin-right: 1em; &quot;&gt;USER1 accesses own &lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;table1:&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td class=&quot;td&quot; width=&quot;65%&quot; align=&quot;left&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;595&quot; id=&quot;595&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600250158962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002501&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;table-para&quot; id=&quot;wbp6002501&quot; style=&quot;margin-left: 0.3em; margin-right: 1em; &quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;TABLE1&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt;&lt;td class=&quot;td&quot; width=&quot;35%&quot; align=&quot;left&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;596&quot; id=&quot;596&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600260058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;table-para&quot; id=&quot;wbp6002600&quot; style=&quot;margin-left: 0.3em; margin-right: 1em; &quot;&gt;USER1 accesses own test:&lt;/p&gt;&lt;/td&gt;&lt;td class=&quot;td&quot; width=&quot;65%&quot; align=&quot;left&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;597&quot; id=&quot;597&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600260158962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002601&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;table-para&quot; id=&quot;wbp6002601&quot; style=&quot;margin-left: 0.3em; margin-right: 1em; &quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;TEST&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt;&lt;td class=&quot;td&quot; width=&quot;35%&quot; align=&quot;left&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;598&quot; id=&quot;598&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600270058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;table-para&quot; id=&quot;wbp6002700&quot; style=&quot;margin-left: 0.3em; margin-right: 1em; &quot;&gt;USER1 accesses USER2&#39;s &lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;table10:&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;td class=&quot;td&quot; width=&quot;65%&quot; align=&quot;left&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;599&quot; id=&quot;599&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600270158962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002701&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;table-para&quot; id=&quot;wbp6002701&quot; style=&quot;margin-left: 0.3em; margin-right: 1em; &quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;USER2.TABLE10&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;tr valign=&quot;top&quot;&gt;&lt;td class=&quot;td&quot; width=&quot;35%&quot; align=&quot;left&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;600&quot; id=&quot;600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600280058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;table-para&quot; id=&quot;wbp6002800&quot; style=&quot;margin-left: 0.3em; margin-right: 1em; &quot;&gt;USER1 accesses USER2&#39;s test:&lt;/p&gt;&lt;/td&gt;&lt;td class=&quot;td&quot; width=&quot;65%&quot; align=&quot;left&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;601&quot; id=&quot;601&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600280158962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002801&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;table-para&quot; id=&quot;wbp6002801&quot; style=&quot;margin-left: 0.3em; margin-right: 1em; &quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;USER2.TEST&lt;/span&gt;&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;p class=&quot;para&quot; id=&quot;wbp6002900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;602&quot; id=&quot;602&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp600290058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp6002900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Both users have a table called &lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;TEST&lt;/span&gt;. Tables can have the same names in a database as long as they belong to different schemas. If you look at it this way, table names are always unique in a database, because the schema owner is actually part of the table name. For instance, &lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;USER1.TEST&lt;/span&gt; is different than &lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;USER2.TEST&lt;/span&gt;. If you do not specify a schema with the table name when accessing tables in a database, the database server looks for a table that you own by default. That is, if USER1 tries to access &lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;TEST&lt;/span&gt;, the database server looks for a USER1-owned table named &lt;span class=&quot;fixed&quot;  style=&quot; ;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;TEST&lt;/span&gt; before it looks for other objects owned by USER1, such as synonyms to tables in another schema. &lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkreddy-sql.blogspot.com/feeds/7701093278222769755/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rkreddy-sql.blogspot.com/2010/03/what-are-database-objects.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default/7701093278222769755'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default/7701093278222769755'/><link rel='alternate' type='text/html' href='http://rkreddy-sql.blogspot.com/2010/03/what-are-database-objects.html' title='What Are Database Objects?'/><author><name>rkreddy</name><uri>http://www.blogger.com/profile/00332810489717834751</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5965985333096197782.post-2857328184820376444</id><published>2010-03-25T12:47:00.000-07:00</published><updated>2010-03-25T12:54:36.087-07:00</updated><title type='text'>What Is Data?</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;emphasis&quot;&gt;&lt;b&gt;Data&lt;/b&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;is a collection of information stored in a database as one of several different data types. Data includes names, numbers, dollar amounts, text, graphics, decimals, figures, calculations, summarization, and just about anything else you can possibly imagine. Data can be stored in uppercase, lowercase, or mixed case. Data can be manipulated or changed; most data does not remain static for its lifetime.&lt;/span&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;h2 class=&quot;first-section-title&quot; id=&quot;annotationlabel-first&quot; style=&quot;color: rgb(0, 0, 128); font-size: medium; font-weight: bold; background-color: rgb(255, 255, 255); &quot;&gt;Basic Data Types&lt;/h2&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5001300&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;397&quot; id=&quot;397&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500130058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5001300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The following sections discuss the basic data types supported by ANSI SQL. Data types are characteristics of the data itself, whose attributes are placed on fields within a table. For example, you can specify that a field must contain numeric values, disallowing the entering of alphanumeric strings. After all, you would not want to enter alphabetic characters in a field for a dollar amount.&lt;/p&gt;&lt;a name=&quot;398&quot; id=&quot;398&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500140058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5001400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;note&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-check&quot;&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-title&quot; style=&quot;color: rgb(0, 0, 128); font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: small; &quot;&gt;Note &lt;/td&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-body&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;398-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b class=&quot;bold&quot; style=&quot;font-weight: bold; &quot;&gt;&lt;span style=&quot;color:000080;&quot;&gt;&lt;/span&gt;&lt;/b&gt;Every implementation of SQL seems to have its own specific data types. The use of implementation-specific data types is necessary to support the philosophy of each implementation on how to handle the storage of data. However, the basics are the same among all implementations.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5001500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;399&quot; id=&quot;399&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500150058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5001500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The very basic data types, as with most other languages, are&lt;/p&gt;&lt;a name=&quot;400&quot; id=&quot;400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500160058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5001600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;ul class=&quot;itemizedlist&quot; style=&quot;list-style-type: square; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;li class=&quot;first-listitem&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;400-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;Character strings&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;a name=&quot;401&quot; id=&quot;401&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500170058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5001700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;first-para&quot; id=&quot;401-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;Numeric strings&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;a name=&quot;402&quot; id=&quot;402&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500180058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5001800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;first-para&quot; id=&quot;402-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;Date and time values&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5001900&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;402-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;403&quot; id=&quot;403&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500190058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5001900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Fixed-Length Characters&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5002000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;404&quot; id=&quot;404&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;Constant characters&lt;/i&gt;&lt;/span&gt;, those strings that always have the same length, are stored using a fixed-length data type. The following is the standard for an SQL fixed-length character:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;404-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;CHARACTER(&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;)&lt;/pre&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5002200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;406&quot; id=&quot;406&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500220058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5002200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;n&lt;/span&gt;&lt;/i&gt;&lt;/span&gt; represents a number identifying the allocated, or maximum length, of the particular field with this definition.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5002300&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;407&quot; id=&quot;407&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500230058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5002300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Some implementations of SQL use the &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;CHAR&lt;/span&gt; data type to store fixed-length data. Alphanumeric data can be stored in this data type. An example of a constant length data type would be for a state abbreviation because all state abbreviations are two characters.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5002400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;408&quot; id=&quot;408&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500240058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5002400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Spaces are normally used to fill extra spots when using a fixed-length data type; if a field&#39;s length was set to &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;10&lt;/span&gt; and data entered filled only five places, the remaining five spaces are recorded as spaces. The padding of spaces ensures that each value in a field is a fixed length.&lt;/p&gt;&lt;a name=&quot;409&quot; id=&quot;409&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500250058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5002500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;warning&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-check&quot;&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-title&quot; style=&quot;color: rgb(128, 0, 0); font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: small; &quot;&gt;Warning &lt;/td&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-body&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;409-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b class=&quot;bold&quot; style=&quot;font-weight: bold; &quot;&gt;&lt;span style=&quot;color:800000;&quot;&gt;&lt;/span&gt;&lt;/b&gt;Be careful not to use a fixed-length data type for fields that may contain varying-length values, such as an individual&#39;s name. If you use the fixed-length data type inappropriately, problems such as the waste of available space and the inability to make accurate comparisons between data will eventually be encountered.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5002600&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;409-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;410&quot; id=&quot;410&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500260058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5002600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Variable Characters&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5002700&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;411&quot; id=&quot;411&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;SQL supports the use of &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;varying-length strings&lt;/i&gt;&lt;/span&gt;,strings whose length is not constant for all data. The following is the standard for an SQL varying-length character:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;411-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;CHARACTER VARYING(&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;n&lt;/i&gt;&lt;/span&gt;)&lt;/pre&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5002900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;413&quot; id=&quot;413&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500290058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5002900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;n&lt;/span&gt;&lt;/i&gt;&lt;/span&gt; represents a number identifying the allocated, or maximum length, of the particular field with this definition.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5003000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;414&quot; id=&quot;414&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500300058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5003000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Common data types for variable-length character values are the &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;VARCHAR&lt;/span&gt; and &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;VARCHAR2&lt;/span&gt; data types. &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;VARCHAR&lt;/span&gt; is the ANSI standard, which Microsoft SQL Server uses; &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;VARCHAR2&lt;/span&gt; is used by Oracle and should be used in Oracle, because &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;VARCHAR&lt;/span&gt;&#39;s usage in the future may change. The data stored can be alphanumeric.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5003100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;415&quot; id=&quot;415&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500310058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5003100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Remember that fixed-length data types typically pad spaces to fill in allocated places not used by the field. The varying-length data type does not work this way. For instance, if the allocated length of a varying-length field is &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;10&lt;/span&gt;, and a string of five characters is entered, the total length of that particular value is only &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;5&lt;/span&gt;. Spaces are not used to fill unused places in a column.&lt;/p&gt;&lt;a name=&quot;416&quot; id=&quot;416&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500320058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5003200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;tip&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-check&quot;&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-title&quot; style=&quot;color: rgb(0, 0, 128); font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: small; &quot;&gt;Tip &lt;/td&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-body&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;416-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b class=&quot;bold&quot; style=&quot;font-weight: bold; &quot;&gt;&lt;span style=&quot;color:000080;&quot;&gt;&lt;/span&gt;&lt;/b&gt;Always use the varying-length data type for non-constant character strings to save database space.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5003300&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;416-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;417&quot; id=&quot;417&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500330058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5003300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Numeric Values&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5003400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;418&quot; id=&quot;418&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500340058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5003400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Numeric values are stored in fields that are defined as some type of number, typically referred to as &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NUMBER&lt;/span&gt;, &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;INTEGER&lt;/span&gt;, &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;REAL&lt;/span&gt;, &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;DECIMAL&lt;/span&gt;, and so on.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5003500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;419&quot; id=&quot;419&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500350058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5003500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The following are the standards for SQL numeric values:&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp5003600&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;419-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;BIT(&lt;/span&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;n&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5003700&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;421&quot; id=&quot;421&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500370058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5003700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;BIT VARYING(&lt;/span&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;n&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5003800&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;422&quot; id=&quot;422&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500380058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5003800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;DECIMAL(&lt;/span&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;p,s&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5003900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;423&quot; id=&quot;423&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500390058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5003900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;INTEGER&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5004000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;424&quot; id=&quot;424&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500400058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5004000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;SMALLINT&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5004100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;425&quot; id=&quot;425&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500410058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5004100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;FLOAT(p)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5004200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;426&quot; id=&quot;426&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500420058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5004200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;REAL(s)&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5004300&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;427&quot; id=&quot;427&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500430058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5004300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;DOUBLE PRECISION(P)&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5004400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;428&quot; id=&quot;428&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500440058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5004400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;p&lt;/span&gt;&lt;/i&gt;&lt;/span&gt; represents a number identifying the allocated, or maximum length, of the particular field for each appropriate definition.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5004500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;429&quot; id=&quot;429&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500450058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5004500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;s&lt;/span&gt;&lt;/i&gt;&lt;/span&gt; is a number to the right of the decimal point, such as 34.&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;ss.&lt;/i&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5004600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;430&quot; id=&quot;430&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500460058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5004600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;A common numeric data type in SQL implementations is &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NUMBER&lt;/span&gt;, which accommodates the direction for numeric values provided by ANSI. Numeric values can be stored as zero, positive, negative, fixed, and floating-point numbers. The following is an example using &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NUMBER&lt;/span&gt;:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;430-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;NUMBER(5)&lt;/pre&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5004800&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;432&quot; id=&quot;432&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500480058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5004800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;This example restricts the maximum value entered in a particular field to &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;99999&lt;/span&gt;.&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5004900&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;432-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;433&quot; id=&quot;433&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500490058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5004900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Decimal Values&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5005000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;434&quot; id=&quot;434&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500500058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5005000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Decimal values are numeric values that include the use of a decimal point. The standard for a decimal in SQL follows, where the &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;p&lt;/span&gt;&lt;/i&gt;&lt;/span&gt; is the precision and the &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;s&lt;/span&gt;&lt;/i&gt;&lt;/span&gt; is the decimal&#39;s scale:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;434-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;DECIMAL(&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;p,s&lt;/i&gt;&lt;/span&gt;)&lt;/pre&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5005200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;436&quot; id=&quot;436&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;precision&lt;/i&gt;&lt;/span&gt; is the total length of the numeric value. In a numeric defined &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;DECIMAL(4,2)&lt;/span&gt;, the precision is &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;4&lt;/span&gt;, which is the total length allocated for a numeric value.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5005300&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;437&quot; id=&quot;437&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;scale&lt;/i&gt;&lt;/span&gt; is the number of digits to the right of the decimal point. The scale is &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;2&lt;/span&gt; in the previous &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;DECIMAL(4,2)&lt;/span&gt; example.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5005400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;438&quot; id=&quot;438&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500540058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5005400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;34.33&lt;/span&gt; inserted into a &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;DECIMAL(3,1)&lt;/span&gt; is typically rounded to &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;34.3&lt;/span&gt;.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5005500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;439&quot; id=&quot;439&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500550058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5005500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;If a numeric value was defined as the following data type, the maximum value allowed would be &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;99.99&lt;/span&gt;:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;439-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;DECIMAL(4,2)&lt;/pre&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5005700&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;441&quot; id=&quot;441&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The precision is &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;4&lt;/span&gt;, which represents the total length allocated for an associated value. The scale is &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;2&lt;/span&gt;, which represents the number of &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;places&lt;/i&gt;&lt;/span&gt;, or &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;bytes&lt;/i&gt;&lt;/span&gt;, reserved to the right side of the decimal point. The decimal point itself does not count as a character.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5005800&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;442&quot; id=&quot;442&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500580058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5005800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Allowed values for a column defined as &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;DECIMAL(4,2)&lt;/span&gt; include the following:&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp5005900&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;442-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;12&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5006000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;444&quot; id=&quot;444&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500600058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5006000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;12.4&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5006100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;445&quot; id=&quot;445&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500610058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5006100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;12.44&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5006200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;446&quot; id=&quot;446&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500620058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5006200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;12.449&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5006300&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;447&quot; id=&quot;447&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500630058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5006300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The last numeric value, &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;12.449&lt;/span&gt;, is rounded off to &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;12.45&lt;/span&gt; upon input into the column.&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5006400&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;447-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;448&quot; id=&quot;448&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500640058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5006400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Integers&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5006500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;449&quot; id=&quot;449&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;b&gt;An &lt;/b&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;b&gt;integer&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;is a numeric value that does not contain a decimal, only whole numbers (both positive and negative).&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5006600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;450&quot; id=&quot;450&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500660058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5006600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Valid integers include the following:&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp5006700&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;450-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;1&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5006800&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;452&quot; id=&quot;452&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500680058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5006800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;0&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5006900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;453&quot; id=&quot;453&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500690058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5006900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;-1&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5007000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;454&quot; id=&quot;454&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500700058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5007000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;99&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5007100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;455&quot; id=&quot;455&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500710058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5007100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;-99&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5007200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;456&quot; id=&quot;456&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500720058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5007200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;199&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5007300&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;456-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;457&quot; id=&quot;457&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500730058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5007300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Floating-Point Decimals&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5007400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;458&quot; id=&quot;458&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;emphasis&quot;&gt;&lt;b&gt;Floating-point decimals&lt;/b&gt;&lt;/span&gt; are decimal values whose precision and scale are variable lengths and virtually without limit. Any precision and scale is acceptable. The &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;REAL&lt;/span&gt; data type designates a column with single-precision, floating-point numbers. The &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;DOUBLE PRECISION&lt;/span&gt; data type designates a column that contains double-precision, floating-point numbers. To be considered a single-precision floating point, the precision must be between 1 and 21 inclusive. To be considered a double-precision floating point, the precision must be between 22 and 53 inclusive. The following are examples of the &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;FLOAT&lt;/span&gt; data type:&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp5007500&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;458-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;FLOAT&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5007600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;460&quot; id=&quot;460&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500760058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5007600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;FLOAT(15)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5007700&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;461&quot; id=&quot;461&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500770058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5007700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;FLOAT(50)&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5007800&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;461-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;462&quot; id=&quot;462&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500780058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5007800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Dates and Time&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5007900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;463&quot; id=&quot;463&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500790058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5007900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Date and time data types are quite obviously used to keep track of information concerning dates and time. Standard SQL supports what are called &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;DATETIME&lt;/span&gt; data types, which include the following specific data types:&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp5008000&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;463-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;DATE&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5008100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;465&quot; id=&quot;465&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500810058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5008100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;TIME&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5008200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;466&quot; id=&quot;466&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500820058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5008200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;INTERVAL&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5008300&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;467&quot; id=&quot;467&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500830058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5008300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;TIMESTAMP&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5008400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;468&quot; id=&quot;468&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500840058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5008400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The elements of a &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;DATETIME&lt;/span&gt; data type consist of the following:&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp5008500&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;468-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;YEAR&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5008600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;470&quot; id=&quot;470&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500860058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5008600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;MONTH&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5008700&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;471&quot; id=&quot;471&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500870058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5008700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;DAY&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5008800&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;472&quot; id=&quot;472&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500880058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5008800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;HOUR&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5008900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;473&quot; id=&quot;473&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500890058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5008900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;MINUTE&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5009000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;a name=&quot;474&quot; id=&quot;474&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500900058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5009000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&lt;b&gt;SECOND&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;a name=&quot;475&quot; id=&quot;475&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500910058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5009100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;table border=&quot;0&quot; cellspacing=&quot;0&quot; cellpadding=&quot;0&quot; class=&quot;note&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;tbody&gt;&lt;tr&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-check&quot;&gt;&lt;/td&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-title&quot; style=&quot;color: rgb(0, 0, 128); font-family: Arial, Helvetica, sans-serif; font-weight: bold; font-size: small; &quot;&gt;Note &lt;/td&gt;&lt;td valign=&quot;top&quot; class=&quot;admon-body&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;475-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b class=&quot;bold&quot; style=&quot;font-weight: bold; &quot;&gt;&lt;span style=&quot;color:000080;&quot;&gt;&lt;/span&gt;&lt;/b&gt;The &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;SECOND&lt;/span&gt; element can also be broken down to fractions of a second. The range is from &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;00.000&lt;/span&gt; to &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;61.999&lt;/span&gt;, although some implementations of SQL may not support this range.&lt;/p&gt;&lt;/td&gt;&lt;/tr&gt;&lt;/tbody&gt;&lt;/table&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5009200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;476&quot; id=&quot;476&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500920058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5009200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Be aware that each implementation of SQL may have its own customized data type for dates and times. The previous data types and elements are standards to which each SQL vendor should adhere, but be advised that most implementations have their own data type for date values, varying in both appearance and the way date information is actually stored internally.&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5009300&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;477&quot; id=&quot;477&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500930058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5009300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;A length is not normally specified for a date data type. Later in this hour, you learn more about dates, how date information is stored in some implementations, how to manipulate dates and times using conversion functions, and study practical examples of how dates and time are used in the real world.&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5009400&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;477-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;478&quot; id=&quot;478&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500940058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5009400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Literal Strings&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5009500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;479&quot; id=&quot;479&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;A &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;b&gt;literal string&lt;/b&gt;&lt;/i&gt;&lt;/span&gt;&lt;b&gt; &lt;/b&gt;is a series of characters, such as a name or a phone number, that is explicitly specified by a user or program. Literal strings consist of data with the same attributes as the previously discussed data types, but the value of the string is known; the value of a column itself is usually unknown, because there is typically a different value for a column associated with each row of data in a table.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5009600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;480&quot; id=&quot;480&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500960058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5009600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;You do not actually specify data types with literal strings—you simply specify the string. Some examples of literal strings follow:&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp5009700&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;480-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&#39;Hello&#39;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5009800&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;482&quot; id=&quot;482&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500980058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5009800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;45000&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5009900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;483&quot; id=&quot;483&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp500990058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5009900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&quot;45000&quot;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5010000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;484&quot; id=&quot;484&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501000058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5010000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;3.14&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5010100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;485&quot; id=&quot;485&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501010058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5010100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&#39;November 1, 1997&#39;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5010200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;486&quot; id=&quot;486&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501020058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5010200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The alphanumeric strings are enclosed by single quotation marks, whereas the number value &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;45000&lt;/span&gt; is not. Also notice that the second numeric value of &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;45000&lt;/span&gt; is enclosed by quotation marks. Generally speaking, character strings require quotation marks, whereas numeric strings don&#39;t. You see later how literal strings are used with database queries.&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5010300&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;486-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;487&quot; id=&quot;487&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501030058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5010300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt; Data Types&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5010400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;488&quot; id=&quot;488&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt; a &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt; value isa missing value or a column in a row of data that has not been assigned a value. &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt; values are used in nearly all parts of SQL, including the creation of tables, search conditions for queries, and even in literal strings.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5010500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;489&quot; id=&quot;489&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501050058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5010500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The following are two methods for referencing a &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt; value:&lt;/p&gt;&lt;a name=&quot;490&quot; id=&quot;490&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501060058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5010600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;ul class=&quot;itemizedlist&quot; style=&quot;list-style-type: square; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;li class=&quot;first-listitem&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;490-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt; (the keyword &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt; itself)&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;a name=&quot;491&quot; id=&quot;491&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501070058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5010700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p class=&quot;first-para&quot; id=&quot;491-1&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;&#39;&#39; &lt;/span&gt;(single quotation marks with nothing in between)&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5010800&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;492&quot; id=&quot;492&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501080058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5010800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The following does not represent a &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt; value, but a literal string containing the characters &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;N&lt;/span&gt;-&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;U&lt;/span&gt;-&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;L&lt;/span&gt;-&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;L&lt;/span&gt;:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;492-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;&#39;NULL&#39;&lt;/pre&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5011000&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;492-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;494&quot; id=&quot;494&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501100058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5011000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;BOOLEAN&lt;/span&gt; Values&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5011100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;495&quot; id=&quot;495&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501110058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5011100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;A &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;BOOLEAN&lt;/span&gt; value is a value of either &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;TRUE&lt;/span&gt;, &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;FALSE&lt;/span&gt;, or &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt;. &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;BOOLEAN&lt;/span&gt; values are used to make data comparisons. For example, when criteria are specified for a query, each condition evaluates to either a &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;TRUE&lt;/span&gt;, &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;FALSE&lt;/span&gt;, or &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt;. If the&lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;BOOLEAN&lt;/span&gt; value of &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;TRUE&lt;/span&gt; is returned by all conditions in a query, data is returned. If a &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;BOOLEAN&lt;/span&gt; value of &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;FALSE&lt;/span&gt; or &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NULL&lt;/span&gt; is returned, data may not be returned.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5011200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;496&quot; id=&quot;496&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501120058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5011200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Consider the following example:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;496-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;WHERE NAME = &#39;SMITH&#39;&lt;/pre&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5011400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;498&quot; id=&quot;498&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501140058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5011400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;This line might be a condition found in a query. The condition is evaluated for every row of data in the table that is being queried. If the value of &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;NAME&lt;/span&gt; is &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;SMITH&lt;/span&gt; for a row of data in the table, the condition returns the value &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;TRUE&lt;/span&gt;, thereby returning the data associated with that record.&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5011500&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;498-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;499&quot; id=&quot;499&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501150058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5011500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;User-Defined Types&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5011600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;500&quot; id=&quot;500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;A&lt;b&gt; &lt;/b&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;b&gt;user-defined type&lt;/b&gt;&lt;/i&gt;&lt;/span&gt; is a data type that is defined by the user. User-defined types allow users to customize their own data types based on existing data types. The &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;CREATE TYPE&lt;/span&gt; statement is used to create a user-defined type.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5011700&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;501&quot; id=&quot;501&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501170058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5011700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;For example, you can create a type as follows:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;501-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;CREATE TYPE PERSON AS OBJECT &lt;a name=&quot;wbp501190058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5011900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;(NAME       VARCHAR2(30), &lt;a name=&quot;wbp501200058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5012000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt; SSN    VARCHAR2(9));&lt;/pre&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5012100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;505&quot; id=&quot;505&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501210058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5012100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;You can reference your user-defined type as follows:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;505-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;CREATE TABLE EMP_PAY &lt;a name=&quot;wbp501230058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5012300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;(EMPLOYEE   PERSON, &lt;a name=&quot;wbp501240058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5012400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt; SALARY     NUMBER(10,2), &lt;a name=&quot;wbp501250058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5012500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt; HIRE_DATE      DATE);&lt;/pre&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp5012600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;510&quot; id=&quot;510&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501260058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5012600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Notice that the data type referenced for the first column &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;EMPLOYEE&lt;/span&gt; is &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;PERSON&lt;/span&gt;. &lt;span class=&quot;fixed&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; &quot;&gt;PERSON&lt;/span&gt; is the user-defined type you created in the first example.&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp5012700&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;510-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;511&quot; id=&quot;511&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501270058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5012700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Domains&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp5012800&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;512&quot; id=&quot;512&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;b&gt;A &lt;/b&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;b&gt;domain&lt;/b&gt;&lt;/i&gt;&lt;/span&gt; is a set of valid data types that can be used. A domain is associated with a data type, so that only certain data is accepted. After a domain is created, you can add constraints to the domain. The domain is used like the user-defined type.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5012900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;513&quot; id=&quot;513&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501290058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5012900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;You can create a domain as follows:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;513-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;CREATE DOMAIN MONEY_D AS NUMBER(8,2);&lt;/pre&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5013100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;515&quot; id=&quot;515&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501310058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5013100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;You can add constraints to your domain as follows:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;515-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;ALTER DOMAIN MONEY_D  &lt;a name=&quot;wbp501330058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5013300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;ADD CONSTRAINT MONEY_CON1  &lt;a name=&quot;wbp501340058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5013400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;CHECK (VALUE &gt; 5);&lt;/pre&gt;&lt;p class=&quot;para&quot; id=&quot;wbp5013500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;519&quot; id=&quot;519&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501350058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5013500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;You can reference the domain as follows:&lt;/p&gt;&lt;pre class=&quot;programlisting&quot; id=&quot;519-1&quot; style=&quot;font-family: &#39;Courier New&#39;, Courier, mono; font-size: small; margin-left: 0px; &quot;&gt;CREATE TABLE EMP_PAY &lt;a name=&quot;wbp501370058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5013700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;(EMP_ID        NUMBER(9), &lt;a name=&quot;wbp501380058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5013800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt; EMP_NAME      VARCHAR2(30), &lt;a name=&quot;wbp501390058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5013900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt; PAY_RATE      MONEY_D);&lt;/pre&gt;&lt;div&gt;&lt;br /&gt;&lt;/div&gt;&lt;a name=&quot;524&quot; id=&quot;524&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp501400058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp5014000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/div&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkreddy-sql.blogspot.com/feeds/2857328184820376444/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rkreddy-sql.blogspot.com/2010/03/what-is-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default/2857328184820376444'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default/2857328184820376444'/><link rel='alternate' type='text/html' href='http://rkreddy-sql.blogspot.com/2010/03/what-is-data.html' title='What Is Data?'/><author><name>rkreddy</name><uri>http://www.blogger.com/profile/00332810489717834751</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5965985333096197782.post-1370807421952245143</id><published>2010-03-25T12:40:00.000-07:00</published><updated>2010-03-25T12:46:25.727-07:00</updated><title type='text'>Types of SQL Commands</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3006300&quot; style=&quot;text-align: justify;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;The basic categories of commands used in SQL to perform various functions. These functions include building database objects, manipulating objects, populating database tables with data, updating existing data in tables, deleting data, performing database queries, controlling database access, and overall database administration.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3006400&quot; style=&quot;text-align: justify;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;166&quot; id=&quot;166&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300640058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3006400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;b&gt;The main categories are&lt;/b&gt;&lt;/p&gt;&lt;a name=&quot;167&quot; id=&quot;167&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300650058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3006500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;ul class=&quot;itemizedlist&quot; style=&quot;list-style-type: square; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;li class=&quot;first-listitem&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;167-1&quot;   style=&quot;text-align: justify;  font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;DDL (Data Definition Language)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;&lt;a name=&quot;168&quot; id=&quot;168&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300660058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3006600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;p class=&quot;first-para&quot; id=&quot;168-1&quot;   style=&quot;text-align: justify;  font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;DML(Data Manipulation Language)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;&lt;a name=&quot;169&quot; id=&quot;169&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300670058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3006700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;p class=&quot;first-para&quot; id=&quot;169-1&quot;   style=&quot;text-align: justify;  font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;DQL (Data Query Language)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;&lt;a name=&quot;170&quot; id=&quot;170&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300680058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3006800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;p class=&quot;first-para&quot; id=&quot;170-1&quot;   style=&quot;text-align: justify;  font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;DCL (Data Control Language)&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;&lt;a name=&quot;171&quot; id=&quot;171&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300690058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3006900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;p class=&quot;first-para&quot; id=&quot;171-1&quot;   style=&quot;text-align: justify;  font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;Data administration commands&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;&lt;a name=&quot;172&quot; id=&quot;172&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300700058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3007000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;p class=&quot;first-para&quot; id=&quot;172-1&quot;   style=&quot;text-align: justify;  font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;Transactional control commands&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;p class=&quot;first-para&quot; id=&quot;172-1&quot;   style=&quot;  ;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-weight: normal; &quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;div class=&quot;section&quot; id=&quot;wbp3007100&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;172-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;172-2&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;Defining Database Structures (DDL)&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3007200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;174&quot; id=&quot;174&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;Data Definition Language&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;, DDL&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;, is the part of SQL that allows a database user to create and restructure database objects, such as the creation or the deletion of a table.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3007300&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;175&quot; id=&quot;175&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300730058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3007300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The main DDL commands discussed during following hours include the following:&lt;/span&gt;&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp3007400&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;175-1&quot;   style=&quot;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;CREATE TABLE&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3007500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;177&quot; id=&quot;177&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300750058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3007500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;ALTER TABLE&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3007600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;178&quot; id=&quot;178&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300760058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3007600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;DROP TABLE&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3007700&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;179&quot; id=&quot;179&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300770058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3007700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;CREATE INDEX&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3007800&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;180&quot; id=&quot;180&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300780058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3007800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;ALTER INDEX&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp3007900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;181&quot; id=&quot;181&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300790058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3007900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;DROP INDEX&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp3008000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp3008100&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;182-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;183&quot; id=&quot;183&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300810058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3008100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Manipulating Data (DML)&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3008200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;184&quot; id=&quot;184&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-style: normal;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;Data Manipulation Language&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;, DML&lt;/span&gt;&lt;/i&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;, is the part of SQL used to manipulate data within objects of a relational database.&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3008300&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;185&quot; id=&quot;185&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300830058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3008300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;There are three basic DML commands:&lt;/span&gt;&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp3008400&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;185-1&quot;   style=&quot;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;INSERT&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3008500&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;187&quot; id=&quot;187&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300850058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3008500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;UPDATE&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp3008600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;188&quot; id=&quot;188&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300860058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3008600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;DELETE&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp3008700&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp3008800&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;189-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;190&quot; id=&quot;190&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300880058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3008800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Selecting Data (DQL)&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3008900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;191&quot; id=&quot;191&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;Data Query Language (DQL) is the most concentrated focus of SQL for a relational database user. The command is as follows:&lt;/span&gt;&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp3009000&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;191-1&quot;   style=&quot;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;SELECT&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3009100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp3009200&quot;   style=&quot;  ;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-weight: normal; &quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;div class=&quot;section&quot; id=&quot;wbp3009300&quot; style=&quot;display: inline !important; &quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;194-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; display: inline !important; &quot;&gt;&lt;br /&gt;&lt;/h3&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp3009200&quot;   style=&quot;  ;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: rgb(0, 0, 0); font-weight: normal; &quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;div class=&quot;section&quot; id=&quot;wbp3009300&quot; style=&quot;display: inline !important; &quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;194-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; display: inline !important; &quot;&gt;Data Control Language (DCL)&lt;/h3&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;a name=&quot;194&quot; id=&quot;194&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;p&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp3009300&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3009400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;196&quot; id=&quot;196&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300940058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3009400&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;Data control commands&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt; in SQL allow you to control access to data within the database. These DCL commands are normally used to create objects related to user access and also control the distribution of privileges among users. Some data control commands are as follows:&lt;/span&gt;&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp3009500&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;196-1&quot;   style=&quot;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;ALTER PASSWORD&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3009600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;198&quot; id=&quot;198&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300960058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3009600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;GRANT&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3009700&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;199&quot; id=&quot;199&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300970058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3009700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;REVOKE&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp3009800&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;200&quot; id=&quot;200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300980058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3009800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;CREATE SYNONYM&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp3009900&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;201&quot; id=&quot;201&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp3010000&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;201-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;202&quot; id=&quot;202&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp301000058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3010000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Data Administration Commands&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3010100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;203&quot; id=&quot;203&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp301010058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3010100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;Data administration commands&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt; allow the user to perform audits and perform analyses on operations within the database. They can also be used to help analyze system performance. Two general data administration commands are as follows:&lt;/span&gt;&lt;/p&gt;&lt;blockquote class=&quot;blockquote&quot; id=&quot;wbp3010200&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;203-1&quot;   style=&quot;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;START AUDIT&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp3010300&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;205&quot; id=&quot;205&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp301030058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3010300&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;STOP AUDIT&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;p class=&quot;last-para&quot; id=&quot;wbp3010400&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;206&quot; id=&quot;206&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#FFFFFF;&quot;&gt;&lt;b&gt;&lt;br /&gt;&lt;/b&gt;&lt;/span&gt;&lt;/p&gt;&lt;/div&gt;&lt;div class=&quot;section&quot; id=&quot;wbp3010500&quot;&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;206-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;&lt;a name=&quot;207&quot; id=&quot;207&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp301050058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3010500&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;Transactional Control Commands&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3010600&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;208&quot; id=&quot;208&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp301060058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3010600&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;In addition to the previously introduced categories of commands, there are commands that allow the user to manage database transactions.&lt;/span&gt;&lt;/p&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;209&quot; id=&quot;209&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp301070058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3010700&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;ul class=&quot;itemizedlist&quot; style=&quot;list-style-type: square; list-style-position: initial; list-style-image: initial; &quot;&gt;&lt;li class=&quot;first-listitem&quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;209-1&quot;   style=&quot;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;COMMIT&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;Used to save database transactions&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;210&quot; id=&quot;210&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp301080058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3010800&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;p class=&quot;first-para&quot; id=&quot;210-1&quot;   style=&quot;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;ROLLBACK&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;Used to undo database transactions&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;211&quot; id=&quot;211&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp301090058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3010900&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;p class=&quot;first-para&quot; id=&quot;211-1&quot;   style=&quot;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;SAVEPOINT&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt; &lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;Creates points within groups of transactions in which to &lt;/span&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;ROLLBACK&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;li class=&quot;listitem&quot;&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;&lt;a name=&quot;212&quot; id=&quot;212&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp301100058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3011000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;/span&gt;&lt;p class=&quot;first-para&quot; id=&quot;212-1&quot;   style=&quot;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;span class=&quot;fixed&quot;  style=&quot;font-family:&#39;Courier New&#39;, Courier, mono;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt;SET TRANSACTION&lt;/span&gt;&lt;/b&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#000000;&quot;&gt; Places a name on a transaction&lt;/span&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/div&gt;&lt;/span&gt;&lt;/b&gt;&lt;p&gt;&lt;/p&gt;&lt;p class=&quot;first-para&quot; id=&quot;172-1&quot;   style=&quot;  ;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#990000;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/b&gt;&lt;/p&gt;&lt;/li&gt;&lt;/ul&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkreddy-sql.blogspot.com/feeds/1370807421952245143/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rkreddy-sql.blogspot.com/2010/03/types-of-sql-commands.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default/1370807421952245143'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default/1370807421952245143'/><link rel='alternate' type='text/html' href='http://rkreddy-sql.blogspot.com/2010/03/types-of-sql-commands.html' title='Types of SQL Commands'/><author><name>rkreddy</name><uri>http://www.blogger.com/profile/00332810489717834751</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-5965985333096197782.post-7228076953892818673</id><published>2010-03-25T12:31:00.000-07:00</published><updated>2010-03-25T12:38:18.188-07:00</updated><title type='text'>What Is SQL?</title><content type='html'>&lt;span class=&quot;Apple-style-span&quot;   style=&quot;  ;font-family:Arial, Helvetica, sans-serif;font-size:small;&quot;&gt;&lt;h1 class=&quot;chapter-title&quot; id=&quot;annotationlabel-first&quot; style=&quot;text-align: left;color: rgb(128, 0, 0); font-size: large; font-weight: bold; &quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium; &quot;&gt;What Is SQL?&lt;/span&gt;&lt;/h1&gt;&lt;div&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small; &quot;&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3001200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;114&quot; id=&quot;114&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;SQL, Structured Query Language, is the standard language used to communicate with a relational database.&lt;/p&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3001200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3001200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;/p&gt;&lt;h3 class=&quot;sect3-title&quot; id=&quot;130-1&quot; style=&quot;color: rgb(128, 0, 0); font-size: medium; font-weight: bold; &quot;&gt;What Is a Database?&lt;/h3&gt;&lt;p class=&quot;first-para&quot; id=&quot;wbp3003000&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;132&quot; id=&quot;132&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300300058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3003000&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;In very simple terms, a &lt;span class=&quot;emphasis&quot; style=&quot;font-style: italic; &quot;&gt;&lt;i&gt;database&lt;/i&gt;&lt;/span&gt; is a collection of data. Some like to think of a database as an organized mechanism that has the capability of storing information, through which a user can retrieve stored information in an effective and efficient manner.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3003100&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;133&quot; id=&quot;133&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300310058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3003100&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;People use databases every day without realizing it. A phone book is a database. The data contained consists of individuals&#39; names, addresses, and telephone numbers. The listings are alphabetized or indexed, which allows the user to reference a particular local resident with ease. Ultimately, this data is stored in a database somewhere on a computer. After all, each page of a phone book is not manually typed each year a new edition is released.&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3003200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;a name=&quot;134&quot; id=&quot;134&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;&lt;a name=&quot;wbp300320058962A15-202D-445D-BA45-CB2CD22D9888&quot; id=&quot;wbp3003200&quot; style=&quot;text-decoration: none; &quot;&gt;&lt;/a&gt;The database has to be maintained. As people move to different cities or states, entries may have to be added or removed from the phone book. Likewise, entries will have to be modified for people changing names, addresses, or telephone numbers, and so on. &lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3003200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;br /&gt;&lt;/p&gt;&lt;p class=&quot;para&quot; id=&quot;wbp3003200&quot; style=&quot;font-family: Arial, Helvetica, sans-serif; font-size: small; &quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;A &lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;span class=&quot;emphasis&quot;&gt;&lt;b&gt;&lt;span class=&quot;Apple-style-span&quot;  style=&quot;color:#660000;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: medium;&quot;&gt;relational database&lt;/span&gt;&lt;/span&gt;&lt;/b&gt;&lt;/span&gt; is a database divided into logical units called &lt;span class=&quot;emphasis&quot;&gt;&lt;b&gt;&lt;i&gt;tables&lt;/i&gt;&lt;/b&gt;&lt;/span&gt;, where tables are related to one another within the database. A relational database allows data to be broken down into logical, smaller, more manageable units, allowing for easier maintenance and providing more optimal database performance according to the level of organization.&lt;/p&gt;&lt;p&gt;&lt;/p&gt;&lt;/span&gt;&lt;/div&gt;&lt;/span&gt;</content><link rel='replies' type='application/atom+xml' href='http://rkreddy-sql.blogspot.com/feeds/7228076953892818673/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://rkreddy-sql.blogspot.com/2010/03/what-is-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default/7228076953892818673'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/5965985333096197782/posts/default/7228076953892818673'/><link rel='alternate' type='text/html' href='http://rkreddy-sql.blogspot.com/2010/03/what-is-sql.html' title='What Is SQL?'/><author><name>rkreddy</name><uri>http://www.blogger.com/profile/00332810489717834751</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>