How to write the conditional statements about SQL database information and additions and deletions? Example

Source: Internet
Author: User
This article is mainly for you to summarize the introduction of database additions and deletions to change the statement. Everyone should know that SQL is the standard computer language for accessing and working with databases. What is its main function?
You can query a database, insert data into a database, update data in a database, delete data from a database, and add data databases to a database.
(Database) is a warehouse that organizes, stores, and manages data in accordance with its data structure, and with the development of information technology and markets, data management is no longer just a storage management data, but a variety of data management methods that users need.
The following is an example of SQL statement additions and deletions:
One, SQL commonly added add and delete changes: INSERT into Data table (field 1, Field 2, Field 3) VALUES (value 1, value 2, value 3)

String sql= "INSERT into employees (Id,username,age) VALUES (22,2,2)";

The deletion of SQL statements and deletions: Delete from data table where id= received ID parameter

String sql2= "Delete from employees where id=22";

Third, the SQL table additions and deletions modified: Update data Table set field 1= value 1, field 2= value 2 where id= received ID parameter

String sql3= "Update employees set Username= ' Zhang ', age= ' 2222 ' where id=1";

Iv. Inquiries

String sql4= "SELECT * FROM Employees where id=1";
Related Article

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.