今天用了一会儿sqlyog,感觉还是会让人懒惰,所以选择了ms-dos环境,感觉不错,原生态,敲着很爽;

| test01             |
| tree |
| world |
+--------------------+
18 rows in set (0.00 sec) mysql> create database if not exists myschool;
Query OK, 1 row affected (0.00 sec) mysql> show databases
-> ;
+--------------------+
| Database |
+--------------------+
| information_schema |
| bdqn |
| mybatis |
| myschool |
| myschool2 |
| mysql |
| news |
| performance_schema |
| sakila |
| school |
| smbms |
| smbmsdemo |
| ssh01 |
| t09 |
| t12 |
| test |
| test01 |
| tree |
| world |
+--------------------+
19 rows in set (0.00 sec) mysql> create table if not exists `subject`()
->
-> ;
ERROR 1046 (3D000): No database selected
mysql> create table if not exists `subject`(SubjectNo int(11),SubjectName vachar
(50),ClassHour int(4),GradeID int(4))comment='课程数据表';
ERROR 1046 (3D000): No database selected
mysql> use myschool;
Database changed
mysql> create table if not exists `subject`(SubjectNo int(11),SubjectName vachar
(50),ClassHour int(4),GradeID int(4))comment='课程数据表';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'vacha
r(50),ClassHour int(4),GradeID int(4))comment='课程数据表'' at line 1
mysql> create table if not exists `subject`(SubjectNo int(11),SubjectName vachar
(50),ClassHour int(4),GradeID int(4))comment='课程数据表';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'vacha
r(50),ClassHour int(4),GradeID int(4))comment='课程数据表'' at line 1
mysql> create table if not exists `subject`(SubjectNo int(11),SubjectName varcha
r(50),ClassHour int(4),GradeID int(4))comment='课程数据表';
Query OK, 0 rows affected (2.20 sec) mysql> select * from subject
-> ;
Empty set (0.00 sec) mysql> select * from `subject`;
Empty set (0.00 sec) mysql> insert into `subject` values('','高等数学-1','','');
Query OK, 1 row affected (0.14 sec) mysql> insert into `subject` values('','高等数学-2','','');
Query OK, 1 row affected (0.13 sec) mysql> insert into `subject` values('','高等数学-3','','');
Query OK, 1 row affected (0.13 sec) mysql> insert into `subject` values('','高等数学-4','','');
Query OK, 1 row affected (0.14 sec) mysql> insert into `subject` values('','C语言-1','','');
Query OK, 1 row affected (0.14 sec) mysql> insert into `subject` values('','C语言-2','','');
Query OK, 1 row affected (0.13 sec) mysql> select * from `subject`;
+-----------+-------------+-----------+---------+
| SubjectNo | SubjectName | ClassHour | GradeID |
+-----------+-------------+-----------+---------+
| 1 | 高等数学-1 | 120 | 1 |
| 2 | 高等数学-2 | 110 | 2 |
| 3 | 高等数学-3 | 100 | 3 |
| 4 | 高等数学-4 | 130 | 4 |
| 5 | C语言-1 | 120 | 1 |
| 6 | C语言-2 | 110 | 2 |
+-----------+-------------+-----------+---------+
6 rows in set (0.00 sec) mysql> create table if not exists grade;
ERROR 1113 (42000): A table must have at least 1 column
mysql> create table if not exists grade(GradeID int(11) primary key,GradeName va
rchar(50))comment='年级表';
Query OK, 0 rows affected (2.22 sec) mysql> insert into grade values('','大一');
Query OK, 1 row affected (0.11 sec) mysql> insert into grade values('','大二');
Query OK, 1 row affected (0.13 sec) mysql> insert into grade values('','大三');
Query OK, 1 row affected (0.13 sec) mysql> insert into grade values('','大四');
ERROR 1062 (23000): Duplicate entry '' for key 'PRIMARY'
mysql> insert into grade values('','大四');
Query OK, 1 row affected (0.13 sec) mysql> select * from grade;
+---------+-----------+
| GradeID | GradeName |
+---------+-----------+
| 1 | 大一 |
| 2 | 大二 |
| 3 | 大三 |
| 4 | 大四 |
+---------+-----------+
4 rows in set (0.00 sec) mysql> create table if not exists student(StudentNo int(4) not null comment '学
号'),,,Loginarchar(20) default null,StudentName varchar(20) default null comment
'学ent '学生姓名',,,,,
'> ;
'> ;
'> kdjsf;a
'> ;
'> Bye C:\Users\Administrator>mysql -uroot -p
Enter password: ****
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 9
Server version: 5.5.54-log MySQL Community Server (GPL) Copyright (c) 2000, 2016, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its
affiliates. Other names may be trademarks of their respective
owners. Type 'help;' or '\h' for help. Type '\c' to clear the current input statement. mysql> use myschool;
Database changed
mysql> create table if not exists student(StudentNo int(4) not null comment '学
号',LoginPwd varchar(20) default null,StudentName varchar(20) default null comme
nt '学生姓名',Sex tinyint(1) default null comment '性别,取值0或1',GradeId int(1
1) default null comment '年级编号',Phone varchar(50) not null comment '联系电话
,允许为空,即可选输入',Address varchar(255) not null comment '地址,允许为空,
即可选输入',BornDate datetime default null comment '出生时间',Email varchar(50)
not null comment '邮箱账号,允许为空,即可选输入',IdentityCard varchar(18) defau
lt null comment '身份证号')comment='学生类';
Query OK, 0 rows affected (0.53 sec) mysql> select * from student;
Empty set (0.02 sec) mysql> show databases;
+--------------------+
| Database |
+--------------------+
| information_schema |
| bdqn |
| mybatis |
| myschool |
| myschool2 |
| mysql |
| news |
| performance_schema |
| sakila |
| school |
| smbms |
| smbmsdemo |
| ssh01 |
| t09 |
| t12 |
| test |
| test01 |
| tree |
| world |
+--------------------+
19 rows in set (0.00 sec) mysql> use myschool;
Database changed
mysql> select * from student;
Empty set (0.00 sec) mysql> show tables;
+--------------------+
| Tables_in_myschool |
+--------------------+
| grade |
| student |
| subject |
+--------------------+
3 rows in set (0.00 sec) mysql> select * from subject;
+-----------+-------------+-----------+---------+
| SubjectNo | SubjectName | ClassHour | GradeID |
+-----------+-------------+-----------+---------+
| 1 | 高等数学-1 | 120 | 1 |
| 2 | 高等数学-2 | 110 | 2 |
| 3 | 高等数学-3 | 100 | 3 |
| 4 | 高等数学-4 | 130 | 4 |
| 5 | C语言-1 | 120 | 1 |
| 6 | C语言-2 | 110 | 2 |
+-----------+-------------+-----------+---------+
6 rows in set (0.00 sec) mysql> use myschool;
Database changed
mysql> show tables;
+--------------------+
| Tables_in_myschool |
+--------------------+
| grade |
| student |
| subject |
+--------------------+
3 rows in set (0.00 sec) mysql> drop subject if exists;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'subje
ct if exists' at line 1
mysql> drop table subject if exists;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'if ex
ists' at line 1
mysql> drop `subject` if exists;
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near '`subj
ect` if exists' at line 1
mysql> drop table if exists subject;
Query OK, 0 rows affected (0.47 sec) mysql> show tables;
+--------------------+
| Tables_in_myschool |
+--------------------+
| grade |
| student |
+--------------------+
2 rows in set (0.00 sec) mysql> create table if not exists subject(SubjectNo in(11) not null comment '课
程编号',SubjectName varchar(50) default null comment '课程名称',ClassHour int(4)
default null comment '学时',GradeID int(4) default null comment '年级编号';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'in(11
) not null comment '课程编号',SubjectName varchar(50) default null comm' at line
1
mysql> create table if not exists subject(SubjectNo in(11) not null comment '课
程编号',SubjectName varchar(50) default null comment '课程名称',ClassHour int(4)
default null comment '学时',GradeID int(4) default null comment '年级编号')engi
ne=MyISAM,comment='课程名称表';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'in(11
) not null comment '课程编号',SubjectName varchar(50) default null comm' at line
1
mysql> create table if not exists subject(SubjectNo in(11) not null comment '课
程编号',SubjectName varchar(50) default null comment '课程名称',ClassHour int(4)
default null comment '学时',GradeID int(4) default null comment '年级编号')engi
ne=MyISAM comment='课程名称表';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'in(11
) not null comment '课程编号',SubjectName varchar(50) default null comm' at line
1
mysql> create table if not exists subject(SubjectNo in(11) not null comment '课
程编号',SubjectName varchar(50) default null comment '课程名称',ClassHour int(4)
default null comment '学时',GradeID int(4) default null comment '年级编号')engi
ne=MyISAM comment='课程名称表';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'in(11
) not null comment '课程编号',SubjectName varchar(50) default null comm' at line
1
mysql> create table if not exists subject(SubjectNo in(0t1) not null comment '课
程编号',SubjectName varchar(50) default null comment '课程名称',ClassHour int(4)
default null comment '学时',GradeID int(4) default null comment '年级编号')engi
ne=MyISAM comment='课程名称表';
ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'in(0t
1) not null comment '课程编号',SubjectName varchar(50) default null com' at line
1
mysql> create table if not exists subject(SubjectNo in(11) not null comment '课
程编号',SubjectName varchar(50) default null comment '课程名称',ClassHour int(4)
default null comment '学时',GradeID int(4) default null comment '年级编号')engi
ne=MyISAM,comment='课程名称表'; ;

mysql练习代码

当然ms-dos的缺点也很多:

1 不好编辑,特别是错了的时候,会乱

2 写完保存代码很困难

3 每次语句写完都要打分号

mysql20170407代码实现的更多相关文章

  1. 日期格式代码出现两次的错误 ORA-01810

    错误的原因是使用了两次MM . 一.Oracle中使用to_date()时格式化日期需要注意格式码 如:select to_date('2005-01-01 11:11:21','yyyy-MM-dd ...

  2. 可爱的豆子——使用Beans思想让Python代码更易维护

    title: 可爱的豆子--使用Beans思想让Python代码更易维护 toc: false comments: true date: 2016-06-19 21:43:33 tags: [Pyth ...

  3. iOS代码规范(OC和Swift)

    下面说下iOS的代码规范问题,如果大家觉得还不错,可以直接用到项目中,有不同意见 可以在下面讨论下. 相信很多人工作中最烦的就是代码不规范,命名不规范,曾经见过一个VC里有3个按钮被命名为button ...

  4. Jquery的点击事件,三句代码完成全选事件

    先来看一下Js和Jquery的点击事件 举两个简单的例子 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN&q ...

  5. redux-amrc:用更少的代码发起异步 action

    很多人说 Redux 代码多,开发效率低.其实 Redux 是可以灵活使用以及拓展的,经过充分定制的 Redux 其实写不了几行代码.今天先介绍一个很好用的 Redux 拓展-- redux-amrc ...

  6. 编写高质量代码:改善Java程序的151个建议(第5章:数组和集合___建议75~78)

    建议75:集合中的元素必须做到compareTo和equals同步 实现了Comparable接口的元素就可以排序,compareTo方法是Comparable接口要求必须实现的,它与equals方法 ...

  7. 使用 .NET WinForm 开发所见即所得的 IDE 开发环境,实现不写代码直接生成应用程序

    直接切入正题,这是我09年到11年左右业余时间编写的项目,最初的想法很简单,做一个能拖拖拽拽就直接生成应用程序的工具,不用写代码,把能想到的业务操作全部封装起来,通过配置的方式把这些业务操作组织起来运 ...

  8. jsp前端实现分页代码

    前端需要订一page类包装,其参数为 private Integer pageSize=10; //每页记录条数=10 private Integer totalCount; //总记录条数 priv ...

  9. 【开源】简单4步搞定QQ登录,无需什么代码功底【无语言界限】

    说17号发超简单的教程就17号,qq核审通过后就封装了这个,现在放出来~~ 这个是我封装的一个开源项目:https://github.com/dunitian/LoTQQLogin ————————— ...

随机推荐

  1. HDU_1875_畅通工程再续

    畅通工程再续 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Subm ...

  2. 解决[disabled]="true"与formControlName冲突

    import { FormBuilder } from '@angular/forms'; form; constructor(private fb: FormBuilder) { this.form ...

  3. HDU多校Round 1

    Solved:5 rank:172 A.Maximum Multiple #include <stdio.h> #include <algorithm> #include &l ...

  4. java学习日志--char和int的相互转换

    package shugen; /*ASCLL码表 * 48 数字0 * 49 1 * 50 2 * 51 3 * 52 4 * 53 5 * 54 6 * 55 7 * 56 8 * 57 9 */ ...

  5. poj - 3254 - Corn Fields (状态压缩)

    poj - 3254 - Corn Fields (状态压缩)超详细 参考了 @外出散步 的博客,在此基础上增加了说明 题意: 农夫有一块地,被划分为m行n列大小相等的格子,其中一些格子是可以放牧的( ...

  6. CQOI2007 涂色 paint (区间dp)

    听说这道题是当年省选题 于是兴致勃勃拿来做了做 至于如何想到思路... 事实上没想象中那么简单... 脑阔挺疼的... (一开始都没看出来是区间dp) 想到可以区间dp,然后就似乎没啥大问题 枚举区间 ...

  7. python环境配置以及基本知识

    python---一种解释型语言(脚本语言),具有代码简洁.入门简单.开发效率高的优点.当然不可避免的有着暴露源码.执行效率低的缺点,但毕竟瑕不掩瑜,在数据是无比宝贵的财富的当下,无疑是一门优秀的编成 ...

  8. msdn的原版windows下载地址链接

    http://msdn.itellyou.cn/ 所有版本的下载地址 进去点左边操作系统

  9. Python学习——字典

    字典 字典是另一种可变容器模型,且可存储任意类型对象. 1.创建字典 字典由键和对应值成对组成.每个键与值之间用:隔开,每对之间逗号隔开. 每个键应当互不相同,值可以相同.若同时出现两个相同的键,则后 ...

  10. Git--删除远程仓库文件但不删除本地仓库资源

    我们在使用idea开发的过程中经常会出现新建项目的时候直接把xxx.iml文件也添加到了git trace 当然这并不会出现什么问题,问题是当我们把xxx.iml文件push到我们github上之后, ...