drop table t_group;
drop table t_user;
create table t_group
(
id integer,
primary key (id)
);
create table t_user
(
id integer,
name text,
groupId integer,
primary key(id),
foreign key (groupId) references t_group(id) on delete cascade on update cascade
);
insert into t_group values(1);
insert into t_group values(2);
insert into t_user values(1,"j",2);
insert into t_user values(2,"a",3);
本文介绍了使用SQL命令创建和删除数据库表的过程,并详细展示了如何使用CREATE TABLE和DROP TABLE语句来实现表的创建和删除操作。同时,通过示例展示了如何在表中插入数据。
625





