C:\Users\ceshi>mysql -u root -p
Enter password: ******
Welcome to the MySQL monitor. Commands end with ; or \g.
Your MySQL connection id is 3
Server version: 5.6.24 MySQL Community Server (GPL)

Copyright (c) 2000, 2015, 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> create database qa;
Query OK, 1 row affected (0.00 sec)

mysql> use qa;
Database changed
mysql> create table results(
-> id int not null auto_increment,
-> primary key(id));
Query OK, 0 rows affected (0.19 sec)

mysql> alter table results add column test_suit varchar(255);
Query OK, 0 rows affected (0.32 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> alter table results add column test_name varchar(255) not null;
Query OK, 0 rows affected (0.28 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> alter table results add column test_status varchar(10) not null;
Query OK, 0 rows affected (0.29 sec)
Records: 0 Duplicates: 0 Warnings: 0

mysql> describe results;
+-------------+--------------+------+-----+---------+----------------+
| Field | Type | Null | Key | Default | Extra |
+-------------+--------------+------+-----+---------+----------------+
| id | int(11) | NO | PRI | NULL | auto_increment |
| test_suit | varchar(255) | YES | | NULL | |
| test_name | varchar(255) | NO | | NULL | |
| test_status | varchar(10) | NO | | NULL | |
+-------------+--------------+------+-----+---------+----------------+
4 rows in set (0.02 sec)
mysql> insert into results(id,test_suit,test_name,test_status) values(2,"python web","article","200");
Query OK, 1 row affected (0.03 sec)

mysql的创建数据库表及添加数据的更多相关文章

  1. 数据库(一)--通过django创建数据库表并填充数据

    django是不能创建数据库的,只能够创建数据库表,因此,我们在连接数据库的时候要先建立一个数据库. 在models.py中 from django.db import models class Pu ...

  2. MySQL 两个数据库表中合并数据

    两个数据库表中合并数据 如果有  t1  和 t2 两个数据库表格,它们两个对应的字段是相同的.如何将 t2 的数据插入到t1中去呢? insert into t1 select * from t2 ...

  3. 【转】 iOS学习之sqlite的创建数据库,表,插入查看数据

    原文:  http://blog.csdn.net/totogo2010/article/details/7702207 iOS sqlite数据库操作.步骤是: 先加入sqlite开发库libsql ...

  4. iOS学习之sqlite的创建数据库,表,插入查看数据

    目录(?)[-] 新建项目sqliteDemo添加使用sqlite的库libsqlite3dylib sqlite 的方法 获取沙盒目录并创建或打开数据库 创建数据表 插入数据 查询数据库并打印数据 ...

  5. ios sqlite的创建数据库,表,插入查看数据

    iOS sqlite数据库操作.步骤是: 先加入sqlite开发库libsqlite3.dylib, 新建或打开数据库, 创建数据表, 插入数据, 查询数据并打印 1.新建项目sqliteDemo,添 ...

  6. POI框架实现创建Excel表、添加数据、读取数据

    public class TestPOI2Excel {//创建2003版本Excel用此方法 @Test public void testWrite03Excel() throws Exceptio ...

  7. 使用MySQL Workbench建立数据库,建立新的表,向表中添加数据

    使用MySQL Workbench建立数据库,建立新的表,向表中添加数据 初学数据库,记录一下所学的知识.我用的MySQL数据库,使用MySQL Workbench管理.下面简单介绍一下如何使用MyS ...

  8. C# 利用mysql.data 在mysql中创建数据库及数据表

    C# 利用mysql.data 在mysql中创建数据库及数据表 using System; using System.Collections.Generic; using System.Linq; ...

  9. PowerDesigner创建表 拷贝创建表语句 SQLSERVER创建数据库 使用查询 创建表 并且添加数据

    PowerDesigner创建表 : 1.双击打开PowerDesigner   2.双击打开Create model 3左键点击Model  types,再点击Physical    Data  m ...

随机推荐

  1. Feign的介绍与使用(五)

    一.Feign的介绍 Feign是一个声明式 WebService 客户端,使用Feign能够让编写Web Service 客户端更加简单,它的使用方法是定义一个接口,然后在上面添加注解,同时也支持J ...

  2. 短信控制的 智能插头(sim900a arduino uno)

    https://www.arduino.cn/thread-19432-1-2.html 1.所需工具:(1)arduino UNO,(2)sim900a模块,(3)单路继电器,(4)220v ac转 ...

  3. spring cloud 与spring boot 版本不匹配引发的问题总结

    为了将前期项目慢慢转移到微服务上,今天开始搭建eureka服务时,出现以下错误: org.springframework.context.ApplicationContextException: Un ...

  4. flash判断,及安装注意

    使用下面方法判断flash版本 function flashChecker() { var hasFlash = 0; //是否安装了flash var flashVersion = 0; //fla ...

  5. Unreal Engine 4 系列教程 Part 10:制作简单FPS游戏

    .katex { display: block; text-align: center; white-space: nowrap; } .katex-display > .katex > ...

  6. Azure CosmosDB (14) 使用Postman访问CosmosDB REST API

    <Windows Azure Platform 系列文章目录> 今天研究了一下如何使用Postman访问Azure CosmosDB. CosmosDB API接口,可以参考:https: ...

  7. 论文阅读: v-charge项目: 电动车的自动泊车和充电

    Abstract AVP服务会缓和电动车现有两个缺点: 有限的行驶范围和很长的充电时间. v-charge用相机和超声波在GPS-denied的区域全自动形式. 这篇paper叙述了下述几方面的优势: ...

  8. pycharm报错:ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory

    pycharm报错:ImportError: libcusolver.so.8.0: cannot open shared object file: No such file or directory ...

  9. restful api的10个最佳实践

    Web API在过去的几年里非常盛行,因为它有着语法简单.规范化和轻量级的优点,因为得到广泛的推崇,很多过往的技术手段都慢慢转换为使用Web API来开发.而Web API通常使用的设计方式是REST ...

  10. ubuntu删除文件和文件夹的rm命令

    在Ubuntu中好多文件或文件夹是不能使用右键删除的,因此知道删除文件或文件夹的rm命令显得尤为重要. rm命令的语法 rm [选项] 文件名或文件夹名 rm命令的一些选项 -f.--force 强力 ...