当前位置:网站首页>[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;
边栏推荐
猜你喜欢
甲、乙机之间采用方式 1 双向串行通信,具体要求如下: (1)甲机的 k1 按键可通过串行口控制乙机的 LEDI 点亮、LED2 灭,甲机的 k2 按键控制 乙机的 LED1
强化学习基础记录
一段用蜂鸣器编的音乐(成都)
关于双亲委派机制和类加载的过程
Difference and understanding between detected and non detected anomalies
SRC挖掘思路及方法
Service ability of Hongmeng harmonyos learning notes to realize cross end communication
(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
4. Branch statements and loop statements
8. C language - bit operator and displacement operator
随机推荐
Programme de jeu de cartes - confrontation homme - machine
7-7 7003 组合锁(PTA程序设计)
Using spacedesk to realize any device in the LAN as a computer expansion screen
7-14 错误票据(PTA程序设计)
深度强化文献阅读系列(一):Courier routing and assignment for food delivery service using reinforcement learning
Nuxtjs quick start (nuxt2)
仿牛客技术博客项目常见问题及解答(三)
为什么要使用Redis
7-3 构造散列表(PTA程序设计)
扑克牌游戏程序——人机对抗
C language Getting Started Guide
Wechat applet
[au cours de l'entrevue] - Comment expliquer le mécanisme de transmission fiable de TCP
【educoder数据库实验 索引】
Poker game program - man machine confrontation
关于双亲委派机制和类加载的过程
5月14日杂谈
(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-11 机工士姆斯塔迪奥(PTA程序设计)
Nuxtjs快速上手(Nuxt2)