SQL How to select the lowest grade for a student in a certain time period

Updated on healthy 2024-02-08
17 answers
  1. Anonymous users2024-02-05

    select min(score) from tablename where time>mintime and timemintime and time=starttime> and time<=endtime group by stuid;

    Here's a reference, there's a lot to learn from this web.

  2. Anonymous users2024-02-04

    The meaning is a little less clear, if you want to see the lowest grade for a single student over a period of time:

    select min(score) from tablename where time>=starttime> and time<=endtime and stuid=?;

    See all students' lowest grades in a certain period of time:

    select min(score) from tablename where time>=starttime> and time<=endtime group by stuid;

    The lookout doesn't meet your requirements.

  3. Anonymous users2024-02-03

    select min (grade) as variable from table where time.

    Here's a reference, there's a lot to learn from this web.

  4. Anonymous users2024-02-02

    select * from table where date field = Start Date and Date field = Due Date.

    and convert(char(8),date field,108)=Start time]and convert(char(8),date field,108)<=End time].

    sql serverIt is a relational database management system introduced by Microsoft. It has the advantages of easy to use, good scalability, and high degree of integration with related software.

    It can be used across a wide range of platforms, from laptops running Microsoft Windows 98 to large, multiprocessor servers running Microsoft Windows 2012.

    Microsoft SQL Server is a comprehensive database platform that provides enterprise-grade data management using integrated business intelligence (BI) tools.

    The Microsoft SQL Server database engine provides more secure and reliable storage for relational and structured data, enabling you to build and manage highly available and high-performance data applications for your business.

  5. Anonymous users2024-02-01

    Query each person's highest score sql:

    First, use group by and max to get the highest score and subject, and then check the score table to find records with the same subject and score.

    select b.* from (select max(score) t,course from score group by course) a,score b where and

    The second way: get the highest score in the same subject first, and then query the score table to find the record with the highest scoreSelect * from score a where score=(select max(score) from score where course=

    The third type: in the score table, when the subject is the same, there is no record with a score less than the score of other recordsSelect * from score a where not exists(select * from score where and

  6. Anonymous users2024-01-31

    First, create a table and insert the test data:

    create table test23

    indexh int,name varchar(20),subject varchar(20),grade int

    insert all

    into test23 values(1,'Xiao Zhang','Language',70)into test23 values(2,'Xiao Zhang','English',90)into test23 values(3,'Xiao Wang','Language',89)into test23 values(4,'Xiao Wang','Mathematics',80)into test23 values(5,'Xiao Li','Mathematics',90)into test23 values(6,'Xiao Li','English',70)select * from dual

    Of course, I'm using an oracle database, which may vary from database product to database.

    Then check the record of each person's highest score, and indicate which subject they achieved.

    select * from test23 t1where grade =(select max(grade) from test23 t2 where

    The result of this is:

    indexh name subject grade2 小張 English 90

    3 Xiao Wang, Chinese 89

    5 Xiao Li Math 90

    If you want something else, let me know, ok?

  7. Anonymous users2024-01-30

    You don't know how to describe this question in the first place.

    The highest grade for each person, regardless of the highest in the subject?

    I guess not.

    Do you want to know the record of the highest grades in each subject?

    select username, subject name, max from tablename

    group by username, discipline name order by username, discipline name.

    You can remove the later ones from order by, but I think you need them, and they will be sorted according to each subject for each student.

  8. Anonymous users2024-01-29

    select the work number, max(grade) as the highest score.

    from Transcript.

    group by 工号.

  9. Anonymous users2024-01-28

    select (max(grade field)) from table name group by (ID field for each person).

  10. Anonymous users2024-01-27

    select username, max(grade) from tablename

    group by username.

  11. Anonymous users2024-01-26

    Check out the highest score of each person in a single subject.

    stuscore (table name) score (score column).

    select * from stuscore s1 where score = (select max(score) from stuscore s2 where )

  12. Anonymous users2024-01-25

    Whether your time attribute is stored as a date type or as a character type.

  13. Anonymous users2024-01-24

    select name, sum(performance) as total performance from x group by name.

    Let's see if that works.

  14. Anonymous users2024-01-23

    Goose goose hungry goose goose

  15. Anonymous users2024-01-22

    select name,case when score<60 then fail when score=60 and score<80 then good when score=0 and score<90 then excellent end as result ,from table name.

    Note that when you enter SQL statements, you need to enter them in English. Otherwise, ** is not recognized.

    Extended content: Structured Query Language (SQL) is a database query and programming language used to access data and query, update, and manage relational database systems. SQL statements are a language that operates on databases.

    Some examples of SQL statements are as follows:

    Database: create database database-name

    To delete data, drop database dbname

    Create table tabname(col1 type1 [not null] [primary key],col2 type2 [not null],

    Delete a new table: drop table tabname

    Added: alter table tabname add column col type

    Set the primary key: alter table tabname add primary key(col).

    Delete the primary key: alter table tabname drop primary key (col).

    Create [unique] index idxname on tabname(col.....))

    To delete an index, drop index idxname

    Create View ViewName as Select Statement

    Drop View ViewName

  16. Anonymous users2024-01-21

    select sname,sno,sscore,status=case when sscore <60 then'Fail' when sscore >=60 and sscore <80 then 'Good when sscore>=80 and sscore <90 then'Excellent' when sscore >=90 then 'Excellent' end

    from Student Table.

    You can give it a try.

  17. Anonymous users2024-01-20

    --Use the windowing function to sort each user's grades.

    select * from

    select t.*,row number(partition by username order by result desc) as flag from table name t).

    where flag <=3

Related questions
6 answers2024-02-08

First of all, whether you are an interesting woman or an interesting man, you must learn to read. People who read books are really interesting. I once knew a girl who came from a scholarly family, her parents were both university professors, and she started reading from a few years old until she was in her twenties, and every night when she went home and washed up, she had to read for two hours, and she took out a book from her bag to read in her free time. >>>More

8 answers2024-02-08

Don't choose to run away.

I'm sure you can't forget it, and he can't. >>>More

10 answers2024-02-08

The traditional process similar to the New Year's "window cutting" can be used to prepare circuit boards based on copper foil etching method, which is the current mainstream circuit board manufacturing method. Integrated circuit boards, including computers, mobile phones, and various electrical appliances, are all made by this process. >>>More

4 answers2024-02-08

Very good at being a person. Very good at arranging subordinates to do things.

7 answers2024-02-08

There are 5 points to being a good father: 1. Have time to spend more time with your children. 2. Help your wife with housework. 3. Don't spoil your children. 4. Lead by example and be a good example. 5. Pay more attention to children's growth.