Familiar with OracleSQL

Source: Internet
Author: User
SQL is an advanced non-procedural query language. You can use it to perform database operations and regard SQL as a tool for communication between the client and the server.

SQL is an advanced non-procedural query language. You can use it to perform database operations and regard SQL as a tool for communication between the client and the server.

SQL is an advanced non-procedural query language. You can use it to perform database operations.

The SQL language can be seen as a tool for communication between the client and the server to access, query, and update relational database systems.

Insert statement

The syntax structure of the INSERT statement is as follows:

The table Value refers to the name of the table to be inserted, Column refers to the name of the Column to be inserted, and Value refers to the specific data Value to be inserted.

For example, to insert a new member data into the member table, you can add it as follows:

The advantage of the former is that you can specify which fields to add data. The disadvantage is that the field names in parentheses after the table names must be compared with the Value values.

The latter has the advantage of being easy to write, but has the disadvantage of assigning values to all fields in the Value.

When a data packet needs to be inserted with NULL values, the first method is generally used, while the second method needs to be filled with the NULL keyword for insertion.

If the inserted data contains the time and the time is the current time,

If the insert time is a specific time, we can modify the preceding statement as follows:

All the preceding operations are single-row data, while the following operations are multi-row data.

An example of inserting multiple rows of data is as follows:

UPDATE statement

The UPDATE statement structure is as follows:

For example, Initialize all member passwords:

Conditional update:

When performing the update operation, the WHERE condition generally selects a field with unique constraints such as the primary key, unless in special circumstances,

Otherwise, unexpected misoperations may occur. For example, it is very dangerous to update a user table with name as the condition,

Because the names can be repeated.

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.