SQL概述

SQL(structured Query Language)

DDL(Data Definition Language)

数据定义语言,引导词如下,用于模式的定义和删除,包括Database,Table,View,Index,完整性约束条件和对象

  • Create(建立)
  • Alter(修改)
  • Drop(撤销)

DML(Data Manipulation Language)

数据操纵语言,引导词如下

  • Insert 语法:Insert into 表名 [列名] Values
  • Delete
  • Update
  • Select,语法:Select 列名 [[,列名 ]…] From 表名 [where 检索条件];

DCL

数据控制语言,引导词如下:

  • Grant (授权)
  • Revoke(撤销授权)

使用SQL建立数据库

需要使用到的表如下:
表
表2

步骤如下:

  1. 创建数据库(DB) Create Database SCT;
  2. 创建DB中的Table,如:Create table Student( S# char(8) not null, Sname char(10), Ssex char(2), Sage integer, D# char(2), Sclass char(4));
  3. 向Table中追加新的元组:Insert into Student Values('201313138042','毛大黑','女','18','03','130

猜你喜欢

转载自blog.csdn.net/weixin_38470851/article/details/80590997