当前位置:网站首页>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
边栏推荐
- Tyut Taiyuan University of technology 2022 introduction to software engineering
- Dark chain lock (lca+ difference on tree)
- Inheritance and polymorphism (I)
- 初识C语言(下)
- [algorithm] sword finger offer2 golang interview question 8: the shortest subarray with a sum greater than or equal to K
- [算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和
- 几道高频的JVM面试题
- Inheritance and polymorphism (Part 2)
- [算法] 剑指offer2 golang 面试题9:乘积小于k的子数组
- GNSS positioning accuracy index calculation
猜你喜欢
随机推荐
MySQL backup -- common errors in xtrabackup backup
121 distributed interview questions and answers
2022 National Games RE1 baby_ tree
RTKLIB: demo5 b34f. 1 vs b33
Music playback (toggle & playerprefs)
[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity
[algorithm] sword finger offer2 golang interview question 1: integer division
抽象类和接口
[algorithm] sword finger offer2 golang interview question 3: the number of 1 in the binary form of the first n numbers
[algorithm] sword finger offer2 golang interview question 7: 3 numbers with 0 in the array
[Chongqing Guangdong education] reference materials for regional analysis and planning of Pingdingshan University
[GNSS] robust estimation (robust estimation) principle and program implementation
How to ensure data consistency between MySQL and redis?
Problems and solutions of robust estimation in rtklib single point location spp
Error: sorting and subscript out of bounds
Introduction and use of redis
[algorithm] sword finger offer2 golang interview question 12: the sum of the left and right sub arrays is equal
[算法] 剑指offer2 golang 面试题5:单词长度的最大乘积
10 minutes pour maîtriser complètement la rupture du cache, la pénétration du cache, l'avalanche du cache
Record: Navicat premium can't connect to MySQL for the first time


![Heap sort [handwritten small root heap]](/img/f0/6efda3c6f499a32671a935dd2f21db.png)


![[算法] 剑指offer2 golang 面试题3:前n个数字二进制形式中1的个数](/img/64/0f352232359c7d44f12b20a64c7bb4.png)



