First question: finding the root of a two-second equationpublic class Lianxi1 {public static void main (string[] Args) {System.out.println ("please Enter a value");Scanner sc = new Scanner (system.in);String A=sc.nextline ();int x = Integer.parseint (a);If (x!=0){System.out.println ("please Enter the value of b");Scanner SC1 =new Scanner (system.in);System.out.println ("please Enter the value of c");Scanner SC2 =new Scanner (system.in);String B=sc1.ne
object that is created during deserialization is replaced directly with the object returned in Readresolve ().
Private Object Readresolve () throws objectstreamexception {return instance;
}} package Com.iter.devbox.singleton;
Import Java.io.FileInputStream;
Import Java.io.FileOutputStream;
Import Java.io.ObjectInputStream;
Import Java.io.ObjectOutputStream; public class Client2 {public static void Main (string[] args) throws Exception {SingletonDemo6 SC1 = singletondemo6.getinstance ();
Si
(' A ', ' B ')GROUP by SNO) SC WHERE S.SNO=SC. SNOQuestion FourList all students with "1" Grade score higher than 2nd classSELECT S.sno,s.snameFrom S,SC SC1,SC SC2WHERE SC1. cno= ' 1 'and SC2. sno= ' 2 'and SC1. Cno=s.cnoand SC1. SCGRADE>SC2. ScgradeQuestion FiveList the number of students with "1" class scores higher than "2" and their "1" coursesAnd the results of the "2" course.SELECT SC1. The result of
* from C, Sc Where c.cno = Sc.cno and cteacher = ' Li Ming ' and sc.sno = S.sno); Select Sname as student name From s where Sno not in (Select Sno from C, Sc Where c.cno = Sc.cno and cteacher = ' Li Ming '); /c13>2. List of the names of students with two or more (including two) failed courses and their average scores Select S.sno as student number, s.sname as student name, AVG (Sc.scgrade) as average score from S, Sc Where sc.sno = s.sno
and Sc.sno in (Select sc.sno from Sc Where sc.sc
the id,hibernate and do not follow the @id to make the table, Instead, they are generated based on the intermediate table score of the student class and the course entity class.Since the generated table is not compatible with our purpose, so we can choose to manually build the table with the following statement:Test the Save method, which is the persisted objectThere is a student who has studied two courses and has two grades.@Testpublic void Testsave () {/ * * There was a student who took a co
(Representative) of all students whose score is lower than the course number 001)
Select's # ', sname from (select student.'s # ', student. sname, score, (select score from SC SC _2 where student.'s # '= SC _2.'s # 'and SC _2. 'C # '= 2) score2 from student, SC where
SC.'s # '= student.'s #' and SC. 'C # '= 1) s_2 where score2 9. query the student ID and name of the student who has not completed all the courses
Select student.'s # ', Sname from student, SC where student.'s # '= SC.'s # 'group b
1, First Use = for static member variable assignment, from top to bottom, then assign value, there is no = number, the default value;2, execute static constructor, assign value to static member variable;3, First Use = for the instance member variable assignment, from top to bottom, then assign a value, there is no = number, the default value;4, executes the instance constructor, assigns the value to the instance member variable;1 usingSystem;2 usingSystem.Collections.Generic;3 usingSystem.Linq;4
name;
SELECT DISTINCT (sc. ' s# '), sname from student, SC where student. ' s# ' =sc. ' s# ' and ' C # ' in (SELECT ' C # ' from SC where ' s# ' =00 2)
11. The grade of "cotyledons" teacher in the "SC" table is changed to the average grade of the course;
Update SC INNER JOIN
(select SC2. ' C # ', AVG (Sc2.score) score from SC sc2, teacher, course where
locates the first occurrence of* C (converted to a char) in the string pointed to S.* The terminating null character is considered part of the string;* Therefore if C is ' + ', the functions locate the terminating '.* RETURN VALUES* The Functions STRCHR () return a pointer to the located* character, or NULL if the character does not appear in the string.*/#include char * (STRCHR) (const char *s, int c){const char ch = (char) c;const char *SC;for (sc = 0;; ++s){if (*s = = ch)sc = s;if (17)Return
name of at least one course with the student ID "002;Select distinct (SC.'s # '), sname from student, SC where student.'s # '= SC.'s # 'and 'C #' in (select 'C # 'from SC where's #' = 002)11. Change the average score of the Course taught by instructor ye Ping in the SC table;Update SC inner join(Select sc2. 'C # ', avg (sc2.score) score from SC sc2, teacher, cou
student ID and name of at least one course with the student ID "002;Select distinct (SC.'s # '), sname from student, SC where student.'s # '= SC.'s # 'and 'C #' in (select 'C # 'from SC where's #' = 002)11. Change the average score of the Course taught by instructor ye Ping in the SC table;
Update SC inner join(Select sc2. 'C # ', avg (sc2.score) score from SC sc2
Enter a certain day of the year, judging the day is the first of the year?1Scanner SC2 =NewScanner (system.in);2System.out.println ("Please enter the year:");3 intYear=sc2.nextint ();4System.out.println ("Please enter month:");5 intMonth=sc2.nextint ();6System.out.println ("Please Enter Date:");7 intday=
From the php Singleton mode to the creation method of php Objects, I recently went to the interview. I encountered a problem in Singleton mode and learned something I did not expect. Although the interview failed, but it's good. Share with you.
Php runs as a process. we ignore the problem of multithreading and do not need to lock the attribute. Common Singleton mode classes.
In a singleton mode, sometimes a class in a process only runs on one instance.
This is the common singleton mode.
Class Si
SCwhere cla_No in ("1001","1002")group by stu_No having count(distinct cla_No)=2)
4. List the student IDs of all students whose score is higher than that of the course number 002
select stu_No from sc awhere a.score>(select score from scwhere sc.stu_No="002" and sc.cla_No="1001")and a.cla_No="1001"
5. List the student IDs of all students whose scores are higher than those of Lesson 1001 and their scores of Lesson 1 and Lesson 2
select sc1.stu_No,sc1.score cla1001,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.