当前位置:网站首页>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 .
边栏推荐
- SQL optimization - in and not in, exist
- Ask everyone in the group about the fact that the logminer scheme of flick Oracle CDC has been used to run stably in production
- The exclusive collection of China lunar exploration project is limited to sale!
- CRC verification
- 106. construct binary tree from middle order and post order traversal sequence
- CRC 校驗
- [MPC] ① quadratic programming problem matlab solver quadprog
- 问下群里的各位,有使用flink oracle cdc的logminer方案,在生产上稳定运行的实际
- Huawei HMS core joins hands with hypergraph to inject new momentum into 3D GIS
- Button button clear border
猜你喜欢

零基础入门测试该学什么?最全整理,照着学就对了

The exclusive collection of China lunar exploration project is limited to sale!

The Lantern Festival is held on the fifteenth day of the first month, and the Lantern Festival begins to celebrate the reunion
![C# [字节数组]与[16进制字符串]互相转换 - CodePlus系列](/img/d2/dad88f53701c7cd7638bd4983cbb4b.png)
C# [字节数组]与[16进制字符串]互相转换 - CodePlus系列

In the new database era, don't just learn Oracle and MySQL

Error: missing revert data in call exception
![[dark horse morning post] Yu Minhong said he never looked at the stock price of New Oriental; Hengchi 5 will start pre-sale in July; Naixue virtual stock or suspected of illegal fund-raising; From Jul](/img/58/8d5c78d919ed60bc833ec4daa22e23.jpg)
[dark horse morning post] Yu Minhong said he never looked at the stock price of New Oriental; Hengchi 5 will start pre-sale in July; Naixue virtual stock or suspected of illegal fund-raising; From Jul

bash: ln: command not found

Wireshark TS | confusion between fast retransmission and out of sequence

NC | intestinal cells and lactic acid bacteria work together to prevent Candida infection
随机推荐
106. construct binary tree from middle order and post order traversal sequence
Can I choose to open an account on CICC securities? Is it safe?
In the new database era, don't just learn Oracle and MySQL
毕业季·进击的技术er
Half of 2022 has passed, isn't it sudden?
选择在中金证券上炒股开户可以吗?安全吗?
Handling distributed transactions with powerful dbpack (PHP tutorial)
使用强大的DBPack处理分布式事务(PHP使用教程)
基于Matlab的开环Buck降压斩波电路Simulink仿真电路模型搭建
CRC verification
Who's still buying three squirrels
php 实现抽奖功能
[dark horse morning post] Yu Minhong said he never looked at the stock price of New Oriental; Hengchi 5 will start pre-sale in July; Naixue virtual stock or suspected of illegal fund-raising; From Jul
【MPC】①二次规划问题MATLAB求解器quadprog
Does anyone know why? The table structure is the source table MySQL CDC that has just been directly copied
[.net6] use ml.net+onnx pre training model to liven the classic "Huaqiang buys melons" in station B
数据库的增删改查问题
Suggest collecting | what to do when encountering slow SQL on opengauss?
《百年巨匠》数字藏品中奖名单公布
The Lantern Festival is held on the fifteenth day of the first month, and the Lantern Festival begins to celebrate the reunion