基础操作1
-- 创建学生管理系统的数据库
CREATE DATABASE studentsystem;
-- 链接studentsystem数据库
USE studentsystem;
-- 创建学生表
CREATE TABLE student
(
s_id INT,
name VARCHAR(50),
sex VARCHAR(2),
phone INT,
classes VARCHAR(50)
);
-- 查看学生表结构
DESC student;
-- 插入五条数据
INSERT INTO student VALUES(1,'王者','男',1801131406,'18大数据四班');
-- 查询学生信息
SELECT * FROM student;
SELECT * FROM student WHERE s_id=1;
-- 修改
UPDATE student SET name='帅哥' where s_id=1;
-- 删除s_id等于1的记录
DELETE FROM student WHERE s_id=1;