当前位置:网站首页>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
边栏推荐
- 【话题终结者】
- [algorithm] sword finger offer2 golang interview question 9: subarray with product less than k
- TYUT太原理工大学往年数据库简述题
- [GNSS data processing] Helmert variance component estimation analysis and code implementation
- 十分钟彻底掌握缓存击穿、缓存穿透、缓存雪崩
- 阿里云微服务(四) Service Mesh综述以及实例Istio
- How do architects draw system architecture blueprints?
- RTKLIB: demo5 b34f. 1 vs b33
- TYUT太原理工大学2022数据库大题之分解关系模式
- 阿里云一面:并发场景下的底层细节 - 伪共享问题
猜你喜欢

Experience summary of autumn recruitment of state-owned enterprises

MySQL 30000 word essence summary + 100 interview questions, hanging the interviewer is more than enough (Collection Series

服务未正常关闭导致端口被占用

Implementation of Excel import and export functions

The port is occupied because the service is not shut down normally

Record: the solution of MySQL denial of access when CMD starts for the first time
![[algorithm] sword finger offer2 golang interview question 10: subarray with sum K](/img/63/7422489d09a64ec9f0e79378761bf1.png)
[algorithm] sword finger offer2 golang interview question 10: subarray with sum K
![[algorithm] sword finger offer2 golang interview question 12: the sum of the left and right sub arrays is equal](/img/11/ee0628a68542236fc641966579a31a.png)
[algorithm] sword finger offer2 golang interview question 12: the sum of the left and right sub arrays is equal

TYUT太原理工大学2022数据库大题之分解关系模式

Basic DOS commands
随机推荐
[算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和
MySQL 三万字精华总结 + 面试100 问,吊打面试官绰绰有余(收藏系列
阿里云微服务(四) Service Mesh综述以及实例Istio
[dry goods] cycle slip detection of suggestions to improve the fixed rate of RTK ambiguity
Tyut Taiyuan University of technology 2022 introduction to software engineering
Realization of the code for calculating the mean square error of GPS Height Fitting
[algorithm] sword finger offer2 golang interview question 12: the sum of the left and right sub arrays is equal
165. Compare version number - string
Abstract classes and interfaces
[Chongqing Guangdong education] reference materials for regional analysis and planning of Pingdingshan University
Record: newinstance() obsolete replacement method
Design a key value cache to save the results of the most recent Web server queries
TYUT太原理工大学2022数据库之关系代数小题
[algorithm] sword finger offer2 golang interview question 5: maximum product of word length
[算法] 剑指offer2 golang 面试题10:和为k的子数组
[GNSS] robust estimation (robust estimation) principle and program implementation
[算法] 剑指offer2 golang 面试题3:前n个数字二进制形式中1的个数
[algorithm] sword finger offer2 golang interview question 9: subarray with product less than k
Employment of cashier [differential constraint]
面试必备:聊聊分布式锁的多种实现!