当前位置:网站首页>[experiment index of educator database]
[experiment index of educator database]
2022-07-06 13:53:00 【Fu Ying ('▿')】
1、 Mission requirements
stay sale In the database , Establish supplier data sheet
gys, Including supplier name gysh Character 4 position 、 Corporate name Variable length character type 20 position 、 Telephone Variable length character type 11 position 、 Address Variable length character type 20 position 、 Contacts Variable length character type 4 position 、 mobile phone Character 11 position Field , At the same time, the main index is established according to the supplier number field .
Display in rows gyh Index of data table
use sale;
# Code start
create table gyh
(
gysh char(4) primary key,
Name varchar(20),
telephone varchar(11),
address varchar(20),
contact varchar(4),
mobile char(11)
);
show index from gyh;
# Code end
2、 Mission :
The first question is
stay xsdmx The data sheet is numbered according to the sales order xsdh And serial number xh Two fields establish the primary index xsdxh
The second question is
stay xsdmx The data sheet is based on the commodity number sph Field to build a general index sphsy.
Third question
In commodities sp The data sheet is based on the trade name spm Field to establish a unique index spmsy.
use sale
# Code start
# The first question is
alter table xsdmx add primary key(xsdh,xh);
# The second question is
create index sphsy on xsdmx(sph);
# Third question
create unique index spmsy on sp(spm);
# Code end
show index in xsdmx\g;
show index in sp\g;
3、 Delete sp Index of commodity data sheet spmsy
The command format of deleting the index
use sale;
# Code start
alter table sp drop index spmsy;
# Code end
show index in sp\g;
边栏推荐
- [dark horse morning post] Shanghai Municipal Bureau of supervision responded that Zhong Xue had a high fever and did not melt; Michael admitted that two batches of pure milk were unqualified; Wechat i
- 强化学习系列(一):基本原理和概念
- [the Nine Yang Manual] 2022 Fudan University Applied Statistics real problem + analysis
- 【九阳神功】2016复旦大学应用统计真题+解析
- canvas基础2 - arc - 画弧线
- Cookie和Session的区别
- 关于双亲委派机制和类加载的过程
- C语言入门指南
- 扑克牌游戏程序——人机对抗
- 为什么要使用Redis
猜你喜欢
(original) make an electronic clock with LCD1602 display to display the current time on the LCD. The display format is "hour: minute: Second: second". There are four function keys K1 ~ K4, and the fun
扑克牌游戏程序——人机对抗
7-7 7003 组合锁(PTA程序设计)
关于双亲委派机制和类加载的过程
【VMware异常问题】问题分析&解决办法
强化学习基础记录
About the parental delegation mechanism and the process of class loading
Write a program to simulate the traffic lights in real life.
2022泰迪杯数据挖掘挑战赛C题思路及赛后总结
撲克牌遊戲程序——人機對抗
随机推荐
The latest tank battle 2022 - Notes on the whole development -2
Using qcommonstyle to draw custom form parts
Cookie和Session的区别
js判断对象是否是数组的几种方式
Relationship between hashcode() and equals()
Leetcode.3 无重复字符的最长子串——超过100%的解法
QT meta object qmetaobject indexofslot and other functions to obtain class methods attention
编写程序,模拟现实生活中的交通信号灯。
Custom RPC project - frequently asked questions and explanations (Registration Center)
使用Spacedesk实现局域网内任意设备作为电脑拓展屏
透彻理解LRU算法——详解力扣146题及Redis中LRU缓存淘汰
C语言入门指南
【九阳神功】2016复旦大学应用统计真题+解析
【MySQL-表结构与完整性约束的修改(ALTER)】
Leetcode. 3. Longest substring without repeated characters - more than 100% solution
Miscellaneous talk on May 27
1. Preliminary exercises of C language (1)
canvas基础1 - 画直线(通俗易懂)
实验七 常用类的使用
Nuxtjs quick start (nuxt2)