Home > Database > Mysql Tutorial > body text

SQL学习笔记二 创建表、插入数据的语句

WBOY
Release: 2016-06-07 18:02:12
Original
1112 people have browsed it

SQL学习笔记二 创建表、插入数据的语句,需要的朋友可以参考下。

创建一个表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命令的使用。
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!