当前位置:网站首页>[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;
边栏推荐
- Mortal immortal cultivation pointer-2
- 【黑马早报】上海市监局回应钟薛高烧不化;麦趣尔承认两批次纯牛奶不合格;微信内测一个手机可注册俩号;度小满回应存款变理财产品...
- Leetcode. 3. Longest substring without repeated characters - more than 100% solution
- [the Nine Yang Manual] 2018 Fudan University Applied Statistics real problem + analysis
- Safe driving skills on ice and snow roads
- 7-14 错误票据(PTA程序设计)
- 7-15 h0161. 求最大公约数和最小公倍数(PTA程序设计)
- Implementation principle of automatic capacity expansion mechanism of ArrayList
- Nuxtjs快速上手(Nuxt2)
- (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
猜你喜欢

Difference and understanding between detected and non detected anomalies

4. Branch statements and loop statements

8. C language - bit operator and displacement operator

仿牛客技术博客项目常见问题及解答(一)

A comprehensive summary of MySQL transactions and implementation principles, and no longer have to worry about interviews

1143_ SiCp learning notes_ Tree recursion

FAQs and answers to the imitation Niuke technology blog project (III)

fianl、finally、finalize三者的区别

Principles, advantages and disadvantages of two persistence mechanisms RDB and AOF of redis
![[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](/img/d7/4671b5a74317a8f87ffd36be2b34e1.jpg)
[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
随机推荐
力扣152题乘数最大子数组
[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
[面试时]——我如何讲清楚TCP实现可靠传输的机制
3. C language uses algebraic cofactor to calculate determinant
7-8 7104 约瑟夫问题(PTA程序设计)
2022泰迪杯数据挖掘挑战赛C题思路及赛后总结
强化学习系列(一):基本原理和概念
UGUI—Text
关于双亲委派机制和类加载的过程
深度强化文献阅读系列(一):Courier routing and assignment for food delivery service using reinforcement learning
TypeScript快速入门
一段用蜂鸣器编的音乐(成都)
[the Nine Yang Manual] 2018 Fudan University Applied Statistics real problem + analysis
Mortal immortal cultivation pointer-2
Nuxtjs quick start (nuxt2)
Mode 1 two-way serial communication is adopted between machine a and machine B, and the specific requirements are as follows: (1) the K1 key of machine a can control the ledi of machine B to turn on a
3. Input and output functions (printf, scanf, getchar and putchar)
抽象类和接口的区别
PriorityQueue (large root heap / small root heap /topk problem)
重载和重写的区别