SQL statement man simple question, high score!

Updated on technology 2024-04-15
7 answers
  1. Anonymous users2024-02-07

    The answer on the 1st floor was incorrect, and the results were not read.

    Let's talk about the idea, create three sub-tables (Chinese, Mathematics, English) to store Chinese scores, mathematics scores, and English scores respectively, and each table only contains two fields (name and subject score).Then combine the three sub-tables according to the same name. The following is SQL, which has been executed, so feel free to use it.

    select language. Name, language. Chinese, Mathematics. Mathematics, English. English.

    from (select name, grade as language.)

    from student

    where (subject =.)'Language')) as language inner join

    Select Name, Grades as Maths.

    from student

    where (subject =.)'Mathematics')) as mathematics on language. Name = Mathematics. Name inner join

    Select Name, Grades as English.

    from student

    where (subject =.)'English. ')) as English on Language. Name = English. Name.

  2. Anonymous users2024-02-06

    select a1.Name, A1Language, A2Mathematics, A3English.

    from (select name, grade as language.)

    from student

    where (subject =.)'Language'a1 inner joinselect name, grade as math.

    from student

    where (subject =.)'Mathematics') a2 on a1.Name = A2Name inner join

    Select Name, Grades as English.

    from student

    where (subject =.)'English. ') a3 on a2.Name = a3Name.

  3. Anonymous users2024-02-05

    Name Subject Grade.

    Zhang San Language 80

    Zhang San Math 90

    Zhang San English 81

    Li Si Language 78

    Li Si Mathematics 69

    Li Si English 97

    The above table is named a

    select Table 1Name as Name, Language, Mathematics, English from select Name, Grade as Language from a whre Subject='Language') as Table 1 ,select name, grade as math from a whre subject='Mathematics') as Table 2 , select name, grade as English from a whre subject='English. 'as Table 3

    where Table 1Name = Table 2Name and Table 2Name = Table 3Name.

  4. Anonymous users2024-02-04

    Select Name, AGrades as Language, BGrades as Mathematics, CGrades as English.

    fromselect name, grade from student where subject='Language') a,select name,grade from student where subject='Mathematics') b,select name,grade from student where subject='English. ') c

    where a.Name = bName and aName = cName.

  5. Anonymous users2024-02-03

    Hehe, there is a simple way to write it, no need to build a sub-table.

    select a.Name = bGrades Yuwen, C

    Grades Shuxue, DGrades Yingyu from Student A, Student B, Student C, Student D

    where a.Name = bName and aName = cName and aName = dName.

    and b.Subjects ='Language' and c.Subjects ='Mathematics' and d.Subjects ='English. '

    It's simple, OK.

  6. Anonymous users2024-02-02

    Upstairs says subqueries, and you can query them with links!

    Tomorrow to revise the problem!

    Write you a link query.

  7. Anonymous users2024-02-01

    Alas, there is a problem with your table construction, which is why your query statement is so complicated to write.

Related questions
5 answers2024-04-15

F get domain contrast is a formatting function (should be written by yourself), the first parameter (arg prod spec id) according to the second parameter (120) formatting and return the result to the v bill code, according to the function naming method, the above ** should be the standard format for getting the date.

5 answers2024-04-15

With a view or an index.

create index >>>More

4 answers2024-04-15

Generally refers to indexing. You don't have to.

6 answers2024-04-15

You need to write a stored procedure that can do the above functionality! After all, what you're describing has a branching structure!

4 answers2024-04-15

select

from[Table name]. >>>More