分组查询select sex ,count(*) from student group by sex 查询student里面每个性别有多少人 分组查询后筛选 select sex count(*) from student group by sex having 条件 数据约束 默认值 用户对默认值 ...
分类:
数据库 时间:
2020-06-19 11:54:31
阅读次数:
67
1、批量插入 <insert id="insertBatch" parameterType="java.util.List"> insert into t_student(name, age, class) values <foreach collection="list" item="item" ...
分类:
数据库 时间:
2020-06-18 19:33:43
阅读次数:
118
首先创建3个类 1个 Person类 1个Student类 1个Worker类 Person类中 写两个变量 姓名 年龄 写出构造方法 set/get方法 重写toString方法 Student类继承Person类 写出构造方法 Worker类先声明都不写 马重的技术https://movie.d ...
分类:
其他好文 时间:
2020-06-18 12:56:58
阅读次数:
95
模板语法只有两种,变量用 {{ }},标签用{% %} views.py class StudentInfo(View): def get(self, request): class Student(object): def __init__(self, name, age): self.name ...
分类:
其他好文 时间:
2020-06-17 12:40:53
阅读次数:
78
一、对象 1、面向对象简介 面向对象:可以创建自定义的类型,很好的支持继承和多态。 面向对象的特征:封装、继承、多态。 2、对象的概念 在 JavaScript 中,对象是一组无序的相关属性和方法的集合。 对象的作用是:封装信息。比如Student类里可以封装学生的姓名、年龄、成绩等。 对象具有特征 ...
分类:
Web程序 时间:
2020-06-16 12:45:14
阅读次数:
59
import MySQLdb #查询数量 def Count(cur): count=cur.execute('select * from Student') print ('there has %s rows record' % count) #插入 def Insert(cur): sql = ...
分类:
数据库 时间:
2020-06-15 17:54:50
阅读次数:
78
1.请先创建好命名空间 .然后再创建表 . create 'gld:student',{NAME=>'cf1', VERSIONS=>5}, {SPLITS => ['1', '2', '3', '4', '5', '6', '7', '8', '9']} 我这里的namespace是提前创建好了的 ...
分类:
其他好文 时间:
2020-06-15 10:36:55
阅读次数:
87
准备我们需要的表结构和数据 两张表 studnet(学生)表和score(成绩)表, 创建表的SQL语句如下 CREATE TABLE `student` ( `id` int(11) NOT NULL, `no` varchar(20) DEFAULT NULL, `name` varchar(2 ...
分类:
数据库 时间:
2020-06-14 23:52:04
阅读次数:
80
什么是外键,外键能干啥? 什么是外键? 保持数据一致性,完整性,主要目的是控制存储在外键表中的数据。使两张表形成关联,外键只能引用外表中列的值! 外键能干啥? 创建学生表 CREATE TABLE `student` ( `id` int(10) NOT NULL AUTO_INCREMENT, ` ...
分类:
数据库 时间:
2020-06-14 18:43:56
阅读次数:
83
1. Never trouble trouble till trouble troubles you. 麻烦没来找你,就别去自找麻烦。 第一、四个 trouble 是动词,第二、三个 trouble 是名词。 2. I think that that that that that student w ...
分类:
其他好文 时间:
2020-06-14 15:02:42
阅读次数:
78