SQL tutorials

You are currently browsing the articles from Techno Oracle matching the category SQL tutorials.

Pseudocolumns in SQL

Pseudocolumns are not really columns in a table; they just have characteristics of columns. These pseudocolumns will return values when referenced just like real table columns. However, you cannot do any other DML or DDL statements on these pseudocolumns. Pseudocolumns are primarily used to give the programmer more tools to use in his code. They [...]

Written by admin on December 18th, 2010 with comments disabled.
Read more articles on SQL tutorials.

Inline view in SQL

An inline view is a statement in the FROM-clause of another SELECT statement. In-line views are commonly used simplify complex queries by removing join operations and condensing several separate queries into a single query. This feature was introduced in Oracle 7.2.An example of inline view is given blow SELECT * FROM (select dept_no, count(*) emp_count [...]

Written by admin on November 8th, 2010 with no comments.
Read more articles on SQL tutorials.

ROWNUM in SQL

The ROWNUM  pseudo column returns the row number of the record.  This is a logical number, determined at the time a query is run. As such, a delete or insert can cause a different ROWNUM assignment. Row numbers do not stick to a particular record, so never rely on them as you would a physical [...]

Written by admin on November 4th, 2010 with no comments.
Read more articles on SQL tutorials.

Primary Key in Sql

The primary key of a relational table Primarily identifies each record in the table. It can either be a normal attribute that is guaranteed to be Primary (such as Social Security Number) or it can be generated by the Database Primary keys may consist of a single attribute or multiple attributes in combination. A primary [...]

Written by admin on October 7th, 2010 with no comments.
Read more articles on SQL tutorials.

ADD_MONTHS function in sql

ADD_MONTHS adds n number of calendar months to date.The date argument can be a datetime value or any value that can be implicitly converted to DATE. The value of n must be an integer and can be negative.ADD_MONTHS return a value of DATE data type Syntax ——– ADD_MONTHS(date, n) Example 1: SELECT ADD_MONTHS (’11-JAN-10′,6) FROM [...]

Written by admin on October 5th, 2010 with no comments.
Read more articles on SQL tutorials.

MONTHS_BETWEEN Function in sql

MONTHS_BETWEEN finds the number of months between two dates, date1 and date2.MONTHS_BETWEEN,  returns a numeric value.The result can be positive or negative. If date1 is later than date2, the result is positive; if date1 is earlier than date2, the result is negative. The non integer part of the result represents a portion of the month. [...]

Written by admin on October 4th, 2010 with no comments.
Read more articles on SQL tutorials.

Run SQL statements in a batch

To run SQL commands in a batch, you can put all your SQL commands into a text file and execute these commands in this file in SQL*PLUS. >>Use your favorite editor to type in your SQL queries into a text file. For example, >>use notepad in windows >>Type the commands and save it with .sql [...]

Written by admin on August 5th, 2010 with no comments.
Read more articles on SQL tutorials.

Spool Output to a File in SQL * Plus

You can use the SPOOL filename command to save the query results to a file. By default, the SPOOL command creates a .lst file. SPOOL OFF stops the writing of output to the file. SPOOL OUT stops the writing of output and sends the output file to the printer. You can record your SQL command [...]

Written by admin on August 4th, 2010 with no comments.
Read more articles on SQL tutorials.

SQL * Plus Editing Commands

For editing  SQL Buffer,Use the SQL*Plus editing commands. You can make changes, delete lines, and add and list the buffer using these commands. Most editing commands operate on the current line. You can change the current line simply by typing the line number. The following table  shows the editing commands in SQL*Plus. Command Purpose Example [...]

Written by admin on August 3rd, 2010 with no comments.
Read more articles on SQL tutorials.

Introduction to SQL

SQL stands for Structured Query Language.SQL is a standard computer language for accessing and manipulating databases. SQL is short for Structured Query Language and is a widely used database language, providing means of data manipulation (store, retrieve, update, delete) and database creation.SQL can execute queries,can retrieve data,insert,delete or update records in a database. SQL is [...]

Written by admin on July 15th, 2010 with 3 comments.
Read more articles on SQL tutorials.