navicat使用sql语句
时间: 2023-11-21 11:33:25 浏览: 91
Navicat for SQL
1. 创建表格:
CREATE TABLE table_name (
column1 datatype,
column2 datatype,
column3 datatype,
....
);
2. 插入数据:
INSERT INTO table_name (column1, column2, column3, ...)
VALUES (value1, value2, value3, ...);
3. 修改数据:
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
4. 删除数据:
DELETE FROM table_name
WHERE condition;
5. 查询数据:
SELECT column1, column2, ...
FROM table_name
WHERE condition;
6. 排序数据:
SELECT column1, column2, ...
FROM table_name
ORDER BY column1 DESC, column2 ASC;
7. 分组数据:
SELECT column1, COUNT(column2)
FROM table_name
GROUP BY column1;
8. 连接数据:
SELECT column1, column2, ...
FROM table_name1
INNER JOIN table_name2 ON condition;
9. 子查询:
SELECT column1, column2, ...
FROM table_name
WHERE column1 IN (SELECT column1 FROM table_name WHERE condition);
阅读全文