Operator:
Strings are used in single-quote databases where comparisons are used =, not double equals and logical OR or logical not
CRUD Operations
A c:create adds, creates, adds data to the database.
INSERT into Fruit values (' K009 ', ' Apple ', 3.0, ' gaoqing ', 90, ') inserted into the table column
Insert into Fruit (ids,name,price,source,numbers) VALUES (' K010 ', ' Apple ', 3.0, ' gaoqing ', 90)
Two. R:retrieve search, query, query data from the database.
1. Query all select * FROM table names
2. Check the specified column select column name, column name from table name
3. Replace column name Select Ids ' codename ', Name ' name ', ' Price ', Source ' origin ' from Fruit
4. Check the specified line select * from Fruit where ids= ' K006 '
SELECT * from Fruit where price=2.4 and source= ' yantai ' query price is 2.4 and is the origin of Yantai
SELECT * from Fruit where price between 2.0 and 4.0 query prices from 2.0 to 4.0
SELECT * from Fruit where Numbers in (90,80,70) queries all 90,80,70 records
Select*from Fruit ORDER BY numbbers ASC according to numbers ascending order, if not ASC by default in ascending order
Select*from table name order BY column name desc sorted by column name descending
Select COUNT (*) from table name statistics How many data are in this table
Select AVG (column name) from table name to find the average of this column
Select SUM (column name) from the table name to find the sum of this column
Select Max (column name) from table name to find the maximum value of this column
Select min (column name) from table name to find the minimum value of this column
Three. U:update modify the data from the database table.
Update Fruit set source= ' Yantai ' where ids= ' K001 '
Four. D:delete Delete, delete data from the database.
Delete from Fruit where ids= ' K007 '
Transaction: An error has occurred and can be rolled back
Add transaction: Begin Tarn
Rollback: Rollback
CRUD Create, modify, delete, query