zoukankan      html  css  js  c++  java
  • SQL语句入门

    1、数据库

    创建数据库:CREATE DATABASE student_teacher;

    删除数据库:DROP DATABASE student_teacher;

    切换到当前数据库:USE student_teacher;

    2、表

    创建表:CREATE TABLE student;

    删除表:DROP TABLE student;

    增加一列:Alter table student add column name char;

    3、视图

    创建视图:create view stu;

    删除视图:drop view stu;

    4、简单表数据操作语句

    选择:select * from student where no=091120109;

    插入元组:insert into student(no,num,sex,grade) values(1,091120109,male,98);

    删除元组:delete form student where sex=male;

    更新字段属性的值:update student set sex=female where sex=male;

    模糊查找:select * from student where num like “%911201%”; //%代表任意的零个或多个字符,’_’表示任意单个字符。

    排序(DESC为降序,ASC为升序):select *from student order by num [DESC];

  • 相关阅读:
    离场飞越转弯全家福
    画一个PBN大角度飞越转弯保护区
    画一个小角度飞越转弯保护区
    Point Estimation
    Random variable
    心流
    Survey sampling
    Distribution
    数学分析总结
    topological space
  • 原文地址:https://www.cnblogs.com/joeshine/p/4355500.html
Copyright © 2011-2022 走看看