码迷,mamicode.com
首页 > 数据库 > 详细

数据库

时间:2015-09-16 21:39:33      阅读:164      评论:0      收藏:0      [点我收藏+]

标签:

SQL语句

创建表

create table if not exists Teacher (tea_id integer primary key autoincrement, tea_name text, tea_gender text, tea_age integer, tea_salary text)

插入数据

insert into Teacher (tea_id, tea_name, tea_gender, tea_age, tea_salary) values (38, ‘豪豪‘, ‘男‘, 38, ‘250’)

insert into Teacher (tea_name, tea_gender, tea_age, tea_salary) values (‘大神‘, ‘男‘, 38, ‘250’)

查询所有数据

select * from teacher

查询 姓名, 性别

select tea_name, tea_gender from teacher

条件查找

select * from teacher where tea_name = ‘豪豪’

更新数据

update Teacher set tea_gender = ‘女‘ where tea_name = ‘豪豪’

删除

drop table teacher

delete from teacher where tea_id = 38;

 

数据库

标签:

原文地址:http://www.cnblogs.com/tapple/p/4814380.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!