Home > database >  Beginners turn
Beginners turn

Time:09-26

How to make use of storage for class examinee, test scores and 59 minutes, automatically add 1 cent

CodePudding user response:

The create proc Queryscore
(
@ Switch int,
@ name varchar (50)
)
As
If @ Switch=59
- the highest score
The begin
The update table set score=60 where name=@ name
end

CodePudding user response:

The update table name set result field name=60 where result field name=59

CodePudding user response:

The update tbname set results have been==+ 1 where 59 and class='meet the conditions of the class'
If there is no direct class field results in the table, you can like this:
Update tbname set results have been==+ 1 where 59 and the exists (select classes from students watch the where students. Student number=result table. The student number and student table. Class='meet the conditions of the class)

CodePudding user response:

Back to take it so seriously, the somebody else all don't take the knot

CodePudding user response:

Beginners in learning, the standard answer on the ground floor,

CodePudding user response:

Basic command MySql DDL DML

http://www.verejava.com/? Id=1717411998521

CodePudding user response:

The update table name set result field name=60 where result field name=59

CodePudding user response:

DELIMITER//
Create procedure add_count (independence idx in int, in sum int) - the incoming two parameters, one for the student's ID, to score
The begin
Declare sum1 int.
If the sum=59 then - if the score is 59, then add 1
The set sum1=sum + 1;
Update tb_name set grades=sum1 where id=independence idx;
End fi;
End//
DELIMITER.
Or update statement can directly into the update tb_name set grades=60 where id=independence idx;
  • Related