当前位置:网站首页>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 .
边栏推荐
- 《百年巨匠》数字藏品中奖名单公布
- C [byte array] and [hexadecimal string] mutual conversion - codeplus series
- CRC 校验
- 基金管理人的内部控制
- [matytype] insert MathType inter line and intra line formulas in CSDN blog
- A new round of popularity of digital collections opens
- 北汽蓝谷:业绩承压,极狐难期
- Uncover the secrets of new products! Yadi Guanneng 3 multi product matrix to meet the travel needs of global users
- prism journal导航按钮的可用性探索记录
- I'd like to know where I can open an account in Guangzhou? Is it safe to open an account online now?
猜你喜欢

How to solve the problem of SQL?

Continue to advance, and softcom power steadily promotes cloud intelligence strategy

bash: ln: command not found

【论文阅读】Trajectory-guided Control Prediction for End-to-end Autonomous Driving: A Simple yet Strong Ba

Error: missing revert data in call exception
![[.net6] use ml.net+onnx pre training model to liven the classic](/img/b3/b117481fba7257453011e4cdb1eaaa.png)
[.net6] use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B

机器学习之线性回归详解

C one line code calculates the MD5 value of the file - codeplus series

Addition, deletion, modification and query of database

What a high commission! The new programmer's partner plan is coming. Everyone can participate!
随机推荐
问下群里的各位,有使用flink oracle cdc的logminer方案,在生产上稳定运行的实际
Infinite innovation in cloud "vision" | the 2022 Alibaba cloud live summit was officially launched
[MPC] ② quadprog solves positive definite, semi positive definite and negative definite quadratic programming
【Matytype】在CSDN博客中插入Mathtype行间与行内公式
中国探月工程独家藏品限量发售!
Suggest collecting | what to do when encountering slow SQL on opengauss?
NC | intestinal cells and lactic acid bacteria work together to prevent Candida infection
移动硬盘驱动器读到,但不显示盘符
NC | 肠道细胞和乳酸菌共同作用来防止念珠菌感染
【MPC】②quadprog求解正定、半正定、负定二次规划
2022年现在在网上开通股票账户安全吗?会不会有什么危险?
《百年巨匠》数字藏品中奖名单公布
Error: missing revert data in call exception
内存泄漏定位工具之 valgrind 使用
有大佬知道这是为啥吗?表结构都是刚直接复制的源表 mysql-cdc
Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
数字藏品平台搭建需要注意哪些法律风险及资质?
Who's still buying three squirrels
Guys, how to export iceberg data to MySQL? What tools are there? Neither sqoop nor dataX
Recommend a JSON visualization tool artifact!