zoukankan      html  css  js  c++  java
  • mysql

     数据库:                               第一章
                          关系型数据库管理系统简介

    一:使用数据库的特点:1:可以降低储存数据的冗余度  2:提供更高的数据一致性  3:储存数据可以共享  4:便于维护数据的完整性         5:实现数据的安全性 
    二:数据模型: 层次模型  网状模型  关系模型 对象模型
    三:表   是关系数据库的核心单元,他是数据储存的地方。
    四:表之间的关系类型:  一对一关系    一对多关系  多对多关系

    SQL语句分为:

    数据定义语言:(DDL)
    数据查询语言:(DQL)
    数据操作语言:(DML)
    数据控制语言:(DCL)
     
    第二章   管理数据库和表

    接着第二天的继续:
     修改表:
    (create table student)
     复制一张表: create table copy-student select * from student  where 1=1;(同时复制表中的数据)
                           create table copy-student select * from student  where 1=0;(复制表结构 不复制数据)
    添加一列:alter table student add  student_name varchar(20);
    删除列:alter table student drop student_nama;
    修改列:alter table student modify student_name varchar(20);   (modeify 修改 只能修改列的数据类型) 
                 alter table student change student_name student_name varchar(20);     (change 修改  可以修改列名和数据类型  change后两
                                                                                                                                                         个列名 第一个是老列名 第二个新列名  )
    创建一个索引:create index idx_mingzi on student(student_name);
    删除索引:alter table student drop index idx_mingzi;
    查看表结构:describe student;
    视图:select * from  student; 
    创建视图:create view my_info as select student_name,student_ii;
             select * from  my_info;
    删除视图:drop view my_info;
  • 相关阅读:
    Spring进阶—如何用Java代码实现邮件发送(一)
    如何在Apache中使用PHP处理PHP文件
    最“高大上”的Spring测试:Spring Test
    【编程直播】来约吗?
    【PaPaPa】实现缓存决策
    【PaPaPa】系统架构搭建浅析
    【PaPaPa】集成B/S主流技术的MVC5项目
    【轮子狂魔】手把手教你自造Redis Client
    【轮子狂魔】抛弃IIS,打造个性的Web Server
    【轮子狂魔】抛弃IIS,向天借个HttpListener
  • 原文地址:https://www.cnblogs.com/hellokitty1/p/4189601.html
Copyright © 2011-2022 走看看