【MySQL 00】MySQL数据表

黄舟
发布: 2017-02-04 11:32:55
原创
1250人浏览过

 

【MySQL 00】MySQL数据表

/*
 *-------------------------------------------------MySQL数据表---------------------------------------------------
     *
     *
        C:\Users\kevinelstri>mysql -u root -p
        Enter password: *****
        Welcome to the MySQL monitor.  Commands end with ; or \g.
        Your MySQL connection id is 118
        Server version: 5.5.29 MySQL Community Server (GPL)

        Copyright (c) 2000, 2012, 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> show databases;
        +--------------------+
        | Database           |
        +--------------------+
        | information_schema |
        | data1              |
        | data2              |
        | mysql              |
        | performance_schema |
        | test               |
        +--------------------+
        6 rows in set (0.00 sec)

        mysql> use test;
        Database changed
        mysql> show tables;
        +----------------+
        | Tables_in_test |
        +----------------+
        | access         |
        | app            |
        | cal            |
        | orders         |
        | person         |
        | person01       |
        | web            |
        | website        |
        +----------------+
        10 rows in set (0.00 sec)

        mysql> select * from access;
        +------+---------+-------+------------+
        | aid  | site_id | count | date       |
        +------+---------+-------+------------+
        |    1 |       1 |    45 | 2016-05-10 |
        |    2 |       3 |   100 | 2016-05-13 |
        |    3 |       1 |   230 | 2016-05-14 |
        |    4 |       2 |    10 | 2016-05-14 |
        |    5 |       5 |   206 | 2016-05-14 |
        |    6 |       4 |    13 | 2016-05-15 |
        |    7 |       3 |   220 | 2016-05-16 |
        |    8 |       5 |   545 | 2016-05-16 |
        |    9 |       3 |   201 | 2016-05-17 |
        +------+---------+-------+------------+
        9 rows in set (0.00 sec)

        mysql> select * from app;
        +------+------------+-----------------------+---------+
        | id   | app_name   | url                   | country |
        +------+------------+-----------------------+---------+
        |    1 | qq         | http://www.qq.com     | CN      |
        |    2 | taobao app | http://www.taobao.com | CN      |
        |    3 | weibo app  | http://weibo.com      | CN      |
        +------+------------+-----------------------+---------+
        3 rows in set (0.00 sec)

        mysql> select * from cal;
        +----+------+-------+--------+------+
        | id | name | first | second | sum  |
        +----+------+-------+--------+------+
        |  1 | lily |    42 |      3 | NULL |
        |  2 | mary |    22 |    637 | NULL |
        |  3 | may  |    32 |     43 |   75 |
        +----+------+-------+--------+------+
        3 rows in set (0.00 sec)

        mysql> select * from orders;
        +------+---------+------+
        | O_id | OrderNo | id   |
        +------+---------+------+
        |    1 |   77895 |    3 |
        |    2 |   44678 |    3 |
        |    3 |   22456 |    2 |
        |    4 |   24562 |    1 |
        +------+---------+------+
        4 rows in set (0.00 sec)

        mysql> select * from person;
        +----+-----------+-----------+--------------+----------+
        | id | LastName  | FirstName | Address      | City     |
        +----+-----------+-----------+--------------+----------+
        |  1 | Hansen    | Ola       | Timoteivn 10 | Sandes   |
        |  2 | Svendson  | Tove      | Borgvn 23    | Sandes   |
        |  3 | Pettersen | Keri      | Storgt 20    | Stavaner |
        +----+-----------+-----------+--------------+----------+
        3 rows in set (0.00 sec)

        mysql> select * from website;
        +----+----------+-------------------------+-------+---------+
        | id | name     | url                     | alexa | country |
        +----+----------+-------------------------+-------+---------+
        |  1 | Google   | http://www.google.com   |     1 | USA     |
        |  2 | taobao   | http://www.taobao.com   |    13 | CN      |
        |  3 | cainiao  | http://www.runoob.com   |   673 | CN      |
        |  4 | weibo    | http://weibo.com        |    20 | CN      |
        |  5 | Facebook | http://www.facebook.com |     3 | USA     |
        |  7 | ali      | http://www.ali.com      |    32 | CN      |
        +----+----------+-------------------------+-------+---------+
        6 rows in set (0.00 sec)

        mysql> select * from person01;
        +------+------+---------+----------+------------+
        | id   | name | address | city     | date       |
        +------+------+---------+----------+------------+
        |    1 | Lily | xian    | shanghai | NULL       |
        |    2 | Mary | beijing | shanghai | 2016-03-02 |
        +------+------+---------+----------+------------+
        2 rows in set (0.00 sec)

     *
     */
登录后复制

以上就是 【MySQL 00】MySQL数据表的内容,更多相关内容请关注PHP中文网(www.php.cn)!

爱图表
爱图表

AI驱动的智能化图表创作平台

爱图表 99
查看详情 爱图表
相关标签:
最佳 Windows 性能的顶级免费优化软件
最佳 Windows 性能的顶级免费优化软件

每个人都需要一台速度更快、更稳定的 PC。随着时间的推移,垃圾文件、旧注册表数据和不必要的后台进程会占用资源并降低性能。幸运的是,许多工具可以让 Windows 保持平稳运行。

下载
来源:php中文网
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系admin@php.cn
最新问题
开源免费商场系统广告
热门教程
更多>
最新下载
更多>
网站特效
网站源码
网站素材
前端模板
关于我们 免责申明 举报中心 意见反馈 讲师合作 广告合作 最新更新 English
php中文网:公益在线php培训,帮助PHP学习者快速成长!
关注服务号 技术交流群
PHP中文网订阅号
每天精选资源文章推送
PHP中文网APP
随时随地碎片化学习

Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号