当前位置:网站首页>[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;
边栏推荐
猜你喜欢
附加简化版示例数据库到SqlServer数据库实例中
【手撕代码】单例模式及生产者/消费者模式
[hand tearing code] single case mode and producer / consumer mode
. Net6: develop modern 3D industrial software based on WPF (2)
4. Branch statements and loop statements
一段用蜂鸣器编的音乐(成都)
MATLAB打开.m文件乱码解决办法
扑克牌游戏程序——人机对抗
[during the interview] - how can I explain the mechanism of TCP to achieve reliable transmission
C language Getting Started Guide
随机推荐
1. Preliminary exercises of C language (1)
实验四 数组
扑克牌游戏程序——人机对抗
String ABC = new string ("ABC"), how many objects are created
重载和重写的区别
仿牛客技术博客项目常见问题及解答(一)
. Net6: develop modern 3D industrial software based on WPF (2)
力扣152题乘数最大子数组
4. Branch statements and loop statements
撲克牌遊戲程序——人機對抗
7-7 7003 组合锁(PTA程序设计)
7-1 输出2到n之间的全部素数(PTA程序设计)
Implementation of count (*) in MySQL
Nuxtjs快速上手(Nuxt2)
2022 Teddy cup data mining challenge question C idea and post game summary
fianl、finally、finalize三者的区别
QT meta object qmetaobject indexofslot and other functions to obtain class methods attention
Wechat applet
MySQL事务及实现原理全面总结,再也不用担心面试
7-4 散列表查找(PTA程序设计)