- SELECT INTO: 从一个表中选择数据,然后将这些数据插入到另一个表中去。通常用于备份表。
选择所有列:
Syntax:
SELECT *
INTO new_table_name [IN externaldatabase]
FROM old_tablename
Example:
SELECT *
INTO Persons_Backup IN 'Backup.mdb'
FROM Persons
选择若干列:
Syntax:
SELECT column_name(s)
INTO new_table_name [IN externaldatabase]
FROM old_tablename
Example:
SELECT LastName,FirstName
INTO Persons_Backup
FROM Persons
- CREATE DATABASE: 创建数据库
Syntax:
CREATE DATABASE database_name
- CREATE TABLE: 创建表
Syntax:
CREATE TABLE table_name
(
column_name1 data_type,
column_name2 data_type,
column_name3 data_type,
....
)
建好表后,可以通过INSERT INTO语句来向表中添加数据。