当前位置:网站首页>Database experiment report (II)
Database experiment report (II)
2022-07-01 10:46:00 【Billy Miracle】
One 、 The experiment purpose
master SQL Basic specification of programming , Skilled use SQL Language to achieve basic data query , Including single table query 、 Grouping statistical query and connection query . Master the use of view . master SQL Design methods of various advanced queries such as nested queries and set queries . Familiar with database data update operation , Able to use SQL Statement to insert data into the database 、 modify 、 Delete operation . be familiar with SQL Language about view operation , Be able to use SQL Statement to create the desired view , Define the schema outside the database , And can use the created view to realize data management .
Two 、 Experimental content
- Inquire about SC All the data in the table .
- Check the name and age of computer students
- The results are in 70~80 The student number of the student 、 Course number and grades
- The age of the computer department is in 18~20 Name and age of male student aged
- Inquire about C001 The highest score of the course
- Query the maximum age and minimum age of computer students
- Count the number of students in each department
- Count the number of candidates and the highest grades of each course
- Calculate the number of courses selected by each student and the total score of the exam , And display the results in ascending order according to the number of courses selected
- List total scores exceeding 200 Student number and total score of students
- The query selected C002 Name and Department of students in the course
- Check the test results 80 Names of students with scores above 、 Course number and grades , And arrange the results in descending order
- Query and VB The course name and semester of the course offered in the same semester
- Query the names of students of the same age as Li Yong 、 Age and department
- Check which courses no students choose , List the course number and course name
- Check the course selection of each student , Including students who did not choose courses , List the student number 、 full name 、 Selected course number
- Check which students in the computer department did not choose courses , List student names
- Check the names and ages of the three oldest students in the computer department ,top 3
- List “VB” Student number of the top three students in the course examination 、 full name 、 Department and VB achievement ,top3
- Query the top students with the largest number of courses 2 Students , List the student number and the number of courses selected , top 2
- Inquire about the results of the Department of Communication Engineering 80 Student number and name of the above students
- Query the names of students whose examination scores of computer department students are higher than the average scores of computer department students 、 The course name and examination result of the exam
- Count the number of students selected for each course , Including courses with candidates and courses without candidates , List course number , The number of students and the situation of course selection , The course selection is : If the number of candidates for this course exceeds 100 people , Is displayed “ More people ”; If the number of candidates for this course is 40~100, Is displayed “ commonly ”; If the number of candidates for this course is 1~40, Is displayed “ Fewer people ”; If there is no candidate for this course , Is displayed “ No candidate ”.
- Delete the basic information of courses without candidates
- Contains the student's student number 、 full name 、 Department 、 Age , Course no. 、 Course name 、 View of course credits
- Contains the student's student number 、 full name 、 View of elective course names and examination scores
- Count the number of students in each course , It is required to list the student number and the number of courses selected
- Count the total credits of each student , It is required to list the view of student student number and total credits ( explain : The examination result is greater than or equal to 60 To get credits for this course ).
- Use the view to query that the exam score is greater than or equal to 90 The names of the students 、 Course name and grade .
- Use the view to query the number of courses selected exceeds 3 The student number and the number of courses selected by the students of the course .
- Using the view to query the number of courses selected by the computer department exceeds 3 The name of the student and the number of courses selected .
- Use the view to query the total credits of courses more than 10 The student number of the student 、 full name 、 Total credits of department and courses .
- Use the view to query whether the age is greater than or equal to 20 Among the students aged , The total credits of courses are more than 10 The names of the students 、 Age 、 Total credits of department and courses .
- Create another “ Department of Computer Science ” Student number of the student 、 full name 、 Department 、 Age , Course no. 、 Course name 、 View of course credits .
Add a record ,
0841101 Zhang Xin Department of Computer Science 20 C001 Advanced mathematics 4
Modify this record as
0841101 Zhang Xin physics department 20 C001 Advanced mathematics 4
3、 ... and 、 Experimental environment
MySQL、Navicat 15 for MySQL
Four 、 Preparation before experiment
experimental data , Use the tables and data created in the first experiment
5、 ... and 、 The experimental steps
Inquire about SC All the data in the table .
Check the name and age of computer students , And use an alias
The results are in 70~80 The student number of the student 、 Course number and grades
The age of the computer department is in 18~20 Name and age of male student aged
Inquire about C001 The highest score of the course
Query the maximum age and minimum age of computer students
Count the number of students in each department
Count the number of candidates and the highest grades of each course
Calculate the number of courses selected by each student and the total score of the exam , And display the results in ascending order according to the number of courses selected
List total scores exceeding 200 Student number and total score of students
The query selected C002 Name and Department of students in the course
Check the test results 80 Names of students with scores above 、 Course number and grades , And arrange the results in descending order
Query and VB The course name and semester of the course offered in the same semester
Query the names of students of the same age as Li Yong 、 Age and department
Check which courses no students choose , List the course number and course name
Check the course selection of each student , Including students who did not choose courses , List the student number 、 full name 、 Selected course number
Check which students in the computer department did not choose courses , List student names
Check the names and ages of the three oldest students in the computer department ,top 3
List “VB” Student number of the top three students in the course examination 、 full name 、 Department and VB achievement ,top3
Query the top students with the largest number of courses 2 Students , List the student number and the number of courses selected , top 2
Inquire about the results of the Department of Communication Engineering 80 Student number and name of the above students
Query the names of students whose examination scores of computer department students are higher than the average scores of computer department students 、 The course name and examination result of the exam
Count the number of students selected for each course , Including courses with candidates and courses without candidates , List course number , The number of students and the situation of course selection , The course selection is : If the number of candidates for this course exceeds 100 people , Is displayed “ More people ”; If the number of candidates for this course is 40~100, Is displayed “ commonly ”; If the number of candidates for this course is 1~40, Is displayed “ Fewer people ”; If there is no candidate for this course , Is displayed “ No candidate ”.
Delete the basic information of courses without candidates
Contains the student's student number 、 full name 、 Department 、 Age , Course no. 、 Course name 、 View of course credits
Contains the student's student number 、 full name 、 View of elective course names and examination scores
Count the number of students in each course , It is required to list the student number and the number of courses selected
Count the total credits of each student , It is required to list the view of student student number and total credits ( explain : The examination result is greater than or equal to 60 To get credits for this course ).
Use the view to query that the exam score is greater than or equal to 90 The names of the students 、 Course name and grade .
Use the view to query the number of courses selected exceeds 3 The student number and the number of courses selected by the students of the course .
Using the view to query the number of courses selected by the computer department exceeds 3 The name of the student and the number of courses selected
Use the view to query the total credits of courses more than 10 The student number of the student 、 full name 、 Total credits of department and courses .
Use the view to query whether the age is greater than or equal to 20 Among the students aged , The total credits of courses are more than 10 The names of the students 、 Age 、 Total credits of department and courses .
Create another “ Department of Computer Science ” Student number of the student 、 full name 、 Department 、 Age , Course no. 、 Course name 、 View of course credits .
Add a record ,
0841101 Zhang Xin Department of Computer Science 20 C001 Advanced mathematics 4
Modify this record as
0841101 Zhang Xin physics department 20 C001 Advanced mathematics 4
6、 ... and 、 experimental result
Inquire about SC All the data in the table .
Check the name and age of computer students
The results are in 70~80 The student number of the student 、 Course number and grades
The age of the computer department is in 18~20 Name and age of male student aged
Inquire about C001 The highest score of the course
Query the maximum age and minimum age of computer students
Count the number of students in each department
Count the number of candidates and the highest grades of each course
Calculate the number of courses selected by each student and the total score of the exam , And display the results in ascending order according to the number of courses selected
List total scores exceeding 200 Student number and total score of students
The query selected C002 Name and Department of students in the course
Check the test results 80 Names of students with scores above 、 Course number and grades , And arrange the results in descending order
Query and VB The course name and semester of the course offered in the same semester
Query the names of students of the same age as Li Yong 、 Age and department
Check which courses no students choose , List the course number and course name
Check the course selection of each student , Including students who did not choose courses , List the student number 、 full name 、 Selected course number
Check which students in the computer department did not choose courses , List student names
Check the names and ages of the three oldest students in the computer department ,top 3
List “VB” Student number of the top three students in the course examination 、 full name 、 Department and VB achievement ,top3
Query the top students with the largest number of courses 2 Students , List the student number and the number of courses selected , top 2
Inquire about the results of the Department of Communication Engineering 80 Student number and name of the above students
Query the names of students whose examination scores of computer department students are higher than the average scores of computer department students 、 The course name and examination result of the exam
Count the number of students selected for each course , Including courses with candidates and courses without candidates , List course number , The number of students and the situation of course selection , The course selection is : If the number of candidates for this course exceeds 100 people , Is displayed “ More people ”; If the number of candidates for this course is 40~100, Is displayed “ commonly ”; If the number of candidates for this course is 1~40, Is displayed “ Fewer people ”; If there is no candidate for this course , Is displayed “ No candidate ”.
Delete the basic information of courses without candidates
Contains the student's student number 、 full name 、 Department 、 Age , Course no. 、 Course name 、 View of course credits
Contains the student's student number 、 full name 、 View of elective course names and examination scores
Count the number of students in each course , It is required to list the student number and the number of courses selected
Count the total credits of each student , It is required to list the view of student student number and total credits ( explain : The examination result is greater than or equal to 60 To get credits for this course ).
Use the view to query that the exam score is greater than or equal to 90 The names of the students 、 Course name and grade .
Use the view to query the number of courses selected exceeds 3 The student number and the number of courses selected by the students of the course .
Using the view to query the number of courses selected by the computer department exceeds 3 The name of the student and the number of courses selected .
Use the view to query the total credits of courses more than 10 The student number of the student 、 full name 、 Total credits of department and courses .
Use the view to query whether the age is greater than or equal to 20 Among the students aged , The total credits of courses are more than 10 The names of the students 、 Age 、 Total credits of department and courses .
Create another “ Department of Computer Science ” Student number of the student 、 full name 、 Department 、 Age , Course no. 、 Course name 、 View of course credits .
Add a record ,
0841101 Zhang Xin Department of Computer Science 20 C001 Advanced mathematics 4
Modify this record as
0841101 Zhang Xin physics department 20 C001 Advanced mathematics 4
Be careful : You cannot modify two tables at the same time on a view connected by multiple associated tables .
边栏推荐
- PHP realizes lottery function
- NC | 肠道细胞和乳酸菌共同作用来防止念珠菌感染
- Matplotlib data visualization Foundation
- 442. duplicate data in array
- Introduction of uniapp wechat applet components on demand
- 基金国际化的发展概况
- 选择在中金证券上炒股开户可以吗?安全吗?
- 程序员都想去国企?技术落后薪资低,躺平几年出来都找不到工作...
- Simulink simulation circuit model of open loop buck buck buck chopper circuit based on MATLAB
- Suggest collecting | what to do when encountering slow SQL on opengauss?
猜你喜欢
bash: ln: command not found
新品大揭秘!雅迪冠能 3 多元产品矩阵,满足全球用户出行需求
【MPC】②quadprog求解正定、半正定、负定二次规划
SQL server2014 failed to delete the database, with an error offset of 0x0000
. Net 5.0+ does not need to rely on third-party native implementation of scheduled tasks
Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
Suggest collecting | what to do when encountering slow SQL on opengauss?
Sqlachemy common operations
[.net6] use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
12 product management platforms that everyone is using
随机推荐
[encounter Django] - (II) database configuration
SQL SERVER2014删除数据库失败,报错偏移量0x0000...
12 product management platforms that everyone is using
Introduction of uniapp wechat applet components on demand
关于#数据库#的问题:GBase 8s中如何避免死锁
新品大揭秘!雅迪冠能 3 多元产品矩阵,满足全球用户出行需求
Lack of comparator, operational amplifier to save the field! (the op amp is recorded as a comparator circuit)
Wireshark TS | confusion between fast retransmission and out of sequence
bash: ln: command not found
dotnet 控制台 使用 Microsoft.Maui.Graphics 配合 Skia 进行绘图入门
华为HMS Core携手超图为三维GIS注入新动能
Matplotlib数据可视化基础
个人商城二开逍遥B2C商城系统源码-可商用版/拼团拼购优惠折扣秒杀源码
Valgrind usage of memory leak locating tool
12款大家都在用的产品管理平台
106. 从中序与后序遍历序列构造二叉树
Can MySQL CDC take out the op field
客户端如何请求数据库?
Which securities company has a low, safe and reliable Commission for stock trading and account opening
关于#SQL#的问题,如何解决?