美文网首页
第一天学习内容

第一天学习内容

作者: 倾以 | 来源:发表于2018-08-14 12:48 被阅读0次

    1,如何连接到安装数据库的客户端

    1)数据库的ip地址,

    2)数据库的名称(sid),

    3)监听端口(默认1521),

    4)登录数据库的用户名和密码。

    2,如何创建表结构

    create table 表名(

                          列名1  数据类型,

                          列名2  数据类型,

    ·······

                        列名n  数据类型

    );

    create table 表名(

                        列名1 数据类型(primary key),

                        列名2 数据类型 (unique),

                        列名3 数据类型 (not null),

                        列名n 数据类型(default 默认值)

    );

    3,数据类型

    1)整型 number

    2)  浮点型  number (7,2),7表示位数,2表示有2位小数

    3)字符串:1.char(5) 字符串的长度为5,是固长

                      2.varchar2(5)  变长

    4)日期类型。date

    4,

    1)删除表格 drop  table

    2)查询表格select  *  from

    3)查看表结构:新建command Windows, 输入命令desc  表名

    4)增加字段:alter  table  表名  add (字段  数据类型  约束条件)

    5)修改字段:alter  table  表名  modify (字段  数据类型  约束条件)

    6)删除字段:alter  table  表名  drop  column (字段  数据类型  约束条件)

    5,字段的约束条件

    主键 :primary key

    唯一约束:unique

    非空:not. null

    检查约束:check

    外键:references

    默认值:default

    相关文章

      网友评论

          本文标题:第一天学习内容

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