<?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: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-7977557133803461700</id><updated>2011-11-27T15:43:16.798-08:00</updated><title type='text'>Oracle</title><subtitle type='html'>Quick overview of what a database is and what Oracle  is. A quick description of Oracle's toolset.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default?max-results=100'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>54</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>100</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-3718362004648519737</id><published>2010-03-02T03:15:00.000-08:00</published><updated>2010-03-02T03:27:58.936-08:00</updated><title type='text'>Oracle interMedia Image Quick Start</title><content type='html'>&lt;a href="http://3.bp.blogspot.com/_ehZ0YptbtKs/S4z0KwENVsI/AAAAAAAAAC8/z3ycUacGVdM/s1600-h/IMAGE.bmp"&gt;&lt;img id="BLOGGER_PHOTO_ID_5443994515122509506" style="DISPLAY: block; MARGIN: 0px auto 10px; WIDTH: 320px; CURSOR: hand; HEIGHT: 200px; TEXT-ALIGN: center" alt="" src="http://3.bp.blogspot.com/_ehZ0YptbtKs/S4z0KwENVsI/AAAAAAAAAC8/z3ycUacGVdM/s320/IMAGE.bmp" border="0" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;Oracle interMedia Image Quick Start&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;Object Interface Introduction&lt;/strong&gt;&lt;br /&gt;&lt;br /&gt;Oracle interMedia (“interMedia”) is a feature that enables Oracle Database to store, manage, and retrieve images, audio, video, or other heterogeneous media data in an integrated fashion with other enterprise information. Oracle interMedia extends Oracle Database reliability, availability, and data management to multimedia content in traditional, Internet, electronic commerce, and media-rich applications.&lt;br /&gt;This article provides simple PL/SQL examples that upload, store, manipulate, and export image data inside a database using interMedia. Some common pitfalls are also highlighted. We assume only Oracle Database release 9i or later with Oracle interMedia installed (the default configuration provided by Oracle Universal Installer).&lt;br /&gt;NOTE: Access to an administrative account is required in order to grant the necessary file system privileges. In the following examples, you should change the command connect / as sysdba to the appropriate connect username/password as sysdba for your site. The following examples also connect to the database using connect scott/tiger, which you should change to an actual user name and password on your system. You should also modify the definition of IMGDIR to point at the directory where you have downloaded the three&lt;br /&gt;sample image files goats.gif, flowers.jpg, and dummy.dcm.&lt;br /&gt;&lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;strong&gt;Overview of ORDImage &lt;/strong&gt;&lt;br /&gt;Oracle can store image data in either a Binary Large OBject (“BLOB”) column or an ORDImage object column. Some of the advantages of using the ORDImage object are:&lt;br /&gt;1. Tight integration with Oracle’s development tools such as Oracle JDeveloper, Oracle Content&lt;br /&gt;Management SDK, Oracle Application Server Portal, and so on.&lt;br /&gt;2. Information such as height and width is automatically determined and stored with the image data.&lt;br /&gt;An example of an ORDImage object in a database table is illustrated in the following diagram. &lt;/div&gt;&lt;br /&gt;&lt;div align="justify"&gt;&lt;br /&gt;number ORDImage ORDImage&lt;br /&gt;height (integer)&lt;br /&gt;width (integer)&lt;br /&gt;contentLength (integer)&lt;br /&gt;fileFormat (varchar2)&lt;br /&gt;contentFormat (varchar2)&lt;br /&gt;compressionFormat(varchar2)&lt;br /&gt;mimeType (varchar2)&lt;br /&gt;source (ORDSource)&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;Creating a Table with an ORDImage Column&lt;br /&gt;&lt;/strong&gt;First, we create a simple table with two columns: a numeric identifier (id) and an ORDSYS.ORDImage object (image). Note that all interMedia objects and procedures are defined in the ORDSYS schema.&lt;br /&gt;connect scott/tiger&lt;br /&gt;create table image_table (id number primary key, image ordsys.ordimage);&lt;br /&gt;Importing Images&lt;br /&gt;This section shows how to bring images from the file system into the newly created table named image_table.&lt;br /&gt;1. Create a directory object within the database that points to the file system directory that contains the sample image files. This is the directory where you saved the image files included with this quickstart.  &lt;strong&gt;connect / as sysdba&lt;br /&gt;&lt;/strong&gt;create or replace directory imagedir as '/home/alamb/quickstart/';&lt;br /&gt;-- For windows: create or replace directory imagedir as 'c:\quickstart';&lt;br /&gt;grant read on directory imagedir to scott;&lt;br /&gt;2. Create a PL/SQL procedure image_import() that inserts a new row into image_table and then imports  the image data in filename into the newly created ORDImage object.&lt;br /&gt;create or replace procedure image_import(dest_id number, filename varchar2) is img ordsys.ordimage;&lt;br /&gt;ctx raw(64) := null;&lt;br /&gt;begin&lt;br /&gt;delete from image_table where id = dest_id;&lt;br /&gt;insert into image_table (id, image)&lt;br /&gt;values (dest_id, ordsys.ordimage.init())&lt;br /&gt;returning image into img;&lt;br /&gt;img.importFrom(ctx, 'file', 'IMAGEDIR', filename);&lt;br /&gt;update image_table set image=img where id=dest_id;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;3. Call the newly created procedure to import 2 sample image files.&lt;br /&gt;call image_import(1,’flowers.jpg’);&lt;br /&gt;call image_import(2,’goats.gif’);&lt;br /&gt;NOTE: The directory object is named IMAGEDIR (in uppercase letters) even if it was created with upper or lower case letters. Thus the command img.importFrom(ctx, 'file', 'imagedir', filename); will not work and the following error is returned.&lt;br /&gt;ORA-22285: non-existent directory or file for FILEOPEN operation error.&lt;br /&gt;NOTE: If the image you are importing is not one of interMedia’s supported formats (for example JPEG2000)  the following error is returned.  ORA-29400: data cartridge error  IMG-00705: unsupported or corrupted input format&lt;br /&gt;For information on the use of interMedia to manage non-natively supported image formats, see the appendix.&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;Selecting and Viewing Image Properties&lt;br /&gt;&lt;/strong&gt;Once image_table has been populated, you can access image metadata using SQL queries. In the following example, we demonstrate how to select some information from the imported images:&lt;br /&gt;1. Height and width.&lt;br /&gt;2. File format and compression format.&lt;br /&gt;3. Content format (RGB, grayscale, and so on) and content length (bytes of image data).&lt;br /&gt;connect scott/tiger&lt;br /&gt;select id,&lt;br /&gt;t.image.getheight(),&lt;br /&gt;t.image.getwidth()&lt;br /&gt;from image_table t;&lt;br /&gt;select id,&lt;br /&gt;t.image.getfileformat(),&lt;br /&gt;t.image.getcompressionformat()&lt;br /&gt;from image_table t;&lt;br /&gt;select id,&lt;br /&gt;t.image.getcontentformat(),&lt;br /&gt;t.image.getcontentlength()&lt;br /&gt;from image_table t;&lt;br /&gt;The resulting output looks like the following (the formatting commands are in the included script files).&lt;br /&gt;id height width&lt;br /&gt;---------- ---------- ----------&lt;br /&gt;1 600 800&lt;br /&gt;2 375 500&lt;br /&gt;id fileformat compression&lt;br /&gt;---------- ------------------------------ ------------------------------&lt;br /&gt;1 JFIF JPEG&lt;br /&gt;2 GIFF GIFLZW&lt;br /&gt;id contentformat length&lt;br /&gt;---------- ------------------------------ ----------&lt;br /&gt;1 24BITRGB 66580&lt;br /&gt;2 8BITLUTRGBT 189337&lt;br /&gt;&lt;strong&gt;Creating Thumbnails and Changing Formats&lt;br /&gt;&lt;/strong&gt;We next illustrate some image processing operations that can be invoked within the database. To generate a new ORDImage object from an existing one, the programmer describes the desired properties of the new image. For example, the following description generates a JPEG thumbnail image of size 75x100 pixels:&lt;br /&gt;‘fileformat=jfif fixedscale=75 100’.&lt;br /&gt;NOTE: Some three-letter image file extensions and the corresponding interMedia fileformat are as follows. &lt;/div&gt;&lt;div align="justify"&gt;Extension fileformat&lt;br /&gt;.jpg JFIF (9i, 10g), JPEG (10g)&lt;br /&gt;.gif GIFF(9i, 10g), GIF (10g)&lt;br /&gt;.tif, .tiff TIFF&lt;br /&gt;.png PNGF&lt;br /&gt;The following example defines image_processCopy() that adds a new row to image_table with identifier dest_id and generates an ORDImage in the new row by processCopy’ing of the ORDImage in the source row.&lt;br /&gt;connect scott/tiger&lt;br /&gt;create or replace procedure image_processCopy(source_id number, dest_id number, verb varchar2) is&lt;br /&gt;imgSrc ordsys.ordimage;&lt;br /&gt;imgDst ordsys.ordimage;&lt;br /&gt;begin&lt;br /&gt;delete from image_table where id = dest_id;&lt;br /&gt;insert into image_table (id, image)&lt;br /&gt;values (dest_id, ordsys.ordimage.init());&lt;br /&gt;select image into imgSrc from image_table where id = source_id;&lt;br /&gt;select image into imgDst from image_table where id = dest_id for update;&lt;br /&gt;imgSrc.processCopy(verb, imgDst);&lt;br /&gt;update image_table set image = imgDst where id = dest_id;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;-- Scale flowers.jpg to 10% into row with id=3&lt;br /&gt;call image_processcopy(1,3,'scale=.1');&lt;br /&gt;-- convert goats.gif to grayscale jpeg thumbnail into row with id=4&lt;br /&gt;call image_processcopy(2,4,'fileformat=jfif contentformat=8bitgray maxscale=100 100');&lt;br /&gt;-- look at our handiwork&lt;br /&gt;column t.image.getfileformat() format A20;&lt;br /&gt;select id, t.image.getWidth(), t.image.getHeight(), t.image.getFileFormat()&lt;br /&gt;from image_table t;&lt;br /&gt;The preceding example generates the following output.&lt;br /&gt;ID T.IMAGE.GETWIDTH() T.IMAGE.GETHEIGHT() T.IMAGE.GETFILEFORMA&lt;br /&gt;---------- ------------------ ------------------- --------------------&lt;br /&gt;1 800 600 JFIF&lt;br /&gt;2 500 375 GIFF&lt;br /&gt;3 80 60 JFIF&lt;br /&gt;4 100 75 JFIF&lt;br /&gt;NOTE: The following error might be returned from ORDImage.processCopy().&lt;br /&gt;ORA-29400: data cartridge error&lt;br /&gt;IMG-00703: unable to read image data&lt;br /&gt;ORA-28575: unable to open RPC connection to external procedure agent&lt;br /&gt;In Oracle Database release 9i, JPEG (and some other less common formats) encoding and decoding requires the&lt;br /&gt;external procedure agent (extproc). To fix the preceding error, the Oracle Listener needs to be configured to use&lt;br /&gt;extproc. See technical note 198099.1, Configuration of the External Procedure Call for interMedia at&lt;br /&gt;http://metalink.oracle.com for detailed instructions on setting up extproc. Oracle Database release 10g does not&lt;br /&gt;require extproc for JPEG encoding and decoding.&lt;br /&gt;If you do not want to change your Oracle Net configuration, try changing the file format to pngf as follows.&lt;br /&gt;-- convert goats.gif to grayscale png thumnbail&lt;br /&gt;call image_processcopy(2,5,’fileformat=pngf contentformat=8bitgray maxscale=100 100’);&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;Exporting Images with ORDImage.export()&lt;br /&gt;&lt;/strong&gt;Exporting image data from the database with interMedia’s export method requires that the database write to the file system. Writing to the file system requires granting JAVA permissions to your user (scott in the examples) and to the ORDSYS* schema as shown in the following example.&lt;br /&gt;connect / as sysdba&lt;br /&gt;create or replace directory imagedir as '/home/alamb/quickstart';&lt;br /&gt;-- For windows:&lt;br /&gt;--create or replace directory imagedir as 'c:\quickstart';&lt;br /&gt;grant read on directory imagedir to scott;&lt;br /&gt;call dbms_java.grant_permission('SCOTT','java.io.FilePermission',&lt;br /&gt;'/home/alamb/quickstart/*','WRITE');&lt;br /&gt;call dbms_java.grant_permission('ORDSYS','java.io.FilePermission',&lt;br /&gt;'/home/alamb/quickstart/*','WRITE');&lt;br /&gt;&lt;strong&gt;-- For windows: &lt;/strong&gt;&lt;br /&gt;--call dbms_java.grant_permission('SCOTT','java.io.FilePermission','c:\quickstart\*','WRITE');&lt;br /&gt;--call dbms_java.grant_permission('ORDSYS','java.io.FilePermission','c:\quickstart\*','WRITE');&lt;br /&gt;connect scott/tiger&lt;br /&gt;&lt;strong&gt;-- Writes the image data from ORDImage with id=&lt;source_id&gt; in image_table&lt;br /&gt;&lt;/strong&gt;-- to the file named &lt;filename&gt;in the IMAGEDIR directory&lt;br /&gt;create or replace procedure image_export (source_id number, filename varchar2) as&lt;br /&gt;imgSrc ordsys.ordimage;&lt;br /&gt;ctx raw(64) := null;&lt;br /&gt;begin&lt;br /&gt;select image into imgSrc from image_table where id = source_id;&lt;br /&gt;imgSrc.export(ctx, 'FILE', 'IMAGEDIR', filename);&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;call image_export(3, 'flowers_thumbnail.jpg');&lt;br /&gt;call image_export(4, 'goats_grayscale.jpg');&lt;br /&gt;*NOTE: For Oracle Database releases 9.2.0.1, 9.2.0.2, and 9.2.0.3 you must change ORDSYS in the preceding  export example to ORDPLUGINS. Cleaning Up To restore your database to its original state, you need to remove all of the objects that were created in this quickstart as shown in the following example.&lt;br /&gt;connect / as sysdba&lt;br /&gt;drop directory imagedir;&lt;br /&gt;call dbms_java.revoke_permission('SCOTT','java.io.FilePermission',&lt;br /&gt;'/home/alamb/quickstart/*','WRITE');&lt;br /&gt;call dbms_java.revoke_permission('ORDSYS','java.io.FilePermission',&lt;br /&gt;'/home/alamb/quickstart/*','WRITE');&lt;br /&gt;-- For windows:&lt;br /&gt;--call dbms_java.revoke_permission('SCOTT','java.io.FilePermission', 'c:\quickstart\*','WRITE');&lt;br /&gt;-- call dbms_java.revoke_permission('ORDSYS','java.io.FilePermission','c:\quickstart\*','WRITE');&lt;br /&gt;connect scott/tiger&lt;br /&gt;drop procedure image_import;&lt;br /&gt;drop procedure image_processcopy;&lt;br /&gt;drop procedure image_export;&lt;br /&gt;drop table image_table;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;Conclusion&lt;br /&gt;&lt;/strong&gt;Using the provided ORDImage object type, we have shown how to import images into the database, write SQL queries based on image metadata (width, height, and so on), perform basic image processing, and export images to the file system.&lt;br /&gt;Oracle interMedia provides more functionality than is covered in this quickstart. Refer to the following documentation for more information: &lt;strong&gt;Oracle interMedia User’s Guide and Reference, Release 9.0.1, Oracle interMedia Reference, 10g Release 1 (10.1), and Oracle interMedia User’s Guide, 10g Release 1 (10.1). &lt;/strong&gt;&lt;br /&gt;Additional examples and articles are available on the interMedia web page on the Oracle Technology Network at http://www.oracle.com/technology/products/intermedia/index.html.&lt;br /&gt;APPENDIX: Using interMedia with Non-Natively Supported Image Formats&lt;br /&gt;For image formats that interMedia understands, image properties such as height and width are automatically set when ORDImage.importFrom() is called. For image formats such as JPEG2000 that are not natively supported by interMedia, the metadata fields must be populated by the user. Metadata can be set by updating the fields of an ORDImage object either via a SQL UPDATE statement or with an object field assignment. The following example shows the procedure image_import_other() that imports an image in an unsupported format and sets the ORDImage fields to the values supplied in the arguments.&lt;br /&gt;connect scott/tiger&lt;br /&gt;create or replace procedure image_import_other&lt;br /&gt;(dest_id number, filename varchar2, imgFileFormat varchar2,&lt;br /&gt;imgHeight number, imgWidth number, imgMimeType varchar2) is&lt;br /&gt;img ordsys.ordimage;&lt;br /&gt;ctx raw(64) := null;&lt;br /&gt;begin&lt;br /&gt;delete from image_table where id = dest_id;&lt;br /&gt;insert into image_table (id, image)&lt;br /&gt;values (dest_id, ordsys.ordimage.init());&lt;br /&gt;-- import the actual image data into the database and set the&lt;br /&gt;-- other ORDImage fields manually. Note that setting the filetype&lt;br /&gt;-- to 'OTHER:filetype' causes no auto-setting of fields&lt;br /&gt;select image into img from image_table where id=dest_id for update;&lt;br /&gt;img.fileFormat := 'OTHER:'  imgFileFormat;&lt;br /&gt;img.height := imgHeight;&lt;br /&gt;img.width := imgWidth;&lt;br /&gt;img.mimeType := imgMimeType;&lt;br /&gt;img.importFrom(ctx, 'file', 'IMAGEDIR', filename);&lt;br /&gt;img.contentLength := dbms_lob.getlength(img.source.localdata);&lt;br /&gt;update image_table set image=img where id=dest_id;&lt;br /&gt;end;&lt;br /&gt;/&lt;br /&gt;call image_import_other(6,'dummy.dcm', 'DICOM', 100, 200, 'application/dicom');&lt;br /&gt;-- view the properties we just created (nicely formatted)&lt;br /&gt;column "mimetype" format A20;&lt;br /&gt;select id "id",&lt;br /&gt;t.image.getWidth() "width",&lt;br /&gt;t.image.getHeight() "height",&lt;br /&gt;t.image.getMimeType() "mimetype",&lt;br /&gt;t.image.getContentLength() "length"&lt;br /&gt;from image_table t;&lt;br /&gt;This example produces output similar to the following.&lt;br /&gt;id width height mimetype length&lt;br /&gt;---------- ---------- ---------- -------------------- ----------&lt;br /&gt;1 800 600 image/jpeg 66580&lt;br /&gt;2 500 375 image/gif 189337&lt;br /&gt;3 80 60 image/jpeg 1918&lt;br /&gt;4 100 75 image/jpeg 2156&lt;br /&gt;5 100 75 image/png 5624&lt;br /&gt;6 200 100 application/dicom 183&lt;br /&gt;To cleanup this example, run the following.&lt;br /&gt;connect scott/tiger&lt;br /&gt;drop procedure image_import_other;&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-3718362004648519737?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/3718362004648519737/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/03/oracle-intermedia-image-quick-start_02.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3718362004648519737'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3718362004648519737'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/03/oracle-intermedia-image-quick-start_02.html' title='Oracle interMedia Image Quick Start'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://3.bp.blogspot.com/_ehZ0YptbtKs/S4z0KwENVsI/AAAAAAAAAC8/z3ycUacGVdM/s72-c/IMAGE.bmp' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-7107344970547149275</id><published>2010-01-31T22:21:00.002-08:00</published><updated>2010-02-16T23:30:40.237-08:00</updated><title type='text'>Creating Groups: Part 1</title><content type='html'>&lt;span style="font-weight: bold;"&gt;Dividing Data into Groups&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You might need to divide a table of information into groups to produce meaningful results when using group functions. For example, you might want to find the average salary for each department or the oldest hire in each job category.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight: bold;"&gt;GROUP BY Clause&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You use the GROUP BY clause to organize rows in a table into groups. You can then use the group functions to return information for each group. For example, you can group data in the EMPLOYEES table by department number and then return the average salary for each department.&lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ehZ0YptbtKs/S2ZzDvjxe0I/AAAAAAAAACs/5sM5sF5p69w/s1600-h/mod4group4llllllll.gif"&gt;&lt;img style="display: block; margin: 0px auto 10px; text-align: center; cursor: pointer; width: 304px; height: 246px;" src="http://4.bp.blogspot.com/_ehZ0YptbtKs/S2ZzDvjxe0I/AAAAAAAAACs/5sM5sF5p69w/s320/mod4group4llllllll.gif" alt="" id="BLOGGER_PHOTO_ID_5433156508612393794" border="0" /&gt;&lt;/a&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt;&lt;!-- Google Analytics --&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");&lt;br /&gt;document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' &lt;br /&gt;&lt;br /&gt;type='text/javascript'%3E%3C/script%3E"));&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;br /&gt;try {&lt;br /&gt;var pageTracker = _gat._getTracker("UA-6640535-9");&lt;br /&gt;pageTracker._trackPageview();&lt;br /&gt;} catch(err) {}&lt;/script&gt;&lt;br /&gt;&lt;!-- Google Analytics --&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- AddThis Button BEGIN --&gt;&lt;br /&gt;&lt;a class="addthis_button" href="http://www.addthis.com/bookmark.php?v=250&amp;amp;username=xa-4b7b990434c29b8a"&gt;&lt;img src="http://s7.addthis.com/static/btn/v2/lg-share-en.gif" width="125" height="16" alt="Bookmark and Share" style="border:0"/&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4b7b990434c29b8a"&gt;&lt;/script&gt;&lt;br /&gt;&lt;!-- AddThis Button END --&gt;&lt;br /&gt;&lt;br /&gt;&lt;!-- AddThis Button BEGIN --&gt;&lt;br /&gt;&lt;a href="http://www.addthis.com/feed.php?username=xa-4b7b9abf30fd598a&amp;amp;h1=http%3A%2F%2Fskyniazi.blogspot.com&amp;amp;t1=" onclick="return addthis_open(this, 'feed', 'http://skyniazi.blogspot.com')" alt="Subscribe using any feed reader!" target="_blank"&gt;&lt;img src="http://s7.addthis.com/static/btn/lg-rss-2-en.gif" width="125" height="16" alt="Subscribe" style="border:0"/&gt;&lt;/a&gt;&lt;script type="text/javascript" src="http://s7.addthis.com/js/250/addthis_widget.js#username=xa-4b7b9abf30fd598a"&gt;&lt;/script&gt;&lt;br /&gt;&lt;!-- AddThis Button END --&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-7107344970547149275?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/7107344970547149275/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-groups-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/7107344970547149275'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/7107344970547149275'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-groups-part-1.html' title='Creating Groups: Part 1'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ehZ0YptbtKs/S2ZzDvjxe0I/AAAAAAAAACs/5sM5sF5p69w/s72-c/mod4group4llllllll.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-2924272450074641253</id><published>2010-01-31T22:21:00.001-08:00</published><updated>2010-01-31T22:21:21.523-08:00</updated><title type='text'>Using the Grouping Functions</title><content type='html'>Help Sheila find the following information:&lt;br /&gt;&lt;br /&gt;    * Number of rows in the EMPLOYEES table&lt;br /&gt;    * Number of employees who earn a commission&lt;br /&gt;    * Total salary budget allocation&lt;br /&gt;    * Average salary&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-2924272450074641253?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/2924272450074641253/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-grouping-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2924272450074641253'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2924272450074641253'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-grouping-functions.html' title='Using the Grouping Functions'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-3332924056120668330</id><published>2010-01-31T22:19:00.004-08:00</published><updated>2010-01-31T22:20:50.913-08:00</updated><title type='text'>Group Functions: Part 2</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Syntax&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;To specify a group function, you write the name of the function followed by an argument in parentheses. The argument can be a column name, an expression, or a constant. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ehZ0YptbtKs/S2ZynuODojI/AAAAAAAAACk/CUj_kbxv6rw/s1600-h/mod4group3444444444444.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 268px; height: 230px;" src="http://2.bp.blogspot.com/_ehZ0YptbtKs/S2ZynuODojI/AAAAAAAAACk/CUj_kbxv6rw/s320/mod4group3444444444444.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5433156027216536114" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;COUNT Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The COUNT function returns the number of non-null values in a column. If you count the values of a primary key column, you will find the number of rows in a table because a primary key column cannot contain nulls.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-3332924056120668330?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/3332924056120668330/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/group-functions-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3332924056120668330'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3332924056120668330'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/group-functions-part-2.html' title='Group Functions: Part 2'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ehZ0YptbtKs/S2ZynuODojI/AAAAAAAAACk/CUj_kbxv6rw/s72-c/mod4group3444444444444.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-5865169674139967259</id><published>2010-01-31T22:19:00.003-08:00</published><updated>2010-01-31T22:19:30.979-08:00</updated><title type='text'>Group Functions: Part 1</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Grouping Functions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sheila has learned that there are several group functions that are available for use. All are ANSI-standard SQL functions.&lt;br /&gt;&lt;br /&gt;    * You can find the average of a group of values by using the AVG function.&lt;br /&gt;    * You can find the total of a group of values by using the SUM function.&lt;br /&gt;    * MAX finds a largest value. MIN returns a smallest value.&lt;br /&gt;    * STDDEV returns a standard deviation. VARIANCE returns the statistical variance.&lt;br /&gt;    * AVG , SUM , STDDEV , and VARIANCE can be used with numerical data only. You can use MAX and MIN on character, numeric, and date data types.&lt;br /&gt;    * You can use the COUNT function to return the number of values in a column.&lt;br /&gt;&lt;br /&gt;Sheila will use the SQL GROUP functions in her SELECT statements to:&lt;br /&gt;&lt;br /&gt;    * Find the number of rows in a table&lt;br /&gt;    * Add the salaries&lt;br /&gt;    * Find the average, maximum, and minimum salaries&lt;br /&gt;    * Analyze salary information by department&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-5865169674139967259?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/5865169674139967259/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/group-functions-part-1_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5865169674139967259'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5865169674139967259'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/group-functions-part-1_31.html' title='Group Functions: Part 1'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-288339155840441791</id><published>2010-01-31T22:19:00.001-08:00</published><updated>2010-01-31T22:19:29.091-08:00</updated><title type='text'>Group Functions: Part 1</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Grouping Functions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Sheila has learned that there are several group functions that are available for use. All are ANSI-standard SQL functions.&lt;br /&gt;&lt;br /&gt;    * You can find the average of a group of values by using the AVG function.&lt;br /&gt;    * You can find the total of a group of values by using the SUM function.&lt;br /&gt;    * MAX finds a largest value. MIN returns a smallest value.&lt;br /&gt;    * STDDEV returns a standard deviation. VARIANCE returns the statistical variance.&lt;br /&gt;    * AVG , SUM , STDDEV , and VARIANCE can be used with numerical data only. You can use MAX and MIN on character, numeric, and date data types.&lt;br /&gt;    * You can use the COUNT function to return the number of values in a column.&lt;br /&gt;&lt;br /&gt;Sheila will use the SQL GROUP functions in her SELECT statements to:&lt;br /&gt;&lt;br /&gt;    * Find the number of rows in a table&lt;br /&gt;    * Add the salaries&lt;br /&gt;    * Find the average, maximum, and minimum salaries&lt;br /&gt;    * Analyze salary information by department&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-288339155840441791?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/288339155840441791/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/group-functions-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/288339155840441791'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/288339155840441791'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/group-functions-part-1.html' title='Group Functions: Part 1'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-5827226713273342909</id><published>2010-01-31T22:18:00.003-08:00</published><updated>2010-01-31T22:18:59.466-08:00</updated><title type='text'>Working with Groups of Data</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Grouping Data&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can use group functions in a SQL statement to display information about groups of rows in the database. A group function performs an operation on a set of data.&lt;br /&gt;&lt;br /&gt;Group functions operate on sets of rows and return one result per group. Group functions are also called multiple-row functions (in contrast with single-row functions, which return one result for each row).&lt;br /&gt;&lt;br /&gt;You can use a group function to operate on a set of data. The set may be an entire table or only part of the table.&lt;br /&gt;&lt;br /&gt;In this section, Sheila creates reports that summarize data.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-5827226713273342909?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/5827226713273342909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/working-with-groups-of-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5827226713273342909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5827226713273342909'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/working-with-groups-of-data.html' title='Working with Groups of Data'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-7700787457524357284</id><published>2010-01-31T22:18:00.001-08:00</published><updated>2010-01-31T22:18:27.205-08:00</updated><title type='text'>Using the NVL  Function</title><content type='html'>Sheila needs to produce a report to find employees who do not have a manager.&lt;br /&gt;&lt;br /&gt;    * Display the value of “No Manager” where the manager ID column is null.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-7700787457524357284?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/7700787457524357284/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-nvl-function_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/7700787457524357284'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/7700787457524357284'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-nvl-function_31.html' title='Using the NVL  Function'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-5964340693758634017</id><published>2010-01-31T22:17:00.001-08:00</published><updated>2010-01-31T22:17:23.660-08:00</updated><title type='text'>Using the NVL Function</title><content type='html'>&lt;span style="font-weight:bold;"&gt;The Null Value&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;An empty field is said to contain NULL. A NULL is defined as a value that is unavailable, unassigned, unknown, or inapplicable. A NULL is not the same as a zero or a space. Zero is a number, and a space is a character. The COMMISSION_PCT column in the EMPLOYEES table contains NULLs.&lt;br /&gt;&lt;br /&gt;Columns of any data type can contain NULLs unless the column was defined as NOT NULL when the table was created. Also, primary key columns cannot have NULLs.&lt;br /&gt;NVL Function&lt;br /&gt;&lt;br /&gt;You can use the NVL function to convert a NULL to another value.&lt;br /&gt;&lt;br /&gt;NVL Syntax&lt;br /&gt;&lt;br /&gt;NVL ( expr1, expr2) &lt;br /&gt;&lt;br /&gt;    * expr1 is the source value or expression.&lt;br /&gt;    * expr2 is the target or resulting value to substitute.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-5964340693758634017?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/5964340693758634017/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-nvl-function.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5964340693758634017'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5964340693758634017'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-nvl-function.html' title='Using the NVL Function'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-6004882935580061868</id><published>2010-01-31T22:16:00.001-08:00</published><updated>2010-01-31T22:16:57.362-08:00</updated><title type='text'>Formatting Dates</title><content type='html'>Sheila wants to format her dates differently. She wants to produce a report that shows the employee's start date in the format of Month + Day + Year: the date 06-OCT-05 should appear as "October 6th, 2005."&lt;br /&gt;&lt;br /&gt;For the birthdates in the DEPENDENTS table, she wants only the year to appear.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-6004882935580061868?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/6004882935580061868/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/formatting-dates_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/6004882935580061868'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/6004882935580061868'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/formatting-dates_31.html' title='Formatting Dates'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-35437355355533071</id><published>2010-01-31T22:15:00.000-08:00</published><updated>2010-01-31T22:16:28.911-08:00</updated><title type='text'>Formatting Dates</title><content type='html'>&lt;span style="font-weight:bold;"&gt;TO_CHAR Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can use the TO_CHAR function to customize the display of dates that are returned from a SQL SELECT statement.&lt;br /&gt;&lt;br /&gt;The TO_CHAR function has two parameters. The first parameter is the date that you want to convert. The second parameter is the format model, which specifies the way that you want the date to look when displayed.&lt;br /&gt;&lt;br /&gt;Many format models are available. A few are shown in the table below: &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://1.bp.blogspot.com/_ehZ0YptbtKs/S2Zxq_dx9RI/AAAAAAAAACc/KnlnnXr8Wp4/s1600-h/ssssssssssssssssssssssss.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 263px; height: 270px;" src="http://1.bp.blogspot.com/_ehZ0YptbtKs/S2Zxq_dx9RI/AAAAAAAAACc/KnlnnXr8Wp4/s320/ssssssssssssssssssssssss.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5433154983873869074" /&gt;&lt;/a&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-35437355355533071?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/35437355355533071/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/formatting-dates.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/35437355355533071'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/35437355355533071'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/formatting-dates.html' title='Formatting Dates'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://1.bp.blogspot.com/_ehZ0YptbtKs/S2Zxq_dx9RI/AAAAAAAAACc/KnlnnXr8Wp4/s72-c/ssssssssssssssssssssssss.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-6230744754688260885</id><published>2010-01-31T22:14:00.000-08:00</published><updated>2010-01-31T22:15:13.564-08:00</updated><title type='text'>Using Date Functions</title><content type='html'>Sheila needs a report that displays the ages of the employee's dependents. She also wants to see how many years an employee has been with the company. Each employee is rewarded with a gift when longevity with the company reaches 10 years.&lt;br /&gt;&lt;br /&gt;She needs to use the SYSDATE and MONTHS_BETWEEN functions to determine this information&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-6230744754688260885?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/6230744754688260885/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-date-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/6230744754688260885'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/6230744754688260885'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-date-functions.html' title='Using Date Functions'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-6333280546650282305</id><published>2010-01-31T22:13:00.000-08:00</published><updated>2010-01-31T22:14:50.808-08:00</updated><title type='text'>Date Functions: Part 2</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Common Date Functions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Date functions enhance your ability to calculate information about dates. Common DATE functions are listed in the table below. These functions operate on DATE data types and return date, date-time, or number values. &lt;br /&gt;&lt;br /&gt;&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ehZ0YptbtKs/S2ZxPNedYSI/AAAAAAAAACU/Er9_YOk1aM4/s1600-h/mod4functiondate2fffffffff.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 301px; height: 187px;" src="http://2.bp.blogspot.com/_ehZ0YptbtKs/S2ZxPNedYSI/AAAAAAAAACU/Er9_YOk1aM4/s320/mod4functiondate2fffffffff.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5433154506598474018" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;SYSDATE Function&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SYSDATE is a special date function that returns the current date and time. You can use the function in any SQL statement.&lt;br /&gt;&lt;br /&gt;SYSDATE is a function that contains no arguments. You can use SYSDATE just as you use a column name. The SYSDATE is displayed for every row in the table used.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-6333280546650282305?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/6333280546650282305/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/date-functions-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/6333280546650282305'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/6333280546650282305'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/date-functions-part-2.html' title='Date Functions: Part 2'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ehZ0YptbtKs/S2ZxPNedYSI/AAAAAAAAACU/Er9_YOk1aM4/s72-c/mod4functiondate2fffffffff.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-8225248652306823974</id><published>2010-01-31T22:12:00.000-08:00</published><updated>2010-01-31T22:13:22.247-08:00</updated><title type='text'>Date Functions: Part 1</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Characteristics&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Oracle XE stores dates in an internal format representing the century, year, month, day, hours, minutes, and seconds. For example, if today is October 6, 2005, at 07:10 in the morning, the current date is stored internally as October 6, 2005, 07:10:06.&lt;br /&gt;&lt;br /&gt;The default display and input format for any date in XE is DD-MON-YY. DD stands for the day of the month, MON stands for the first three letters of the month name, and YY stands for the year (which also includes the century). Valid Oracle dates are between January 1, 4712 B.C., and December 31, A.D. 9999.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-8225248652306823974?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/8225248652306823974/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/date-functions-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/8225248652306823974'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/8225248652306823974'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/date-functions-part-1.html' title='Date Functions: Part 1'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-7899354683663627163</id><published>2010-01-31T22:11:00.000-08:00</published><updated>2010-01-31T22:12:32.273-08:00</updated><title type='text'>Using Numeric Functions</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://2.bp.blogspot.com/_ehZ0YptbtKs/S2ZwxYA0X7I/AAAAAAAAACM/SV7FAdEWwzo/s1600-h/mod4functionnum2ss.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 316px; height: 277px;" src="http://2.bp.blogspot.com/_ehZ0YptbtKs/S2ZwxYA0X7I/AAAAAAAAACM/SV7FAdEWwzo/s320/mod4functionnum2ss.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5433153994030866354" /&gt;&lt;/a&gt;&lt;br /&gt; Sheila wants to determine salaries rounded to the nearest thousandth. She then wants to compare those values to the values of salaries truncated to the thousandth position. She has looked up the syntax for the numeric functions and created a small sheet about them:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Help Sheila find this information.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-7899354683663627163?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/7899354683663627163/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-numeric-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/7899354683663627163'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/7899354683663627163'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-numeric-functions.html' title='Using Numeric Functions'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://2.bp.blogspot.com/_ehZ0YptbtKs/S2ZwxYA0X7I/AAAAAAAAACM/SV7FAdEWwzo/s72-c/mod4functionnum2ss.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-2119720784840844946</id><published>2010-01-31T22:10:00.002-08:00</published><updated>2010-01-31T22:11:19.876-08:00</updated><title type='text'>Number Functions</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Characteristics&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You use number functions to accept numeric input. The number functions return numeric values.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Function Names&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The three most commonly used number functions are the following:&lt;br /&gt;&lt;br /&gt;    * ROUND: Rounds a column, an expression, or a value to n decimal places&lt;br /&gt;    * MOD: Returns the remainder of x divided by y&lt;br /&gt;    * TRUNC: Truncates a column, an expression, or a value to n decimal places&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-2119720784840844946?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/2119720784840844946/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/number-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2119720784840844946'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2119720784840844946'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/number-functions.html' title='Number Functions'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-5127535618093911300</id><published>2010-01-31T22:10:00.001-08:00</published><updated>2010-01-31T22:10:47.130-08:00</updated><title type='text'>Using Character Functions</title><content type='html'>Sheila needs to add more functionality to her reports. Her employee report needs to display the first name, followed by a space, followed by the last name, all in proper case. In addition, she needs the e-mail data to appear in lowercase.&lt;br /&gt;&lt;br /&gt;She has looked up the syntax for functions and created a small sheet on them:&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-5127535618093911300?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/5127535618093911300/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-character-functions.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5127535618093911300'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5127535618093911300'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-character-functions.html' title='Using Character Functions'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-1436001803647038392</id><published>2010-01-31T22:07:00.002-08:00</published><updated>2010-01-31T22:09:54.459-08:00</updated><title type='text'>Character Functions: Part 2</title><content type='html'>&lt;a onblur="try {parent.deselectBloggerImageGracefully();} catch(e) {}" href="http://4.bp.blogspot.com/_ehZ0YptbtKs/S2ZwH9XA9HI/AAAAAAAAACE/njdw9UbRML8/s1600-h/mod4functionchar2.gif"&gt;&lt;img style="display:block; margin:0px auto 10px; text-align:center;cursor:pointer; cursor:hand;width: 246px; height: 196px;" src="http://4.bp.blogspot.com/_ehZ0YptbtKs/S2ZwH9XA9HI/AAAAAAAAACE/njdw9UbRML8/s320/mod4functionchar2.gif" border="0" alt=""id="BLOGGER_PHOTO_ID_5433153282501571698" /&gt;&lt;/a&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Case-Manipulation Functions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You use case-manipulation functions to change the case of character strings. The types of case-manipulation functions are LOWER , UPPER , and INITCAP .&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Character-Manipulation Functions&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You use character-manipulation functions to manipulate character strings. The types of character-manipulation functions are CONCAT , SUBSTR , INSTR , LPAD , RPAD , TRIM , and REPLACE .&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-1436001803647038392?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/1436001803647038392/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/character-functions-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1436001803647038392'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1436001803647038392'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/character-functions-part-2.html' title='Character Functions: Part 2'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media='http://search.yahoo.com/mrss/' url='http://4.bp.blogspot.com/_ehZ0YptbtKs/S2ZwH9XA9HI/AAAAAAAAACE/njdw9UbRML8/s72-c/mod4functionchar2.gif' height='72' width='72'/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-1296993928093861264</id><published>2010-01-31T22:07:00.001-08:00</published><updated>2010-01-31T22:07:34.248-08:00</updated><title type='text'>Character Functions: Part 1</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Characteristics&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;Single-row character functions accept character data as input and return either character or numeric values. Character functions that return character values return values of the same data type as their input argument. Character functions that return number values can take any character data type as their input argument.&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;&lt;br /&gt;Types&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;There are two types of single-row character functions:&lt;br /&gt;&lt;br /&gt;    * Case-manipulation functions&lt;br /&gt;    * Character-manipulation functions&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-1296993928093861264?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/1296993928093861264/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/character-functions-part-1.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1296993928093861264'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1296993928093861264'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/character-functions-part-1.html' title='Character Functions: Part 1'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-4164592924780051417</id><published>2010-01-31T22:06:00.002-08:00</published><updated>2010-01-31T22:07:00.130-08:00</updated><title type='text'>Using Functions to Customize Reports</title><content type='html'>A SQL function is a program that performs an operation on data. SQL functions provide a powerful way to perform operations when retrieving data from a table. For example, you may need to display employee names in uppercase in a report. Or you may need to display employees' hire dates with the name of the month spelled out.&lt;br /&gt;&lt;br /&gt;Many functions work on specific data types. Each value manipulated by Oracle XE has a data type. Data types provide a way to define the behavior of data. When you create a table, you must specify a data type for each of its columns.&lt;br /&gt;&lt;br /&gt;The three main types of data that functions work on are:&lt;br /&gt;&lt;br /&gt;    *&lt;br /&gt;      Character&lt;br /&gt;    *&lt;br /&gt;      Number&lt;br /&gt;    *&lt;br /&gt;      Date&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-4164592924780051417?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/4164592924780051417/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-functions-to-customize-reports.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4164592924780051417'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4164592924780051417'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/using-functions-to-customize-reports.html' title='Using Functions to Customize Reports'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-8376364795244282753</id><published>2010-01-31T22:06:00.001-08:00</published><updated>2010-01-31T22:06:34.065-08:00</updated><title type='text'>Joining Multiple Tables</title><content type='html'>Help Sheila build the following reports:&lt;br /&gt;&lt;br /&gt;    * A listing of each employee's first name, last name, dependent names, and the name of the department where the employee works&lt;br /&gt;    * A listing of each employee and the name of that employee's manager&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-8376364795244282753?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/8376364795244282753/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/joining-multiple-tables_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/8376364795244282753'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/8376364795244282753'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/joining-multiple-tables_31.html' title='Joining Multiple Tables'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-4167742103789097127</id><published>2010-01-31T22:04:00.002-08:00</published><updated>2010-01-31T22:06:02.631-08:00</updated><title type='text'>Joining Multiple Tables</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Joining Multiple Tables&lt;br /&gt;&lt;/span&gt;&lt;br /&gt;A three-way join is a join of three tables. You can join as many tables as needed to retrieve information. For example, you might want to find employees, their depedents' names, and the department names for those emloyees. This requires accessing three tables:- EMPLOYEES, DEPENDENTS, and DEPARTMENTS.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Syntax&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the FROM clause, you identify the tables you want to join. &lt;br /&gt;&lt;br /&gt;FROM table1         &lt;br /&gt;JOIN table2 ON conditon_x&lt;br /&gt;JOIN table3 ON condition_y&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Example&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT e.last_name, d.first_name, w.department_name&lt;br /&gt;FROM   employees e&lt;br /&gt;JOIN   dependents d&lt;br /&gt;ON     d.relative_id = e.employee_id&lt;br /&gt;JOIN   departments w&lt;br /&gt;ON     w.department_id = e.department_id&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Self-Joining Tables&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The ON clause can also be used to join columns that have different names (in the same table or in a different table). For example, you can perform a self-join of the EMPLOYEES table based on the EMPLOYEE_ID and MANAGER_ID columns.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-4167742103789097127?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/4167742103789097127/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/joining-multiple-tables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4167742103789097127'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4167742103789097127'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/joining-multiple-tables.html' title='Joining Multiple Tables'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-2200016723873597575</id><published>2010-01-31T22:04:00.001-08:00</published><updated>2010-01-31T22:04:36.271-08:00</updated><title type='text'>Applying Additional Conditions to a Join</title><content type='html'>Help Sheila build a report to find the hire date and start date of all employees who earn more than 10,000.00. She can find the hire date in the EMPLOYEES table and the start date in the JOB_HISTORY table.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-2200016723873597575?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/2200016723873597575/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/applying-additional-conditions-to-join_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2200016723873597575'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2200016723873597575'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/applying-additional-conditions-to-join_31.html' title='Applying Additional Conditions to a Join'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-8012675556253316903</id><published>2010-01-31T22:02:00.002-08:00</published><updated>2010-01-31T22:04:12.428-08:00</updated><title type='text'>Applying Additional Conditions to a Join</title><content type='html'>&lt;span style="font-weight:bold;"&gt;Additional Conditions &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You can apply additional conditions to the join. For example, you may want to join the EMPLOYEES  and DEPARTMENTS tables and, in addition, display only employees who have a manager ID of 149. To add additional conditions to the ON clause, you can add AND clauses. Alternatively, you can use a WHERE clause to apply additional conditions.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Using the AND Clause &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT e.employee_id, e.last_name, e.department_id,&lt;br /&gt;       d.department_id, d.location_id&lt;br /&gt;FROM employees e JOIN departments d&lt;br /&gt;ON (e.department_id = d.department_id)&lt;br /&gt;AND e.manager_id = 149&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Using the WHERE clause&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT e.employee_id, e.last_name, e.department_id,&lt;br /&gt;       d.department_id, d.location_id&lt;br /&gt;FROM employees e JOIN departments d&lt;br /&gt;ON (e.department_id = d.department_id)&lt;br /&gt;WHERE e.manager_id = 149&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Aliases&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;In the examples shown, aliases are used to identify the table names. In the FROM clause, an abbreviation is provided after the table name. This is called an alias. After the alias is set up in the FROM clause, you can refer to it throughout the statement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-8012675556253316903?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/8012675556253316903/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/applying-additional-conditions-to-join.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/8012675556253316903'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/8012675556253316903'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/applying-additional-conditions-to-join.html' title='Applying Additional Conditions to a Join'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-5757412336876810451</id><published>2010-01-31T22:02:00.001-08:00</published><updated>2010-01-31T22:02:46.913-08:00</updated><title type='text'>Joining Tables and Identifying Columns</title><content type='html'>Help Sheila build a report to find the hire dates and start dates of all employees. She can find the hire dates in the EMPLOYEES  table and the start dates in the JOB_HISTORY  table.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-5757412336876810451?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/5757412336876810451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/joining-tables-and-identifying-columns_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5757412336876810451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5757412336876810451'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/joining-tables-and-identifying-columns_31.html' title='Joining Tables and Identifying Columns'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-7516148886590688681</id><published>2010-01-31T22:01:00.000-08:00</published><updated>2010-01-31T22:02:26.142-08:00</updated><title type='text'>Joining Tables and Identifying Columns</title><content type='html'>&lt;span style="font-weight:bold;"&gt;ON Clause&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;You use the ON clause to specify the join condition when joining two tables or joining a table to itself. This enables you to separate the join condition from any search or filter conditions in the WHERE clause. The column names need not match between the tables; however, the data types must match.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Syntax&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT [DISTINCT] * | column [alias], ...&lt;br /&gt;FROM table1 JOIN table2&lt;br /&gt;ON col_name_1 = col_name_2&lt;br /&gt;&lt;br /&gt;For example, Shelia might need to evaluate the hire dates and start dates of all employees. She can find the hire dates in the EMPLOYEES table and the start dates in the JOB_HISTORY table. These two columns are named differently. The ON clause is as follows: &lt;br /&gt;&lt;br /&gt;FROM employees JOIN job_history&lt;br /&gt;ON employees.hire_date = job_history.start_date&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-7516148886590688681?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/7516148886590688681/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/joining-tables-and-identifying-columns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/7516148886590688681'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/7516148886590688681'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/joining-tables-and-identifying-columns.html' title='Joining Tables and Identifying Columns'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-1565894719094472288</id><published>2010-01-31T22:00:00.000-08:00</published><updated>2010-01-31T22:01:13.671-08:00</updated><title type='text'>Simple Joins</title><content type='html'>Sheila needs to build a report that displays the city locations of the departments.&lt;br /&gt;&lt;br /&gt;Watch Sheila create these reports.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-1565894719094472288?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/1565894719094472288/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/simple-joins_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1565894719094472288'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1565894719094472288'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/simple-joins_31.html' title='Simple Joins'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-2746466272721400712</id><published>2010-01-31T21:58:00.004-08:00</published><updated>2010-01-31T22:00:06.341-08:00</updated><title type='text'>Simple Joins</title><content type='html'>Natural Joins&lt;br /&gt;&lt;br /&gt;A natural join enables you to display data from two tables when a value in one column of one table corresponds directly to a value in another column in the second table.&lt;br /&gt;&lt;br /&gt;In a natural join, the two tables include one or more columns that have the same name and data types. A natural join retrieves all rows from the two tables that have equal values in all matched columns. Frequently, this type of join involves primary key and foreign key columns.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Syntax&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT [DISTINCT] * | column [alias], ...&lt;br /&gt;FROM table NATURAL JOIN ; &lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Joining Two Tables with a USING Clause &lt;/span&gt;&lt;br /&gt;&lt;br /&gt;The USING clause enables you to specify the columns to be used for a join between two tables. The column names must be the same for both tables and must have compatible data types. Use the USING clause if your tables contain more than one column whose names match to explicitly identify the name of the columns that you want to join.&lt;br /&gt;&lt;br /&gt;&lt;span style="font-weight:bold;"&gt;Syntax&lt;/span&gt;&lt;br /&gt;&lt;br /&gt;SELECT [DISTINCT] * | column [alias], ...&lt;br /&gt;FROM table1 JOIN table2&lt;br /&gt;USING common_col_name;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-2746466272721400712?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/2746466272721400712/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/simple-joins.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2746466272721400712'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2746466272721400712'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/simple-joins.html' title='Simple Joins'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-2148396177126552445</id><published>2010-01-31T21:58:00.003-08:00</published><updated>2010-01-31T21:58:39.156-08:00</updated><title type='text'>Joining Tables</title><content type='html'>Sometimes you need to display data from more than one table. To do this, you use SELECT statements. The FROM clause of your query contains the names of the tables from which you are retrieving data. Because information comes from more than one table, this is called a JOIN between the tables involved.&lt;br /&gt;&lt;br /&gt;For example, in the EMPLOYEES table, the DEPARTMENT_ID column represents the department number for an employee. In the DEPARTMENTS table, there is a DEPARTMENT_ID column as well as a DEPARTMENT_NAME column. You can join the EMPLOYEES and DEPARTMENTS tables by using the DEPARTMENT_ID column to produce a report that shows the employees' names and department names.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-2148396177126552445?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/2148396177126552445/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/joining-tables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2148396177126552445'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2148396177126552445'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/joining-tables.html' title='Joining Tables'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-4013187113152159497</id><published>2010-01-31T21:58:00.001-08:00</published><updated>2010-01-31T21:58:16.210-08:00</updated><title type='text'>Retrieving Rows</title><content type='html'>Sheila needs to build reports that display the following information:&lt;br /&gt;&lt;br /&gt;    * Employees in a specified department&lt;br /&gt;    * Employees who work for a specified manager&lt;br /&gt;    * Employees who earn less than 8,000.00&lt;br /&gt;&lt;br /&gt;Watch Sheila create these reports.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-4013187113152159497?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/4013187113152159497/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/retrieving-rows_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4013187113152159497'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4013187113152159497'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/retrieving-rows_31.html' title='Retrieving Rows'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-3993066072529299464</id><published>2010-01-31T21:57:00.001-08:00</published><updated>2010-01-31T21:57:55.275-08:00</updated><title type='text'>Retrieving Rows</title><content type='html'>You can use the selection capability of SQL to choose the rows that you want to retrieve from a table. You can specify various criteria to select the rows that you want to see.&lt;br /&gt;&lt;br /&gt;You can restrict the number of rows that are retrieved from the database by using a WHERE clause in a SQL statement. By inserting a WHERE clause into a SQL statement, you can specify a condition that must be met, and only the rows that meet the condition are returned.&lt;br /&gt;&lt;br /&gt;When using a WHERE clause:&lt;br /&gt;&lt;br /&gt;    * The WHERE clause directly follows the FROM clause in the SQL statement syntax&lt;br /&gt;    * The WHERE clause consists of the WHERE keyword and a condition or conditions.&lt;br /&gt;    * The condition in a WHERE clause specifies a comparison of values that limits the rows that are returned by a query&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-3993066072529299464?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/3993066072529299464/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/retrieving-rows.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3993066072529299464'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3993066072529299464'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/retrieving-rows.html' title='Retrieving Rows'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-2218496720741438098</id><published>2010-01-31T21:56:00.002-08:00</published><updated>2010-01-31T21:57:11.207-08:00</updated><title type='text'>Retrieving Columns</title><content type='html'>Sheila needs to build the following report:&lt;br /&gt;&lt;br /&gt;It is time for benefits review. To gather information on each employee, HR needs a report with the employees' first names, last names, IDs, salaries, and e-mail addresses. The data needs to be sorted by employee salary.&lt;br /&gt;&lt;br /&gt;Watch Sheila build this report...&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-2218496720741438098?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/2218496720741438098/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/retrieving-columns_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2218496720741438098'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2218496720741438098'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/retrieving-columns_31.html' title='Retrieving Columns'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-3301509278183560263</id><published>2010-01-31T21:56:00.001-08:00</published><updated>2010-01-31T21:56:49.269-08:00</updated><title type='text'>Retrieving Columns</title><content type='html'>You can use the projection capability of SQL to choose the columns in a table that you want to retrieve. You can retrieve selected columns or all columns from a table.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-3301509278183560263?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/3301509278183560263/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/retrieving-columns.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3301509278183560263'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3301509278183560263'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/retrieving-columns.html' title='Retrieving Columns'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-1917062298161579832</id><published>2010-01-31T21:55:00.002-08:00</published><updated>2010-01-31T21:56:25.320-08:00</updated><title type='text'>Writing a Basic Query</title><content type='html'>Sheila wants to see the data in the HR tables. She would like to view the data in the EMPLOYEES  and DEPARTMENTS tables.&lt;br /&gt;&lt;br /&gt;Watch Sheila retrieve data from the DEPARTMENTS and EMPLOYEES tables:&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sorting Data&lt;br /&gt;&lt;br /&gt;Now that Sheila can see the data, she wants to sort it. She would like to see the data in the EMPLOYEES table sorted by last names.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-1917062298161579832?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/1917062298161579832/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/writing-basic-query_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1917062298161579832'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1917062298161579832'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/writing-basic-query_31.html' title='Writing a Basic Query'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-3555195278569594293</id><published>2010-01-31T21:55:00.001-08:00</published><updated>2010-01-31T21:55:48.450-08:00</updated><title type='text'>Writing a Basic Query</title><content type='html'>Writing SELECT Statements&lt;br /&gt;&lt;br /&gt;When Sheila writes a basic query, two mandatory clauses in the SELECT statement syntax are required: a SELECT clause and a FROM clause.&lt;br /&gt;&lt;br /&gt;The SELECT statement syntax is displayed. The SELECT clause specifies the columns that you want to display. The FROM clause specifies the tables that contain those columns. &lt;br /&gt;&lt;br /&gt;SELECT [DISTINCT] * | column [alias], ...&lt;br /&gt;FROM table;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-3555195278569594293?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/3555195278569594293/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/writing-basic-query.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3555195278569594293'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3555195278569594293'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/writing-basic-query.html' title='Writing a Basic Query'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-3532736257463546468</id><published>2010-01-31T21:54:00.001-08:00</published><updated>2010-01-31T21:54:55.836-08:00</updated><title type='text'>Building Queries</title><content type='html'>Sheila's manager has asked her to write several reports for human resources.&lt;br /&gt;&lt;br /&gt;Sheila starts by accessing the interface where she can build her queries. She can either:&lt;br /&gt;&lt;br /&gt;    * Use the SQL Workshop tool to type her SELECT statements&lt;br /&gt;    * Use the Query Builder tool to build the query graphically&lt;br /&gt;&lt;br /&gt;Watch Sheila navigate to the SQL Workshop and Query Builder tools.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-3532736257463546468?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/3532736257463546468/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/building-queries_31.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3532736257463546468'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/3532736257463546468'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/building-queries_31.html' title='Building Queries'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-2370777660675593376</id><published>2010-01-31T21:53:00.002-08:00</published><updated>2010-01-31T21:54:07.541-08:00</updated><title type='text'>Building Queries: Part 2</title><content type='html'>Sheila will use the SQL SELECT  statement to extract data from a database. With the SELECT statement, you can choose to see all or some of the data in a table.&lt;br /&gt;SELECT Statement Types&lt;br /&gt;&lt;br /&gt;SELECT statements have three capabilities:&lt;br /&gt;*  Selection: Identifying rows&lt;br /&gt;*  Projection: Identifying columns&lt;br /&gt;*  Join: Retrieving data from multiple tables&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-2370777660675593376?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/2370777660675593376/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/building-queries-part-2.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2370777660675593376'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2370777660675593376'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/building-queries-part-2.html' title='Building Queries: Part 2'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-1784942971268035134</id><published>2010-01-31T21:53:00.001-08:00</published><updated>2010-01-31T21:53:35.360-08:00</updated><title type='text'>Building Queries</title><content type='html'>All operations on information in an Oracle database are performed by using SQL statements. A SQL statement is a string of SQL text. The SQL SELECT statement is the command that retrieves data from the XE tables.&lt;br /&gt;&lt;br /&gt;Sheila will use the SQL SELECT statement to:&lt;br /&gt;&lt;br /&gt;    * Write queries&lt;br /&gt;    * Create SELECT statements that restrict rows&lt;br /&gt;    * Sort output&lt;br /&gt;    * Display data from many tables&lt;br /&gt;    * Customize output with functions embedded in the SELECT statement&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-1784942971268035134?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/1784942971268035134/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/building-queries.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1784942971268035134'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1784942971268035134'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/building-queries.html' title='Building Queries'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-5159953426171781362</id><published>2010-01-31T21:52:00.003-08:00</published><updated>2010-01-31T21:52:57.454-08:00</updated><title type='text'>Accessing Data</title><content type='html'>In this module, you learn how to retrieve data from tables. The SQL SELECT statement is used to access and report data back from the XE tables. This is known as "querying" the data. In XE, you can either write SELECT  statements using the SQL Workshop tool, or you can use the Query Builder tool to build queries with a GUI interface.&lt;br /&gt;&lt;br /&gt;You will watch Sheila write several reports for the Human Resources department. Sheila will use both the SQL SELECT statement in the SQL Workshop tool and the Query Builder tool to access data in the Human Resources tables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-5159953426171781362?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/5159953426171781362/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/accessing-data.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5159953426171781362'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5159953426171781362'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/accessing-data.html' title='Accessing Data'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-963917674735885125</id><published>2010-01-31T21:52:00.001-08:00</published><updated>2010-01-31T21:52:23.823-08:00</updated><title type='text'>Removing a Copy of a Table</title><content type='html'>Sheila realizes that she does not need copies of the LOCATIONS and EMPLOYEES  tables. She decides to remove them.&lt;br /&gt;&lt;br /&gt;Watch Sheila remove the EMPLOYEES_COPY table by using the Object Browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-963917674735885125?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/963917674735885125/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/removing-copy-of-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/963917674735885125'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/963917674735885125'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/removing-copy-of-table.html' title='Removing a Copy of a Table'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-100248625436210776</id><published>2010-01-31T21:51:00.003-08:00</published><updated>2010-01-31T21:51:56.154-08:00</updated><title type='text'>Removing Tables</title><content type='html'>You can discard a table if you no longer find it useful. The DROP TABLE statement removes the definition of the table from the database.&lt;br /&gt;&lt;br /&gt;Deleting all of the records in a table is different from DROP TABLE. After deleting all the records, the column and constraint information still remains. But DROP TABLE results in the removal of the table definition along with the rows.&lt;br /&gt;&lt;br /&gt;In Oracle Database XE, you can remove a table in either of the following ways:&lt;br /&gt;&lt;br /&gt;    * Select Object Browser &gt; Browse &gt; Tables. Click the table name, and then click DROP.&lt;br /&gt;    * Select SQL &gt; SQL commands &gt; Enter command. Type the SQL statement, and then click Run.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-100248625436210776?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/100248625436210776/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/removing-tables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/100248625436210776'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/100248625436210776'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/removing-tables.html' title='Removing Tables'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-8644937997788107228</id><published>2010-01-31T21:51:00.001-08:00</published><updated>2010-01-31T21:51:34.531-08:00</updated><title type='text'>Implementing Business Rules</title><content type='html'>Sheila's manager wants to ensure that data integrity is handled on the new tables and columns that she has created. The manager has asked Sheila to add constraints with the following rules:&lt;br /&gt;&lt;br /&gt;    * In the DEPENDENTS table, have a primary key constraint on the Id column&lt;br /&gt;    * Allow the Gender column to hold the value of M or F&lt;br /&gt;    * Tie the DEPENDENTS table to the EMPLOYEES table so that the RelativeId column must hold a valid value from the EMPLOYEES Id column&lt;br /&gt;    * Disable the constraint between the DEPENDENTS and EMPLOYEES tables&lt;br /&gt;&lt;br /&gt;Watch Sheila manage the constraints on the DEPENDENTS table by using the Object Browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-8644937997788107228?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/8644937997788107228/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/implementing-business-rules.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/8644937997788107228'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/8644937997788107228'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/implementing-business-rules.html' title='Implementing Business Rules'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-7804792163827539782</id><published>2010-01-31T21:50:00.000-08:00</published><updated>2010-01-31T21:51:03.166-08:00</updated><title type='text'>Creating Constraints</title><content type='html'>Constraints can be enforced at two levels:&lt;br /&gt;&lt;br /&gt;    * Column level&lt;br /&gt;    * Table level&lt;br /&gt;&lt;br /&gt;A constraint can be created with either of the following statements:&lt;br /&gt;&lt;br /&gt;    * CREATE TABLE&lt;br /&gt;    * ALTER TABLE&lt;br /&gt;&lt;br /&gt;With the ALTER TABLE statement, you can disable or enable the imposed constraint without dropping it or re-creating it:&lt;br /&gt;&lt;br /&gt;    * Disable a constraint by using the DISABLE clause.&lt;br /&gt;    * Enable a constraint by using the ENABLE clause.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-7804792163827539782?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/7804792163827539782/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-constraints.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/7804792163827539782'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/7804792163827539782'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-constraints.html' title='Creating Constraints'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-4855838195833163474</id><published>2010-01-31T21:48:00.002-08:00</published><updated>2010-01-31T21:50:43.713-08:00</updated><title type='text'>Identifying Constraints</title><content type='html'># PRIMARY KEY&lt;br /&gt;&lt;br /&gt;The PRIMARY KEY constraint is a column or a set of columns that uniquely identifies each row in a table. This constraint enforces uniqueness of the column or column combination. It ensures that no column that is part of the primary key can contain a null value. A null value is a value that does not exist.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;For example, in the DEPENDENTS table, the column ID is the primary key.This column will not allow either a duplicate value or a null value.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;# FOREIGN KEY&lt;br /&gt;&lt;br /&gt;The FOREIGN KEY constraint designates a column or a combination of columns as a foreign key. It establishes a relationship between a primary key or a unique key in the same table or different table. A foreign key enforces that the value within the column matches the value in the relationship column.&lt;br /&gt;&lt;br /&gt;For example, the RelativeId column in the DEPENDENTS table refers to the EMPLOYEES table. You cannot delete a record in the EMPLOYEES table whose RelativeId is used in the DEPENDENTS table. Also, with a non-existing RelativeId in the EMPLOYEES table, you cannot insert a record into the DEPENDENTS table.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;# CHECK&lt;br /&gt;&lt;br /&gt;The CHECK constraint enforces integrity by restricting the values to be inserted in a column. It defines a condition that each row must sastisfy. You can define multiple check constraints on a single column. Also, you can apply a single check constraint to multiple columns.&lt;br /&gt;&lt;br /&gt;For example, when you impose the CHECK constraint on the Gender column in the DEPENDENTS table, you can specify that the only valid values are either M or F.&lt;br /&gt;&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; &lt;br /&gt;# UNIQUE&lt;br /&gt;&lt;br /&gt;The UNIQUE constraint requires that no two rows of a table can have duplicate values in a specified column or a set of columns. A table can have more than one unique key. If the UNIQUE constraint comprises more than one column, then the group of columns is called a coomposite key.&lt;br /&gt;&lt;br /&gt;For example, you can impose the UNIQUE constraint on the Email column of the EMPLOYEES table. You ensure that each employee has a unique email ID.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-4855838195833163474?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/4855838195833163474/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/identifying-constraints.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4855838195833163474'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4855838195833163474'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/identifying-constraints.html' title='Identifying Constraints'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-6884731850547231307</id><published>2010-01-31T21:48:00.001-08:00</published><updated>2010-01-31T21:48:33.216-08:00</updated><title type='text'>Managing Constraints</title><content type='html'>What Are Constraints?&lt;br /&gt;&lt;br /&gt;Data integrity ensures the consistency and correctness of data stored in a database. Such integrity can be enforced by incorporating business rules. Constraints are the rules that are enforced on data stored in a table.&lt;br /&gt;&lt;br /&gt;Why Should I Use Constraints?&lt;br /&gt;&lt;br /&gt;You can use constraints to do the following:&lt;br /&gt;&lt;br /&gt;    * Enforce rules on the data in a table whenever a row is updated, inserted, or deleted from that table&lt;br /&gt;    * Prevent the deletion of a table if there are dependencies from other tables&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-6884731850547231307?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/6884731850547231307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/managing-constraints.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/6884731850547231307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/6884731850547231307'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/managing-constraints.html' title='Managing Constraints'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-4944951743278591344</id><published>2010-01-31T21:47:00.002-08:00</published><updated>2010-01-31T21:48:05.245-08:00</updated><title type='text'>Adding a New Column</title><content type='html'>Sheila's company wants to keep a record of employee birthdates. To do this, Sheila needs to add a new column, BirthDate, to the EMPLOYEES table. This column will have the DATE data type.&lt;br /&gt;&lt;br /&gt;Watch Sheila add a new column to the EMPLOYEES table by using the Object Browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-4944951743278591344?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/4944951743278591344/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/adding-new-column.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4944951743278591344'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4944951743278591344'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/adding-new-column.html' title='Adding a New Column'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-1701389374072872037</id><published>2010-01-31T21:47:00.001-08:00</published><updated>2010-01-31T21:47:42.378-08:00</updated><title type='text'>Modifying Tables</title><content type='html'>You can modify tables using the SQL ALTER TABLE statement. You may need to change the table structure due to any of the following reasons:&lt;br /&gt;&lt;br /&gt;    * You omitted a column.&lt;br /&gt;    * Your column definition needs to be changed.&lt;br /&gt;    * You need to remove columns.&lt;br /&gt;&lt;br /&gt;The ALTER TABLE statement is used to:&lt;br /&gt;&lt;br /&gt;    * Add a new column&lt;br /&gt;    * Modify an existing column&lt;br /&gt;    * Define a default value for the new column&lt;br /&gt;    * Drop a column&lt;br /&gt;    * Manage constraints&lt;br /&gt;&lt;br /&gt;In Oracle Database XE, you can modify tables:&lt;br /&gt;&lt;br /&gt;    * Using the Object Browser&lt;br /&gt;    * Using the SQL Workshop tool&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-1701389374072872037?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/1701389374072872037/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/modifying-tables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1701389374072872037'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/1701389374072872037'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/modifying-tables.html' title='Modifying Tables'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-130259425738985307</id><published>2010-01-31T21:46:00.002-08:00</published><updated>2010-01-31T21:47:13.966-08:00</updated><title type='text'>Creating a Copy of a Table</title><content type='html'>Sheila wants to copy the EMPLOYEES  table so that she can practice without affecting the real data. Watch Sheila create a copy of the table by using the Object Browser.&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;Sheila wants to have a copy the LOCATIONS  table. Watch Sheila create a copy of the table by using the appropriate SQL statement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-130259425738985307?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/130259425738985307/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-copy-of-table.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/130259425738985307'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/130259425738985307'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-copy-of-table.html' title='Creating a Copy of a Table'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-2834135668688687860</id><published>2010-01-31T21:46:00.001-08:00</published><updated>2010-01-31T21:46:37.139-08:00</updated><title type='text'>Creating Tables Using SQL</title><content type='html'>Sheila needs to create the AUDIT_RECORD_TB1 table. This table will contain two columns. The user_value column is of the data type varchar2, and the date_recorded column is of the data type timestamp. Later, Sheila will use this table to record audit information when the salary column in the EMPLOYEES table changes.&lt;br /&gt;&lt;br /&gt;Watch Sheila create the table AUDIT_RECORD_TB1 by using the SQL CREATE statement.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-2834135668688687860?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/2834135668688687860/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-tables-using-sql.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2834135668688687860'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/2834135668688687860'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-tables-using-sql.html' title='Creating Tables Using SQL'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-4123316964427082550</id><published>2010-01-31T21:45:00.001-08:00</published><updated>2010-01-31T21:45:59.461-08:00</updated><title type='text'>Creating Tables by Using the Object Browser</title><content type='html'>Sheila needs to create the DEPENDENTS table, which will contain the following columns: Id, FirstName, LastName, BirthDate, Relation, Gender, Benefits, and RelativeId.&lt;br /&gt;&lt;br /&gt;In the DEPENDENTS table, no two rows have the same ID. The Gender column holds only one value of M or F. Also, the Benefits column stores large blocks of character data.&lt;br /&gt;&lt;br /&gt;Watch Sheila create the DEPENDENTS table using the Object Browser.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-4123316964427082550?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/4123316964427082550/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-tables-by-using-object-browser.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4123316964427082550'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4123316964427082550'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-tables-by-using-object-browser.html' title='Creating Tables by Using the Object Browser'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-8051527865804674029</id><published>2010-01-31T21:44:00.000-08:00</published><updated>2010-01-31T21:45:16.216-08:00</updated><title type='text'>Creating Tables</title><content type='html'>You create tables with the SQL CREATE TABLE statement. With Oracle Database XE, you have two options for creating tables.&lt;br /&gt;&lt;br /&gt;    * Use the graphical interface that generates the SQL statement&lt;br /&gt;    * Enter the CREATE TABLE statement in the SQL Workshop tool&lt;br /&gt;&lt;br /&gt;When creating tables, you must provide:&lt;br /&gt;&lt;br /&gt;    * Table name&lt;br /&gt;    * Column name(s)&lt;br /&gt;    * Data types for each column&lt;br /&gt;&lt;br /&gt;Guidelines for creating tables:&lt;br /&gt;&lt;br /&gt;    * Table and column naming rules&lt;br /&gt;&lt;br /&gt;      Must start with a letter, which is followed by a sequence of letters, numbers, _, #, or $&lt;br /&gt;&lt;br /&gt;      Must be 1 to 30 characters long&lt;br /&gt;&lt;br /&gt;      Must not be an Oracle server reserved password&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;    * Most common data types&lt;br /&gt;&lt;br /&gt;      VARCHAR2&lt;br /&gt;      NUMBER&lt;br /&gt;      DATE&lt;br /&gt;      TIMESTAMP&lt;br /&gt;      CHAR&lt;br /&gt;&lt;br /&gt;       &lt;br /&gt;&lt;br /&gt;You can also set up constraints on your columns to control the data in them.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-8051527865804674029?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/8051527865804674029/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-tables.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/8051527865804674029'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/8051527865804674029'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/creating-tables.html' title='Creating Tables'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-4184451917983942909</id><published>2010-01-31T21:40:00.000-08:00</published><updated>2010-01-31T21:44:11.710-08:00</updated><title type='text'>Working with Database Objects</title><content type='html'>Oracle Database XE provides an organized mechanism for storing, managing, and retrieving information.Tables are the basic storage structure for holding business data. In this module, you learn how to create tables and work with them.&lt;br /&gt;&lt;br /&gt;You may want to modify data entered in tables. You may also want to maintain integrity with the data. Sometimes, you may want to remove tables that are no longer useful.&lt;br /&gt;&lt;br /&gt;Now that Sheila has the Oracle Database XE software installed and working, and has familiarized herself with the tables in the HR schema, her next task is to build some tables and database objects. In the demonstrations, you watch Sheila create and modify tables, manage constraints, and remove tables.&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-4184451917983942909?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/4184451917983942909/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/working-with-database-objects.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4184451917983942909'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4184451917983942909'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/working-with-database-objects.html' title='Working with Database Objects'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-5872602573525042048</id><published>2010-01-27T12:11:00.000-08:00</published><updated>2010-01-27T12:13:47.249-08:00</updated><title type='text'>Relational data base</title><content type='html'>&lt;strong&gt;What Is a Relational Database?&lt;/strong&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;The concept of a relational  database was originally developed back in 1970 by Dr. E.F. Codd. He&lt;br /&gt;laid  down the theory of relational databases in his seminal paper entitled  “A Relational Model of&lt;br /&gt;Data for Large Shared Data Banks,” published  in Communications of the ACM (Association for&lt;br /&gt;Computing Machinery),  Vol. 13, No. 6, June 1970.&lt;br /&gt;The basic concepts of a relational  database are fairly easy to understand. A relational database&lt;br /&gt;is a  collection of related information that has been organized into tables.  Each table stores data in&lt;br /&gt;rows; the data is arranged into columns.  The tables are stored in database schemas, which are&lt;br /&gt;areas where  users may store their own tables. A user may grant permissions to other  users so they can access their tables. Most of us are familiar with data  being stored in tables&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;Introducing the Structured Query Language  (SQL)&lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Structured  Query Language (SQL) is the standard language designed to access  relational&lt;br /&gt;databases. SQL should be pronounced as the letters  “S-Q-L.”&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;NOTE&lt;br /&gt;&lt;/strong&gt;“S-Q-L”  is the correct way to pronounce SQL according to the American National  Standards Institute. However, the single word “sequel” is frequently  used instead.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;SQL  is based on the groundbreaking work of Dr. E.F. Codd, with the first  implementation of&lt;br /&gt;SQL being developed by IBM in the mid-1970s. IBM  was conducting a research project known as System R, and SQL was born  from that project. Later, in 1979, a company then known as Relational  Software Inc. (known today as Oracle Corporation) released the first  commercial version of SQL. SQL is now fully standardized and recognized  by the American National Standards Institute. SQL uses a simple syntax  that is easy to learn and use. You’ll see some simple examples of its  use in this chapter. There are five types of SQL statements, outlined in  the following list:&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Query statements  retrieve rows stored in database tables. You write a query using the&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;SQL SELECT statement.&lt;br /&gt;Data Manipulation  Language (DML)&lt;/strong&gt; statements modify the contents of tables. There  are&lt;br /&gt;three DML statements:&lt;br /&gt;INSERT adds rows to a table.&lt;br /&gt;UPDATE  changes rows.&lt;br /&gt;DELETE removes rows.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;Data  Definition Language (DDL)&lt;/strong&gt; statements define the data  structures, such as tables,&lt;br /&gt;that make up a database. There are five  basic types of DDL statements:&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;CREATE&lt;/strong&gt;  creates a database structure. For example, CREATE TABLE is used to  create&lt;br /&gt;a table; another example is CREATE USER, which is used to  create a database user.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;ALTER&lt;/strong&gt;  modifies a database structure. For example, ALTER TABLE is used to  modify&lt;br /&gt;a table.&lt;br /&gt;&lt;script type="text/javascript"&gt;&lt;!--&lt;br /&gt;google_ad_client="pub-1854160677420698";&lt;br /&gt;google_ad_host="pub-1556223355139109";&lt;br /&gt;google_ad_host_channel="00000";&lt;br /&gt;google_alternate_ad_url="http://www.blogger.com/img/blogger_ad160x600.html";&lt;br /&gt;google_ad_width=160;&lt;br /&gt;google_ad_height=600;&lt;br /&gt;google_ad_format="160x600_as";&lt;br /&gt;google_ad_type="text_image";&lt;br /&gt;google_color_border="FFFFFF";&lt;br /&gt;google_color_bg="FFFFFF";&lt;br /&gt;google_color_link="999999";&lt;br /&gt;google_color_url="5588AA";&lt;br /&gt;google_color_text="666666";&lt;br /&gt;//--&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="text/javascript"&lt;br /&gt;  src="http://pagead2.googlesyndication.com/pagead/show_ads.js"&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;TRUNCATE&lt;/strong&gt; deletes  all the rows from a table.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-5872602573525042048?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/5872602573525042048/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2010/01/relational-data-base.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5872602573525042048'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/5872602573525042048'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2010/01/relational-data-base.html' title='Relational data base'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7977557133803461700.post-4397625199118374961</id><published>2009-03-21T14:15:00.000-07:00</published><updated>2010-01-27T11:55:35.977-08:00</updated><title type='text'>What Is a Relational Database</title><content type='html'>&lt;div align="justify"&gt;&lt;!-- Kontera ContentLink(TM);--&gt;&lt;br /&gt;&lt;script type="'text/javascript'"&gt;&lt;br /&gt;var dc_AdLinkColor = 'blue' ;&lt;br /&gt;var dc_PublisherID = 129804 ;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;script type="'text/javascript'" src="'http://kona.kontera.com/javascript/lib/KonaLibInline.js'"&gt;&lt;br /&gt;&lt;/script&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;strong&gt;What Is a Relational Database?&lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;The concept of a relational database was originally developed back in 1970 by Dr. E.F. Codd. He&lt;br /&gt;laid down the theory of relational databases in his seminal paper entitled “A Relational Model of&lt;br /&gt;Data for Large Shared Data Banks,” published in Communications of the ACM (Association for&lt;br /&gt;Computing Machinery), Vol. 13, No. 6, June 1970.&lt;br /&gt;The basic concepts of a relational database are fairly easy to understand. A relational database&lt;br /&gt;is a collection of related information that has been organized into tables. Each table stores data in&lt;br /&gt;rows; the data is arranged into columns. The tables are stored in database schemas, which are&lt;br /&gt;areas where users may store their own tables. A user may grant permissions to other users so they can access their tables. Most of us are familiar with data being stored in tables&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;Introducing the Structured Query Language (SQL)&lt;/strong&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;&lt;/strong&gt;&lt;br /&gt;Structured Query Language (SQL) is the standard language designed to access relational&lt;br /&gt;databases. SQL should be pronounced as the letters “S-Q-L.”&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;NOTE&lt;br /&gt;&lt;/strong&gt;“S-Q-L” is the correct way to pronounce SQL according to the American National Standards Institute. However, the single word “sequel” is frequently used instead.&lt;/div&gt;&lt;div align="justify"&gt; &lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;SQL is based on the groundbreaking work of Dr. E.F. Codd, with the first implementation of&lt;br /&gt;SQL being developed by IBM in the mid-1970s. IBM was conducting a research project known as System R, and SQL was born from that project. Later, in 1979, a company then known as Relational Software Inc. (known today as Oracle Corporation) released the first commercial version of SQL. SQL is now fully standardized and recognized by the American National Standards Institute. SQL uses a simple syntax that is easy to learn and use. You’ll see some simple examples of its use in this chapter. There are five types of SQL statements, outlined in the following list:&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;Query statements retrieve rows stored in database tables. You write a query using the&lt;br /&gt;&lt;/div&gt;&lt;div align="justify"&gt;&lt;strong&gt;SQL SELECT statement.&lt;br /&gt;Data Manipulation Language (DML)&lt;/strong&gt; statements modify the contents of tables. There are&lt;br /&gt;three DML statements:&lt;br /&gt;INSERT adds rows to a table.&lt;br /&gt;UPDATE changes rows.&lt;br /&gt;DELETE removes rows.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;Data Definition Language (DDL)&lt;/strong&gt; statements define the data structures, such as tables,&lt;br /&gt;that make up a database. There are five basic types of DDL statements:&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;CREATE&lt;/strong&gt; creates a database structure. For example, CREATE TABLE is used to create&lt;br /&gt;a table; another example is CREATE USER, which is used to create a database user.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;ALTER&lt;/strong&gt; modifies a database structure. For example, ALTER TABLE is used to modify&lt;br /&gt;a table.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;DROP&lt;/strong&gt; removes a database structure. For example, DROP TABLE is used to remove a&lt;br /&gt;table.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;RENAME&lt;/strong&gt; changes the name of a table.&lt;/div&gt;&lt;div align="justify"&gt;&lt;br /&gt;&lt;strong&gt;TRUNCATE&lt;/strong&gt; deletes all the rows from a table.&lt;/div&gt;&lt;div class="blogger-post-footer"&gt;&lt;img width='1' height='1' src='https://blogger.googleusercontent.com/tracker/7977557133803461700-4397625199118374961?l=skyniazi.blogspot.com' alt='' /&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://skyniazi.blogspot.com/feeds/4397625199118374961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://skyniazi.blogspot.com/2009/03/skyniazi.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4397625199118374961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7977557133803461700/posts/default/4397625199118374961'/><link rel='alternate' type='text/html' href='http://skyniazi.blogspot.com/2009/03/skyniazi.html' title='What Is a Relational Database'/><author><name>Abdul Majid Niazi</name><uri>http://www.blogger.com/profile/01765866226308641170</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='http://img2.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>
