zoukankan      html  css  js  c++  java
  • SQL复习

    最近面试,深知作为一个PM,数据库的重要性。

    unit1 了解数据库

    1.库-database

    表-table——列-column,按行存储-row——唯一标志主键-primary key

    模式-属性

    数据分解,数据类型,数据类型兼容

    2.SQL-Structured QueryLanguage(结构化查询语言)

    unit2 检索数据-select

    1.关键字-keyword,通配符*

    2.select p_name,p_price from Prdoucts;

    全部——select * from Products;

    去重——select distinct p_name from Products;

    限制返回行数——select p_name from Products limit 5;

    3.注释  --    #       /* */

    排序检索数据-order by

    select p_name from Products order by p_name;

    select p_name,p_price from Products order by p_name,p_price;

    select p_price from Products order by p_price desc;   --降序        --反之升序-asc

    过滤数据-where

    select p_name from Products where p_name='施‘;    --加上操作符,加上单引号!

    范围-between A and B

    探空-is null

    组合where语句

    操作符-用来联结或改变WHERE子句中的子句的关键字,也称为逻辑操作符(logical operator)

    并,交集-select p_name,p_price  from Products where p_name='施‘ and p_price <=5; 

    合,并集-select p_name,p_price  from Products where p_name='施‘ or p_price <=5; 

    在where中合理使用(),提高优先级

     指定条件范围-select p_name from Products where p_name in ('施‘,'军'); 

    否定-...where not p_name='施';   --not=<>

    通配符过滤

  • 相关阅读:
    HDU 4714:Tree2cycle 树形DP
    HDU 4679:Terrorist’s destroy 树形DP
    as 和is的区别
    关于父类引用指向子类对象
    C# new的用法
    Mvc中把list从View传入Controller
    Html.TextBoxFor三元判断
    ref 和out的用法以及区别
    c# datatable list 相互转换
    jquery trigger伪造a标签的click事件取代window.open方法
  • 原文地址:https://www.cnblogs.com/only666/p/14775437.html
Copyright © 2011-2022 走看看