mysql20170407代码实现

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

| 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‘,‘高等数学-1‘,‘120‘,‘1‘);
Query OK, 1 row affected (0.14 sec)

mysql> insert into `subject` values(‘2‘,‘高等数学-2‘,‘110‘,‘2‘);
Query OK, 1 row affected (0.13 sec)

mysql> insert into `subject` values(‘3‘,‘高等数学-3‘,‘100‘,‘3‘);
Query OK, 1 row affected (0.13 sec)

mysql> insert into `subject` values(‘4‘,‘高等数学-4‘,‘130‘,‘4‘);
Query OK, 1 row affected (0.14 sec)

mysql> insert into `subject` values(‘5‘,‘C语言-1‘,‘120‘,‘1‘);
Query OK, 1 row affected (0.14 sec)

mysql> insert into `subject` values(‘6‘,‘C语言-2‘,‘110‘,‘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(‘1‘,‘大一‘);
Query OK, 1 row affected (0.11 sec)

mysql> insert into grade values(‘2‘,‘大二‘);
Query OK, 1 row affected (0.13 sec)

mysql> insert into grade values(‘3‘,‘大三‘);
Query OK, 1 row affected (0.13 sec)

mysql> insert into grade values(‘1‘,‘大四‘);
ERROR 1062 (23000): Duplicate entry ‘1‘ for key ‘PRIMARY‘
mysql> insert into grade values(‘4‘,‘大四‘);
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练习代码

时间: 2024-10-15 15:31:23

mysql20170407代码实现的相关文章

错误和问题解决的成本

问题描写叙述 错误 数据收集 根本原因 版本号   组件:数据修复           在一个实际成本组织中,(平均,先进先出,后进先出) 一个或更 多的下面情况可能发生: 1.导航到物料成本历史表单上的数量信息,与现有量表单的数量不匹配的记录 2. 一些物料前期已计成本的数量与前面的事务处理历史表单的数量不匹配 3. 全部的库存值报表与事务处理值报表不匹配 4. 存货层次成本更新表单的总数量与现有量数量表单不匹配(只在先进先出/后进先出) 5.这些症状的不论什么一个意味着 MMT-CQL不匹配

Xcode 快速开发 代码块 快捷键

Xcode的代码片段(Code Snippets)创建自定义的代码片段,当你重用这些代码片段时,会给你带来很大的方便. 常用的: 1.strong:@property (nonatomic,strong) <#Class#> *<#object#>;2.weak:@property (nonatomic,weak) <#Class#> *<#object#>;3.copy:@property (nonatomic,copy) NSString *<#s

solr分布式索引【实战一、分片配置读取:工具类configUtil.java,读取配置代码片段,配置实例】

1 private static Properties prop = new Properties(); 2 3 private static String confFilePath = "conf" + File.separator + "config.properties";// 配置文件目录 4 static { 5 // 加载properties 6 InputStream is = null; 7 InputStreamReader isr = null;

微信支付PHP SDK —— 公众号支付代码详解

在微信支付 开发者文档页面 下载最新的 php SDK http://mch.weixin.qq.com/wiki/doc/api/jsapi.php?chapter=11_1 这里假设你已经申请完微信支付 1. 微信后台配置  如图 我们先进行测试,所以先把测试授权目录和 测试白名单添加上.测试授权目录是你要发起微信请求的哪个文件所在的目录. 例如jsapi 发起请求一般是jsapi.php所在目录 为测试目录,测试白名单即开发人员的微信号. 正式的支付授权目录不能和测试的一样否则会报错.不填

如何上传代码到github?

如何上传代码到github? 首先你需要一个github账号,所有还没有的话先去注册吧! https://github.com/ 我们使用git需要先安装git工具,这里给出下载地址,下载后一路直接安装即可: https://git-for-windows.github.io/ 1.进入Github首页,点击New repository新建一个项目  2.填写相应信息后点击create即可 Repository name: 仓库名称 Description(可选): 仓库描述介绍 Public,

自己写的代码会写了,还是太渣,复杂度什么的直接报表

原题目是这样子的,本人按照一贯的作风想得很简单 #include<iostream> using namespace std; void H(int n) { while (n > 1) { if (n % 2 == 0) //这一步把取余和除法弄混淆. { cout << n << " "; n = n / 2; } else { cout << n << " "; n = 3 * n + 1; }

category is in invalid format hint微信第三方平台将第三方提交的代码包提交审核出错

微信第三方平台通过接口https://api.weixin.qq.com/wxa/submit_audit?access_token=TOKEN将第三方提交的代码包提交审核时一直返回错误码85008的错误信息: category is in invalid format hint 查了半天是接口提交数据时json_encode时中文不能编码提交 将向微信的提交代码     $this->https_post($url,json_encode($postData)); 改为     $this->

CSS颜色代码大全

CSS颜色代码大全 颜色代码表(一): EEEEEE FFCCFF FF66FF FF00FF DDDDDD FFCCCC FF66CC FF00CC CCCCCC FFCC99 FF6699 FF0099 BBBBBB FFCC66 FF6666 FF0066 AAAAAA FFCC33 FF6633 FF0033 999999 FFCC00 FF6600 FF0000 888888 CCCCFF CC66FF CC00FF 777777 CCCCCC CC66CC CC00CC 666666

mp4网页播放代码,有声音无图像的解决办法~

mp4网页播放代码,有声音无图像的解决办法~ 关于网页播放mp4格式的视频,找了一些插件,这里推荐一下video.js 官方网址:http://www.videojs.com/ github :https://github.com/videojs/video.js/ demo:http://www.videojs.com/downloads/video-js-4.12.5.zip 使用方法: ①引入文件:指派flash播放的swf文件 <link href="//example.com/p