一、基础
1.创建表
2.date列定义
3.修改表
4.外键
5.修改表
6.delete 与truncate的区别
二、DQL查询数据(重点)
1.null ,not null
2. 七种联合查询
1.inner join
一般使用inner join
3、分页
4.子查询
三、常用函数
1.常用函数(并不常用)
2.聚合函数 (常用)
四、事务
要么都成功,要么都失败
五、索引
学习文章:http://blog.codinglabs.org/articles/theory-of-mysql-index.html
1.索引
2.基础语法
3.索引的原则
4.索引的数据结构
1.Hash类型的
2.Btree: innoDB的默认数据结构
六、导入导出和存储过程
七、权限管理
八、三大范式
九、JDBC
public class MyJdbcDemo {
public static void main(String[] args) throws Exception {
//1.加载驱动
Class.forName("com.mysql.jdbc.Driver");
//2.url和用户信息
String url = "jdbc:mysql://localhost:3306/enfei?useUnicode=true&&characterEncoding=utf-8&&useSSL=true";
String username = "root";
String psd ="123456";
//3.创建连接数据库对象
Connection connection = DriverManager.getConnection(url,username,psd);
//4.执行SQL的对象 Statement (执行SQL的对象)
Statement statement = connection.createStatement();
//5.执行SQL
String sql = "select * from users;";
ResultSet resultSet = statement.executeQuery(sql);
while(resultSet.next()){
System.out.println("name:"+resultSet.getObject("name"));
System.out.println("age:"+resultSet.getObject("age"));
System.out.println("============");
}
//6.释放连接
resultSet.close();
statement.cancel();
connection.close();
}
}