创建一个表:create table if not exists Teachaers(tea_id integer  primary key autoincrement,tea_name text,tea_gender text,tea_age interger,tea_salary text)

primary key  主键

create table if not exists Teachaers(tea_id integer  primary key autoincrement,tea_name text,tea_gender text,tea_age interger,tea_salary text)primary key  主键  区分每一条数据,因此在开发中主键的值是唯一的,不同意有同样的两个值存在.  autoincrement自增   修饰的属性值在每一次数据添加时值就会自己主动添加一.

插入数据:insert into Teachaers(tea_name ,tea_gender,tea_age,tea_salary)values("xx","x",20,xxxx)

查询数据

查询全部的数据:select * from Teachaers

查询某一条数据:select * from Teachaers where tea_id = 2

查询多个条件的数据:select * from Teachaers where tea_gender = "女" and tea_age = 25

查询部分数据:select tea_name ,tea_salary from Teachaers  where tea_id = 2

删除表中某一个元素:delete from Teachaers where tea_id = 2

更新数据库某一条的某一个部分

update Teachaers set tea_name = "蔡cai" ,tea_age =27  where tea_salary = 130000

删除表格

drop table 表名

创建SQL语句_面试的更多相关文章

  1. C#与数据库访问技术总结(六)之Command对象创建SQl语句代码示例

    Command对象创建SQl语句代码示例 说明:前面介绍了 Command 对象的方法和一些属性,回顾一下 Command对象主要用来执行SQL语句.利用Command对象,可以查询数据和修改数据. ...

  2. MySQL workbench8.0 CE基本用法(创建数据库、创建表、创建用户、设置用户权限、创建SQL语句脚本)

    原文地址:https://blog.csdn.net/zgcr654321/article/details/82156277 安装完成MySQL后,打开MySQL workbench8.0. 可以看到 ...

  3. sql语句_分页查询

    1.查询数据库中存在某一列名的表 use [db] go SELECT name FROM sysobjects WHERE id IN (SELECT id FROM syscolumns WHER ...

  4. sql语句_统计总成绩最高的前2名

    有一个数据表,id user_id score 三个字段,计算总成绩最高的前两名 SELECT * FROM (SELECT user_name,SUM(score) AS score FROM us ...

  5. Java数据持久层框架 MyBatis之API学习九(SQL语句构建器详解)

    对于MyBatis的学习而言,最好去MyBatis的官方文档:http://www.mybatis.org/mybatis-3/zh/index.html 对于语言的学习而言,马上上手去编程,多多练习 ...

  6. SQL查询刚開始学习的人指南读书笔记(二)创建SQL查询

    PARTII: SQL Basics CHAPTER 4Creating a Simple Query 介绍一种怎样创建SQL语句的技术--"Request/Translation/Clea ...

  7. Mybatis——SQL语句构建器类

    SQL语句构建器类 问题 Java程序员面对的最痛苦的事情之一就是在Java代码中嵌入SQL语句.这么来做通常是由于SQL语句需要动态来生成-否则可以将它们放到外部文件或者存储过程中.正如你已经看到的 ...

  8. 产生sql语句的vba

    //清除空列 Sub ClearNullMacro1() Dim j As Integer Dim colCount As Integer colCount = Cells(2, Columns.Co ...

  9. Mybatis学习--Sql语句构建器

    学习笔记,选自Mybatis官方中文文档:http://www.mybatis.org/mybatis-3/zh/statement-builders.html 问题 Java程序员面对的最痛苦的事情 ...

随机推荐

  1. Correlation and Regression

    Correlation and Regression Sample Covariance The covariance between two random variables is a statis ...

  2. .NET Garbage-Collectors

    http://mattwarren.org/tags/#Garbage-Collectors https://github.com/dotnet/coreclr/issues https://lldb ...

  3. Disk performance

    http://blogs.msdn.com/b/ntdebugging/archive/2014/12/09/disk-performance-internals.aspx http://blogs. ...

  4. mysql show variables

    1. back_log 指定MySQL可能的连接数量.当MySQL主线程在很短的时间内得到非常多的连接请求,该参数就起作用,之后主线程花些时间(尽管很短)检查连接并且启动一个新线程. back_log ...

  5. ios UITextField文本框基本使用,以及所有代理方法的作用

    /* UITextField文本输入框 */ UITextField * textField = [[UITextField alloc]initWithFrame:CGRectMake(50, 50 ...

  6. DataTable某一列的最大值

    .datatable.compute("max(列名)","") eg:  int max_Idx_Number = 1;     int.TryParse(C ...

  7. 使用System.IO.Combine(string path1, string path2, string path3)四个参数的重载函数提示`System.IO.Path.Combine(string, string, string, string)' is inaccessible due to its protection level

    今天用Unity5.5.1开发提取Assets目录的模块,使用时采用System.IO.Path.Combine(string, string, string, string)函数进行路径生成 明明是 ...

  8. 【Unity笔记】碰撞器(Collision)与触发器(Trigger)的区别

    当碰撞器Collision组件身上的属性IsTrigger勾选为True时,该碰撞器就成了触发器. 区别:1.能够产生的回调和函数不同.碰撞器:MonoBehaviour.OnCollisionEnt ...

  9. 【C#学习笔记】反射的简单用法

    常见的使用反射的场景: 程序在运行时动态地访问类的成员,如获得类的变量.方法. 例如:用反射给本类的变量赋值. public class Student{ public string studentN ...

  10. PKU OJ 1002 487-3279

    PKU OJ 1002 487-3279 487-3279 Description Businesses like to have memorable telephone numbers. One w ...