![](https://img-blog.csdnimg.cn/20201014180756923.png?x-oss-process=image/resize,m_fixed,h_64,w_64)
SQL
6-Tong
a super student in BUPT!
展开
-
MySQL Lab2 答案与解析
一、table 创建部分:CREATE TABLE Branch ( branchNo CHAR(4), street VARCHAR(45) NOT NULL, city VARCHAR(45) NOT NULL, postcode VARCHAR(45) NOT NULL, PRIMARY KEY (branchNo));/*alter table Branch modify street VARCHAR(45) NOT NULL;alter tabl..原创 2021-04-16 10:57:41 · 331 阅读 · 0 评论 -
MySQL 增加字段语句
ALTER TABLE <表名> ADD <新字段名><数据类型>[约束条件];原创 2021-04-16 10:52:48 · 718 阅读 · 0 评论 -
MySQL 更改字段属性
CREATE TABLE Branch ( branchNo CHAR(4), street VARCHAR(4) NOT NULL, city VARCHAR(4) NOT NULL, postcode VARCHAR(4) NOT NULL, PRIMARY KEY (branchNo));在插入数据的时候发现括号里面的长度应该是45!语法格式:alter table table_name modify colume_name varchar(128);原创 2021-04-14 21:58:28 · 246 阅读 · 0 评论 -
Lab1答案与解析
-- Lab1-- 1. List all staff details.SELECT *FROM staff;-- 2. List staff whose salary is between 8,000 and 20,000. Show staff name, position and salary.SELECT fName, lName, position, salaryFROM staffWHERE salary BETWEEN 8000 A.原创 2021-04-06 16:18:48 · 417 阅读 · 0 评论 -
2.3 SQL examples in slides
-- Eg1. selection of all columnsSELECT *FROM Staff;-- Eg2. selection of specific columnsSELECT staffNo, fName, lName, salaryFROM Staff;-- Eg3. Use of distinctSELECT propertyNoFROM Viewing;SELECT DISTINCT propertyN原创 2021-04-06 16:16:46 · 103 阅读 · 0 评论 -
DreamHome 数据
insert into Branch values('B005','22 Deer Rd','London','SW1 4EH');insert into Branch values('B007','16 Argylly Rd','Aberdeen','AB2 3SU');insert into Branch values('B003', '163 Main St', 'Glasgow', 'G11 9QX');insert into Branch values('B004', '32 Manse .原创 2021-04-06 16:15:20 · 375 阅读 · 0 评论 -
DreamHome schema 代码
-- MySQL Workbench Forward EngineeringSET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0;SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0;SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO.原创 2021-04-06 16:14:01 · 265 阅读 · 0 评论 -
MySQL WorkBench 代码格式化快捷键
MySQL WorkBench 代码格式化快捷键:control + B原创 2021-04-02 13:28:53 · 1742 阅读 · 0 评论 -
SQLWorkbench BigSur 闪退最简单的解决办法
找一个稍微久一点的办法~https://downloads.mysql.com/archives/workbench/原创 2021-03-19 20:26:39 · 507 阅读 · 0 评论