当前位置:网站首页>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 12: the sum of the left and right sub arrays is equal
- TYUT太原理工大学2022数据库之关系代数小题
- First acquaintance with C language (Part 2)
- 服务未正常关闭导致端口被占用
- Problems and solutions of robust estimation in rtklib single point location spp
- Rt-ppp test using rtknavi
- [算法] 剑指offer2 golang 面试题12:左右两边子数组的和相等
- TYUT太原理工大学2022软工导论简答题
- 2-year experience summary, tell you how to do a good job in project management
- [algorithm] sword finger offer2 golang interview question 1: integer division
猜你喜欢

System design learning (I) design pastebin com (or Bit.ly)

【无标题】
![[algorithm] sword finger offer2 golang interview question 6: sum of two numbers in the sorting array](/img/d5/4bda133498f71ae9fd7a64c6cba8f0.png)
[algorithm] sword finger offer2 golang interview question 6: sum of two numbers in the sorting array

染色法判定二分图

Rt-ppp test using rtknavi
![[算法] 剑指offer2 golang 面试题9:乘积小于k的子数组](/img/65/fc3fb5a217a3b44f506b695af53e2c.png)
[算法] 剑指offer2 golang 面试题9:乘积小于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数据库大题之概念模型设计

2022 National Games RE1 baby_ tree

架构师怎样绘制系统架构蓝图?
随机推荐
平衡二叉树详解 通俗易懂
MySQL shutdown is slow
How do architects draw system architecture blueprints?
How to ensure data consistency between MySQL and redis?
wsl常用命令
First acquaintance with C language (Part 2)
[rtklib 2.4.3 B34] version update introduction I
Answer to "software testing" exercise: Chapter 1
Chromatic judgement bipartite graph
Employment of cashier [differential constraint]
RTKLIB: demo5 b34f. 1 vs b33
[untitled]
Several high-frequency JVM interview questions
4.30 dynamic memory allocation notes
分支语句和循环语句
Inheritance and polymorphism (I)
Record: newinstance() obsolete replacement method
2022 National Games RE1 baby_ tree
Alibaba cloud microservices (I) service registry Nacos, rest template and feign client
异常:IOException:Stream Closed