0% found this document useful (0 votes)
29 views2 pages

PL SQLtutorial

The document discusses dual tables, logical operators, null values, and transactions in Oracle SQL. It defines dual as a table with one column for testing queries, lists logical operators AND, OR, and NOT, and explains that null values represent unknown values unlike blank strings. It also notes that transactions commit permanent changes or rollback to undo changes.

Uploaded by

4madhu4
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
29 views2 pages

PL SQLtutorial

The document discusses dual tables, logical operators, null values, and transactions in Oracle SQL. It defines dual as a table with one column for testing queries, lists logical operators AND, OR, and NOT, and explains that null values represent unknown values unlike blank strings. It also notes that transactions commit permanent changes or rollback to undo changes.

Uploaded by

4madhu4
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 2

1.

1Dual Table

1. dual is a table that contains a single row.


2. The dual table has one VARCHAR2 column named dummy.
3. dual contains a single row with the value X.

NOTE: A transaction is a sequence of SQL statements that Oracle treats as a single unit
of work. A transaction ends when you disconnect from the database, or when you issue a
COMMIT or ROLLBACK command.

COMMIT makes permanent any database changes you made during the current
transaction. Until you commit your changes, other users cannot see them. ROLLBACK ends
the current transaction and undoes any changes made since the transaction began.

1. 2 Using the Logical Operators

1. There are three logical operators that may be used in a WHERE clause.
2. The logical operators allow you to limit rows based on logical conditions.
3. The logical operators are listed in the following table:

Operator Description
x AND y Returns true when both x and y are true
x OR y Returns true when either x or y is true
NOT x Returns true if x is false, and returns false if x is true

NOTE:If you combine AND and OR in the same expression, the AND operator takes
precedence over the OR operator.The comparison operators take precedence over
AND.You can override these using parentheses.

1.3 Understanding Null Values

1. A database use null value to represent a unknown value.


2. A null value is not a blank string.
3. A null value means the value for the column is unknown.
4. When you select a column that contains a null value, you see nothing in that
column.

Q: How do you tell the difference between a null value and a blank string if you retrieve
all the rows?

The answer is to use one of Oracle's built-in functions: NVL().NVL() allows you to
convert a null value into another valueNVL() accepts two parameters: a column, and the
value that should be substituted.

You might also like