当前位置:网站首页>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 .
边栏推荐
- Today in history: the semiconductor war in the late 1990s; Von Neumann published the first draft; CBS acquires CNET
- 442. duplicate data in array
- How to solve the problem of SQL?
- 价值1000毕业设计校园信息发布平台网站源码
- MySQL常用命令
- Valgrind usage of memory leak locating tool
- Zero foundation software testing must see, 10 years of testing old bird's conscience suggestions (a total of 15)
- 【Matytype】在CSDN博客中插入Mathtype行间与行内公式
- NC | intestinal cells and lactic acid bacteria work together to prevent Candida infection
- IDEA运行报错Command line is too long. Shorten command line for...
猜你喜欢

【Matytype】在CSDN博客中插入Mathtype行间与行内公式

移动硬盘驱动器读到,但不显示盘符

Wireshark TS | confusion between fast retransmission and out of sequence

【MPC】②quadprog求解正定、半正定、负定二次规划

What if the win11 account is locked and unable to log in? Win11 account is locked and unable to log in

bash: ln: command not found

SQL SERVER2014删除数据库失败,报错偏移量0x0000...

CRC 校驗

商城小程序源码开源版-可二开

NC | intestinal cells and lactic acid bacteria work together to prevent Candida infection
随机推荐
JS基础--数据类型
华为HMS Core携手超图为三维GIS注入新动能
NC | 肠道细胞和乳酸菌共同作用来防止念珠菌感染
Kotlin coprocessor scheduling switch threads it's time to unravel the truth
[MPC] ② quadprog solves positive definite, semi positive definite and negative definite quadratic programming
价值1000毕业设计校园信息发布平台网站源码
How to get the maximum value of column two and regenerate the table when the SQL Server column one is the same
【Laravel 】faker数据填充详解
数字藏品新一轮热度开启
数字藏品市场新局面
Is it safe to open a stock account online in 2022? Is there any danger?
What a high commission! The new programmer's partner plan is coming. Everyone can participate!
CRC verification
dotnet 控制台 使用 Microsoft.Maui.Graphics 配合 Skia 进行绘图入门
Valgrind usage of memory leak locating tool
What should I learn in the zero foundation entry test? It's the most comprehensive. Just learn from it
C# [字节数组]与[16进制字符串]互相转换 - CodePlus系列
数字藏品平台搭建需要注意哪些法律风险及资质?
Can I choose to open an account on CICC securities? Is it safe?
大佬们,数据湖iceberg的数据,怎样导出到mysql? 有什么工具? sqoop,datax都没