周记二

作者: Cathy_cheng | 来源:发表于2017-03-20 20:15 被阅读0次

    周一:今天学了继承和多态,继承有public继承、protected继承、private继承,多态和虚函数一对,抽象类和纯虚函数一对,还有友元。

    周二:今天学到一饿特别酷的c语法:ch = "0123456789ABCDEF"[tmp];ch是一个char型的变量,tmp是一个int型的变量,先初始化ch的范围,根据tmp的值确定ch的值。

    今天学习了运算符的重载,可以使除“. , :: , * , -> , ?=”5个运算符之外的运算符进行重载。对于模版,个人认为是对STL的初步了解,若是能够熟悉模版,就能理解STL的调用。顺序容器和关联容器都会涉及迭代器,for (vector::const_iterator p = c.begin(); p < c.end(); p++)  or    for(int i = 0; i < c->size(); i++) 两种循环进行遍历

    周三:今天内容很多,没时间写小结,作业还没做完………

    周四:今天学习了mysql,首先要说的是安装mysql:sudo apt-get install mysql-server。在安装过程中会有安装错误,需要卸载重装,此刻需要sudo apt-get autoremove --purge mysql-server-5.5,然后dpkg -l |grep ^rc|awk '{print $2}' |sudo xargs dpkg -P,此操作是为了清除所有残留数据。

    总结一下今天学到的内容:

    1、 mysql -u root -p

    2、显示所有数据库:show databases;

    3、显示默认数据库中所有表:show tables;

    4、退出mysql程序:\q;

    5、create database if not exists student;

    6、show databases like 'stu%';如果关键字stu在中间,使'%stu%'的形式来查找

    7、use student;

    8、 drop database if exists student;

    -------------------------------------

    9、create table class(id int ,name varchar(11),..

    10、show columns from student; ==  desc student;显示表格初始化信息

    11、增加列:alter table student add age int;

           修改列:alter table student modify age int not null;

            删除列:alter table student drop weight;       似14

    12、insert into student(id, name,age)value(1,"aa",10);

           insert student set id =9;

    13、查询表格的详细信息:

                         select * from student where id=1;

                       select age, name from student;

                      select * from student order by id desc(降序)/asc(升序);

                     select name from student group by name;(统计数量,重复的不算)

    多表查询********* select t1.name as t1name, t1.age as t1age, t2.name as t2name, t2.age as t2age from test01_01 as t1, test01_03 as t2 where t1.name = t2.name;

    14、 修改数据:update student set name="tom" where id=2;

    15、delete from student where id=9;

    周五:

    今天学习了mysql的一些函数调用,并且自己写了一个注册登录的小demo,今天老师已经布置了下周项目的要求,分析了一下,此刻的我感觉不简单。但是从以往经验来看,到下一周什么都会over了……

    相关文章

      网友评论

          本文标题:周记二

          本文链接:https://www.haomeiwen.com/subject/jeminttx.html