Oracle Foundation Note One

Source: Internet
Author: User

1. Basic SELECT Statement


1. Basic SELECT Statement

Select identifies which columns are selected.

From identifies the table from which to select.


Attention:

SQL language is not case sensitive.

SQL can be written in one line or multiple lines

Keywords cannot be abbreviated or branch

The clauses are usually written in branches.

Use indentation to improve the readability of the statement.


2. Arithmetic operators (+-*/)

The arithmetic operator used for numbers and dates.


Operator Precedence:

Multiplication priority is higher than plus and minus.

The same precedence operator executes from left to right.

The operations in parentheses are performed first.


3. Define NULL values

Null value is not valid, unspecified, unknown, or unpredictable value

Null value is not a space or 0.


Use of null values in mathematical operations: null values for mathematical expressions that contain null values


4. Aliases for columns:

Renames a column.

Easy to calculate.

Immediately following the column name, you can also add the keyword ' as ' between the column name and the alias, using double quotation marks to include spaces or special characters in the alias and case sensitivity.


5. Connector:

Concatenate columns and columns with characters.

Use ' | | ' Said.

can be used to ' synthesize ' columns.


6. String:

The string can be a character, a number, a date in the SELECT list.

Dates and characters can only appear in single quotation marks.

Each time a row is returned, the string is output once.


7. Delete duplicate rows: Using the DISTINCT keyword


8.SQL Statements and Sql*plus commands

Sql

A language

ANSI Standard

Keywords cannot be abbreviated

Use statements to control the definition information of tables in a database and the data in a table


Sql*plus

An environment

One of the features of Oracle

Keywords can be abbreviated

Command cannot change the value of data in a database

Centralized operation


8. Show Table structure: Use the DESCRIBE command to represent the table structure


9.DUAL is a ' pseudo-table ' that can be used to test functions and expressions




This article from the "Ah Cheng Blog" blog, reproduced please contact the author!

Oracle Foundation Note One

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.