当前位置:网站首页>[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;
边栏推荐
- 【VMware异常问题】问题分析&解决办法
- 【MySQL数据库的学习】
- PriorityQueue (large root heap / small root heap /topk problem)
- 7-14 错误票据(PTA程序设计)
- The latest tank battle 2022 - Notes on the whole development -2
- The difference between cookies and sessions
- It's never too late to start. The tramp transformation programmer has an annual salary of more than 700000 yuan
- Get started with typescript
- Custom RPC project - frequently asked questions and explanations (Registration Center)
- [modern Chinese history] Chapter V test
猜你喜欢

ABA问题遇到过吗,详细说以下,如何避免ABA问题

Write a program to simulate the traffic lights in real life.

受检异常和非受检异常的区别和理解

深度强化文献阅读系列(一):Courier routing and assignment for food delivery service using reinforcement learning

Relationship between hashcode() and equals()

1. First knowledge of C language (1)

Nuxtjs快速上手(Nuxt2)

SRC挖掘思路及方法
![[面试时]——我如何讲清楚TCP实现可靠传输的机制](/img/d6/109042b77de2f3cfbf866b24e89a45.png)
[面试时]——我如何讲清楚TCP实现可靠传输的机制

Reinforcement learning series (I): basic principles and concepts
随机推荐
实验九 输入输出流(节选)
Relationship between hashcode() and equals()
【九阳神功】2021复旦大学应用统计真题+解析
Miscellaneous talk on May 27
7-15 h0161. 求最大公约数和最小公倍数(PTA程序设计)
[during the interview] - how can I explain the mechanism of TCP to achieve reliable transmission
实验八 异常处理
FAQs and answers to the imitation Niuke technology blog project (II)
[面试时]——我如何讲清楚TCP实现可靠传输的机制
Beautified table style
ABA问题遇到过吗,详细说以下,如何避免ABA问题
Detailed explanation of redis' distributed lock principle
7-7 7003 组合锁(PTA程序设计)
[the Nine Yang Manual] 2017 Fudan University Applied Statistics real problem + analysis
QT meta object qmetaobject indexofslot and other functions to obtain class methods attention
Caching mechanism of leveldb
String ABC = new string ("ABC"), how many objects are created
[modern Chinese history] Chapter 9 test
[面試時]——我如何講清楚TCP實現可靠傳輸的機制
7-8 7104 约瑟夫问题(PTA程序设计)