摘要: 创建临时表只需在table前面加temporary CREATE TEMPORARY TABLE mytable#创建临时表,在断开数据库连接时销毁 ( ID INT NOT NULL, username VARCHAR(16) NOT NULL, index usernameIndex (user 阅读全文
posted @ 2021-08-04 23:20 月长生 阅读(37) 评论(0) 推荐(0)
摘要: 转载https://www.cnblogs.com/battlecry/p/9573858.html 阅读全文
posted @ 2021-08-04 23:20 月长生 阅读(82) 评论(0) 推荐(0)
摘要: 认识事务 事务必须要满足四个条件: 原子性:即事务的执行要么全不做,要么全做,一旦出现错误,就会回滚到最初的状态; 一致性:事务执行要和数据库的规则一样,这样不会破坏数据库的完整性; 隔离性:数据库可以允许多个事务并行,而隔离性可以保护数据不会因为事务的交叉执行而被破坏; 持久性:事务处理结束后,对 阅读全文
posted @ 2021-07-30 10:11 月长生 阅读(41) 评论(0) 推荐(0)
摘要: Alter的使用: 列的增加和删减 alter table users add user_name VARCHAR(100);#添加一列在末尾 SELECT * from users; alter table users drop user_name;#删除一列 SELECT * from user 阅读全文
posted @ 2021-07-30 10:11 月长生 阅读(29) 评论(0) 推荐(0)
摘要: 创建表格 先判断users表是否存在,然后设置user_id为无符号(UNSIGNED)自动增长(AUTO_INCREMENT)的整型 并通过PRIMARY KEY设置user_id为主键 ENGINE是指存储引擎为INNODB CHARSET是指编码格式为utf-8 CREATE TABLE IF 阅读全文
posted @ 2021-07-29 17:23 月长生 阅读(66) 评论(0) 推荐(0)
摘要: 多表连接 左连接:返回第一张表的所有数据项然后拼接第二张表(左表全有,右表对应左表才有) 右连接:返回第二张表的所有数据项然后拼接第一张表(右表全有,左表对应右表才有) 内连接:返回两张表数据相等的数据项(左表和右表都有的数据) SELECT * from classes LEFT JOIN use 阅读全文
posted @ 2021-07-29 15:55 月长生 阅读(65) 评论(0) 推荐(0)
摘要: using System; using System.Collections; namespace 预处理指令 { class Program { static void Main(string[] args) { GetArrayList(); GetStack(); Console.ReadKe 阅读全文
posted @ 2021-07-28 16:36 月长生 阅读(24) 评论(0) 推荐(0)
摘要: using System; namespace AbstractAndVirtual { class Program { static void Main(string[] args) { GetSharp getSharp= new GetSharp(); GetNewSharp getNewSh 阅读全文
posted @ 2021-07-28 16:06 月长生 阅读(19) 评论(0) 推荐(0)
摘要: 多线程 using System; using System.Threading; namespace ThreadTest { class Program { static void Main(string[] args) { Thread th = Thread.CurrentThread; t 阅读全文
posted @ 2021-07-28 14:39 月长生 阅读(21) 评论(0) 推荐(0)
摘要: 事件和委托的关系相当于属性和字段的关系,事件可以说是特殊的委托,下面是事件的简单练习1 using System; namespace EventTest { class Program { static void Main(string[] args) { Test t = new Test(); 阅读全文
posted @ 2021-07-28 10:19 月长生 阅读(29) 评论(0) 推荐(0)