SQL学习笔记二 创建表、插入数据的语句
程序员文章站
2023-12-15 21:41:58
创建一个表t_employee并插入若干数据 复制代码 代码如下: create table t_employee(fnumber varchar(20),fname va...
创建一个表t_employee并插入若干数据
create table t_employee(fnumber varchar(20),fname varchar(20),fage int,fsalary numeric(10,2) ,primary key(fnumber));
insert into t_employee(fnumber,fname,fage,fsalary) values('dev001','tom',25,8300);
insert into t_employee(fnumber,fname,fage,fsalary) values('dev002','jerry',28,2300.80);
insert into t_employee(fnumber,fname,fage,fsalary) values('sales001','john',23,5000);
insert into t_employee(fnumber,fname,fage,fsalary) values('sales002','kerry',28,6200);
insert into t_employee(fnumber,fname,fage,fsalary) values('sales003','stone',22,1200);
insert into t_employee(fnumber,fname,fage,fsalary) values('hr001','jane',23,2200.88);
insert into t_employee(fnumber,fname,fage,fsalary) values('hr002','tina',25,5200.36);
insert into t_employee(fnumber,fname,fage,fsalary) values('it001','smith',28,3900);
insert into t_employee(fnumber,fage,fsalary) values('it002',27,2800);
大家可以查找下 create与insert命令的使用。
复制代码 代码如下:
create table t_employee(fnumber varchar(20),fname varchar(20),fage int,fsalary numeric(10,2) ,primary key(fnumber));
insert into t_employee(fnumber,fname,fage,fsalary) values('dev001','tom',25,8300);
insert into t_employee(fnumber,fname,fage,fsalary) values('dev002','jerry',28,2300.80);
insert into t_employee(fnumber,fname,fage,fsalary) values('sales001','john',23,5000);
insert into t_employee(fnumber,fname,fage,fsalary) values('sales002','kerry',28,6200);
insert into t_employee(fnumber,fname,fage,fsalary) values('sales003','stone',22,1200);
insert into t_employee(fnumber,fname,fage,fsalary) values('hr001','jane',23,2200.88);
insert into t_employee(fnumber,fname,fage,fsalary) values('hr002','tina',25,5200.36);
insert into t_employee(fnumber,fname,fage,fsalary) values('it001','smith',28,3900);
insert into t_employee(fnumber,fage,fsalary) values('it002',27,2800);
大家可以查找下 create与insert命令的使用。