mysql基本操作

这个学期开始上数据库原理了,但对于数据库语句我还是不太熟悉,在这里我记录一些比较常用的语句。

//创建数据库
create databases <数据库名>;
//示例
create databases school;

//选择数据库
use <数据库名>
//示例
use school;

//创建数据表
create table <表名>(<属性名> <字段>,(<属性名>,<字段>))
//示例
create table student(Sno varchar(20) primary key, 
                     Sname varchar(9),
                     Sage smallint(6),
                     Ssex char(4),
                     Sdept char(10));

//删除数据表
drop table <数据名>;
//示例
drop table test;
点赞
  1. Kimora Marina说道:

    Its like you read my mind! You appear to understand so much about this, like you wrote the guide in it or something.
    I feel that you just could do with some % to drive the message house a
    little bit, however instead of that, this is magnificent blog.
    A fantastic read. I will certainly be back.

  2. Royal CBD说道:

    I think that is among the such a lot important information for me.
    And i am satisfied reading your article.
    However wanna observation on few basic issues, The site style is
    great, the articles is really nice : D. Just right process, cheers

发表评论

昵称和uid可以选填一个,填邮箱必填(留言回复后将会发邮件给你)
tips:输入uid可以快速获得你的昵称和头像

Title - Artist
0:00