当前位置:网站首页>Database operation of tyut Taiyuan University of technology 2022 database
Database operation of tyut Taiyuan University of technology 2022 database
2022-07-06 13:12:00 【Lala Lulu^_^】
Question 3
Database operations include 2 Type of question :
The first is to give several groups of relational patterns without data , Perform database operations on it .eg: example 1
The second is to give some structural tables with data , Perform data operations on it .eg: example 2
The examination sites are all chapter four , It's best to summarize all kinds of SQL sentence , Strengthen the memory
Required form :
example 1、
Staff - The union database has three basic tables :
workers ( Employee number , name , Set up the time , Gender );
Labour Union ( Number , name , Person in charge: employee No , Place of activity );
To participate in ( Employee number , Number , Date of participation ).
The primary key of the employee table is the employee number , The primary key of the union table is number , The primary key of the participating table is the employee number and number . The trial SQL Statement does the following :
(1) Define employee table , Including employee No 、 name 、 The gender is character type , The establishment time is integer , The employee number is the primary key ;
(2) The employee number of the person in charge of inquiry is “001” Number and name of the member ;
(3) Check the information of the female employee surnamed Zhang ;
(4) Increase the establishment time of Li Si in the employee list 1.
(5) The query was established on 20 To the age of 30 Employee number of employees between years old 、 Name and date of establishment , And add the establishment time 1 Output ;
(6) The number of the trade union participating in the inquiry is “T1” Employee number .
Explain :
example 2、
In a warehouse management system , There are two tables. :KC Table saves the information and... Of the materials in the current warehouse CKMX Table storage stock Issue details of materials ,
Its structure is as follows :
KC( Material code , Material name , Company , The unit price , Inventory quantity ) The material code is the primary key ;
CKMX( Delivery order No , Material code , Delivery date , Delivery quantity ) The delivery order is the primary key , Material code is foreign key .
- Try to create KC Table and CKMX Tabular SQL sentence , Entity definition and referential integrity are required .
- use SQL The command will be as follows 4-3 And table 4-4 The data of are inserted into KC Table and CKMX In the table .
- Inquire about the number of the computer 、 Delivery date 、 Material name 、 The unit price 、 Delivery information of delivery quantity and amount .
- From the table CKMX Count the delivery times and total delivery quantity of various materials , Try to write SQL sentence .
surface 4-3、KC Table structure and data
Material code | Material name | Company | The unit price | Inventory quantity |
01 | Computer | platform | 5000.00 | 10 |
02 | The TV | platform | 2000.00 | 20 |
surface 4-4、CKMX Table structure and data
Delivery order No | Material code | Delivery date | Delivery quantity |
1 | 01 | 2020-10-10 | 4 |
2 | 01 | 2020-11-20 | 3 |
3 | 02 | 2020-11-20 | 5 |
Explain :
Add : There is a thing called wildcard :a%b Said to a start b Any length string at the end eg:akdhb
use BETWEEN Means to contain eg:20< Time <50 It's written in SQL Have to write Time BETWEEN 20 AND 50
When the teacher draws the key points , Just say that the fourth chapter will come out SQL Language problems ( In previous years ), So there is no summary view here 、 Indexed SQL Sentence notes , Just recite the summary at the beginning of my article , Do a few more examples , The exam is completely enough
边栏推荐
- Rt-ppp test using rtknavi
- 记录:动态Web项目servlet访问数据库404错误之解决
- TYUT太原理工大学2022数据库大题之E-R图转关系模式
- Basic DOS commands
- 十分鐘徹底掌握緩存擊穿、緩存穿透、緩存雪崩
- [algorithm] sword finger offer2 golang interview question 2: binary addition
- Alibaba cloud side: underlying details in concurrent scenarios - pseudo sharing
- TYUT太原理工大学2022数据库之关系代数小题
- 2022国赛Re1 baby_tree
- WSL common commands
猜你喜欢
Edit distance (multi-source BFS)
抽象类和接口
[algorithm] sword finger offer2 golang interview question 4: numbers that appear only once
Music playback (toggle & playerprefs)
The port is occupied because the service is not shut down normally
Role movement in the first person perspective
Several high-frequency JVM interview questions
Design a key value cache to save the results of the most recent Web server queries
[Chongqing Guangdong education] Shandong University College Physics reference materials
How do architects draw system architecture blueprints?
随机推荐
[algorithm] sword finger offer2 golang interview question 13: sum of numbers of two-dimensional submatrix
十分钟彻底掌握缓存击穿、缓存穿透、缓存雪崩
[算法] 剑指offer2 golang 面试题4:只出现一次的数字
Edit distance (multi-source BFS)
KF UD decomposition pseudo code implementation advanced [2]
雇佣收银员【差分约束】
4.30 dynamic memory allocation notes
Code example of MATLAB reading GNSS observation value o file
Comparative analysis of the execution efficiency of MySQL 5.7 statistical table records
初识指针笔记
[algorithm] sword finger offer2 golang interview question 9: subarray with product less than k
TYUT太原理工大学2022软工导论考试题型大纲
阿里云微服务(一)服务注册中心Nacos以及REST Template和Feign Client
[算法] 剑指offer2 golang 面试题10:和为k的子数组
编辑距离(多源BFS)
系统设计学习(一)Design Pastebin.com (or Bit.ly)
Implementation of Excel import and export functions
First acquaintance with C language (Part 2)
WSL common commands
Redis介绍与使用