Cheap VPS host selection
Provide server host evaluation information

Examples of basic statements for database addition, deletion, modification and query

The following are examples of basic statements commonly used in databases, including INSERT, DELETE, UPDATE, and SELECT:

  1. Add data (INSERT):
 INSERT  INTO table_name (column1, column2, ...) VALUES (value1, value2, ...);

Example:

 INSERT  INTO employees (first_name, last_name, salary) VALUES ( 'John' , 'Doe' , five thousand );
  1. Delete data:
 DELETE  FROM table_name WHERE  condition ;

Example:

 DELETE  FROM employees WHERE id =  one ;
  1. Modify data (UPDATE):
 UPDATE table_name SET column1 = value1, column2 = value2, ... WHERE  condition ;

Example:

 UPDATE employees SET salary =  six thousand
 WHERE id =  one ;
  1. Query data (SELECT):
 SELECT column1, column2, ... FROM table_name WHERE  condition ;

Example:

 SELECT first_name, last_name, salary FROM employees WHERE department =  'IT' ;

Please note that the table names, column names and conditions in the above examples need to be replaced and adjusted according to the actual situation. In addition, there are other more complex and advanced uses of SQL statements. Only basic syntax examples are provided here.

Do not reprint without permission: Cheap VPS evaluation » Examples of basic statements for database addition, deletion, modification and query