当前位置:网站首页>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
边栏推荐
- Record: newinstance() obsolete replacement method
- 抽象类和接口
- Sharing ideas of on-chip transplantation based on rtklib source code
- Tyut Taiyuan University of technology 2022 introduction to software engineering examination question outline
- TYUT太原理工大学2022软工导论简答题
- [算法] 剑指offer2 golang 面试题12:左右两边子数组的和相等
- isEmpty 和 isBlank 的用法区别
- [算法] 剑指offer2 golang 面试题6:排序数组中的两个数字之和
- Wechat applet development experience
- 初识指针笔记
猜你喜欢
[算法] 剑指offer2 golang 面试题3:前n个数字二进制形式中1的个数
One article to get UDP and TCP high-frequency interview questions!
The earth revolves around the sun
Rt-ppp test using rtknavi
String类
[算法] 剑指offer2 golang 面试题12:左右两边子数组的和相等
Fundamentals of UD decomposition of KF UD decomposition [1]
Application architecture of large live broadcast platform
阿里云一面:并发场景下的底层细节 - 伪共享问题
Record: the solution of MySQL denial of access when CMD starts for the first time
随机推荐
First acquaintance with C language (Part 2)
国企秋招经验总结
Novatel board oem617d configuration step record
TYUT太原理工大学2022数据库之关系代数小题
Inheritance and polymorphism (Part 2)
Record: newinstance() obsolete replacement method
Answer to "software testing" exercise: Chapter 1
记录:newInstance()过时的代替方法
TYUT太原理工大学2022数据库大题之分解关系模式
[算法] 剑指offer2 golang 面试题7:数组中和为0的3个数字
TYUT太原理工大学往年数据库简述题
Rt-ppp test using rtknavi
4.30 dynamic memory allocation notes
[算法] 剑指offer2 golang 面试题12:左右两边子数组的和相等
[算法] 剑指offer2 golang 面试题5:单词长度的最大乘积
[GNSS] robust estimation (robust estimation) principle and program implementation
WSL common commands
Record: solution of 404 error of servlet accessing database in dynamic web project
Music playback (toggle & playerprefs)
[untitled]