当前位置:网站首页>Database Experiment 2: data update
Database Experiment 2: data update
2022-06-12 05:47:00 【LEO-max】
Experiment two Data update experiment guide
( Data insertion 、 Modification and deletion )
1. The experiment purpose
(1) For those already built in Experiment 1 student、course、sc Three tables for data insertion 、 Modify and delete operations .
(2) Create view 、 Query view 、 Indexing and so on .
(3) Let students fully understand SQL The flexibility of language , Powerful , experience SQL The reason why language has become the standard of relational database operation language .
2. Experimental content
(1) This experiment is based on Experiment 1 , Insert the data records of the three tables in Experiment 1 、 modify 、 Delete updates , And views 、 Index, etc .
3. The experimental requirements
(1) stay student Enter... In the table 6 Bar record .
INSERT INTO student VALUES('0127',' Chenyuqi ',' male ',21,' Department of accounting ');
INSERT INTO student VALUES('0210',' Shaohuichuang ',' male ',22,' Department of accounting ');
INSERT INTO student VALUES('0229',' Qi Junbao ',' male ',20,' Department of telecommunications ');
INSERT INTO student VALUES('0236',' Zhuxiaoying ',' male ',20,' Department of telecommunications ');
INSERT INTO student VALUES('0240',' Wuruobin ',' male ',20,' Department of accounting ');
INSERT INTO student VALUES('0242','LEO',' male ',21,' Department of foreign languages ');
(2) stay course Enter... In the table 4 Bar record .
INSERT INTO course VALUES('1',' database ',3);
INSERT INTO course VALUES('2',' Internet protocol analysis ',2);
INSERT INTO course VALUES('3','Web defense ',3);
INSERT INTO course VALUES('4','JSP Programming ',3);
(3) stay sc Enter... In the table 10 Bar record , Note that there may be multiple candidates for some courses , There may be no candidates for some courses .
INSERT INTO sc VALUES('0127','1',' database ',97);
INSERT INTO sc VALUES('0229','2',' Internet protocol analysis ',96);
INSERT INTO sc VALUES('0236','3','Web defense ',98);
INSERT INTO sc VALUES('0240','4','JSP Programming ',96);
INSERT INTO sc VALUES('0210','1',' database ',98);
INSERT INTO sc VALUES('0242','3','Web defense ',66);
INSERT INTO sc VALUES('0127','2',' Internet protocol analysis ',93);
INSERT INTO sc VALUES('0127','4','JSP Programming ',92);
INSERT INTO sc VALUES('0229','1',' database ',90);
INSERT INTO sc VALUES('0210','2',' Internet protocol analysis ',99);
(4) Practice deleting and modifying data .
DELETE sc WHERE grade<90;
UPDATE student SET sage=18 WHERE sage=20;
(5) Practice adding multiple records 、 Delete and modify .
DELETE FROM sc WHERE grade BETWEEN 90 AND 93;
INSERT INTO sc VALUES('0242','1',' database ',90),('0240','3','Web defense ',94);
(6) to sc Table indexing , First sno in ascending order 、 Press again cno Descending .
CREATE UNIQUE INDEX scon ON sc(sno ASC,cno DESC);
(7) Delete the above index .
DROP INDEX scon ON sc;
(8) Create view view1, Ask for sno,sname,cname,grade Four fields .
CREATE VIEW view1 AS SELECT sno,cno,cname,grade FROM sc;
(9) Create view view2, Ask for sno,ssex,sage Three fields .
CREATE VIEW view2 AS SELECT sno,ssex,sage FROM student;
Ask to write all the code of Experiment 2 ,
Be careful :
1. All the code
2. The full width of the code
3. Regular format , Easy to read
边栏推荐
- [grpc development] go language builds simple server and client
- Details of FPGA syntax
- beginning一款非常优秀的emlog主题v3.1,支持Emlog Pro
- 38. 外观数列
- Leetcode dynamic programming
- yolov5
- nRF52832自定义服务与特性
- Memory model, reference and function supplement of program
- Introduction to thread pool: ThreadPoolExecutor
- What is the lszrz protocol used at ordinary times? Talk about xmodem/ymodem/zmodem
猜你喜欢

Individual application for ov type SSL certificate

Deep understanding of asynchronous programming

论文阅读_图神经网络GIN

yolov5

CCF noi2022 quota allocation scheme

Introduction to Internet Protocol

Leetcode simple problem: converting an integer to the sum of two zero free integers

beginning一款非常优秀的emlog主题v3.1,支持Emlog Pro

Introduction to redis high availability

What is the difference between ArrayList and LinkedList?
随机推荐
[untitled]
数据库实验一:数据定义实验指导
BlockingQueue interface introduction
China's elastic belt market trend report, technical dynamic innovation and market forecast
Laravel8 when search
【js小知识】轻松了解js防抖与节流
[gpio] how to modify / display GPIO status through ADB shell
按键精灵的简单入门
[grpc development] go language builds simple server and client
XML参数架构,同一MTK SW版本兼容两套不同的音频参数
Analysis of pointer
16. Somme des trois plus proches
Flex/fixed upper, middle and lower (mobile end)
WebRTC AEC 流程解析
Optipng can optimize the compressed PNG picture file format
Conversion of Halcon 3D depth map to 3D image
Halcon 3D 1 Reading 3D data
March 4, 2021
Review notes of naturallanguageprocessing based on deep learning
UBI details and JFFS2 square FS UBIFS