The day before yesterday, Star 2 showed his true face in South Korea. I was excited. Why do I go to an internet cafe at noon every day in junior high school? StarCraft and quake3. Haha, the next plan seems to be postponed. It will take one of the reference items that run SC2. however, blizzard seems to like to skip the ticket for a long time... There have been a lot of things over the past few days. Please hurry up and try again.
Update:The teacher
Environment Introduction:Os:centos 6.4 x86_64 MinimalServers:sc2-log1,sc2-log2,sc2-log3,sc2-log4Client:sc2-ads15
Specific steps:1. Install the Glusterfs package on Sc2-log{1-4}:
The code is as follows
Copy Code
# wget-p/ETC/YUM.REPOS.D Http://download.gluster.org/pub/gluster/glusterfs/LATE
Background Introduction:The project is currently in the file synchronization with Rsync, in the attempt to replace the distributed file system, the use of moosefs, the effect is not satisfactory, after understanding the Glusterfs, decided to try, because it compared with moosefs, feel more simple deployment, At the same time there is no meta-data server features so that it does not have a single point of failure, it feels very good.Environment Introduction:Os:centos 6.4 x86_64 MinimalServers:sc2
=S.SNO)2. List the names of students with two or more (including two) failing courses and their average grades--Implementation code:SELECT S.sno,s.sname,avg_scgrade=avg (SC. Scgrade)From S,SC, (SELECT SNOFrom SCWHERE scgradeGROUP by SNOHaving COUNT (DISTINCT CNO) >=2A WHERE S.sno=a.sno and SC. Sno=a.snoGROUP by S.sno,s.sname3. List the names of all students who have studied the "1" course and have studied "2"--Implementation code:SELECT S.sno,s.snameFrom S, (SELECT SC. SNOFrom Sc,cWHERE SC. Cno=
, ' Levin ', ' 1990-08-06 ', ' Male '),(5, ' Zhou Mei ', ' 1991-12-01 ', ' Women '),(6, ' Wu Lan ', ' 1992-03-01 ', ' Women '),(7, ' Qingshou ', ' 1989-07-01 ', ' Women '),(8, ' Wang Ju ', ' 1990-01-20 ', ' female ');# Teacher TableInsert INTO teacher values(1, ' Zhang San '),(2, ' John Doe '),(3, ' Harry ');# timetableINSERT INTO course values(1, ' language ', 2),(2, ' language ', 1),(3, ' language ', 3);# score TableINSERT INTO SC values(1,1,90),(1,2,80),(1,3,90),(2,1,70),(2,2,60),(2,3,80),(3,
from Studentinfo as Swhere S.studentid not in ( --Students taking teacher's course SELECT Sc.studentid from Scoreinfo as SC INNER JOIN Courseinfo as C on sc.courseid = C.courseid INNER JOIN Teacherinfo as T on c.teacherid = T.teacherid and T.teachername = ' Miss Zhang ');--15, the inquiry has studied the Chinese also learned the student information of mathematics select S. ' Stud Entid ' as student number, S. ' Studentname ' as student's name, S. ' Studentgender ' as student gender, S. ' Stu
SnoHaving COUNT ((CNO) >=2)) awhere S.sno=a.sno and Ssc.sno=a.snoGROUP by S.sno,s.sname; /* The name of the student who has studied course No. 1th and has studied course 2nd * *Select S.sno,s.sname from student swhere S.sno in(Select Sc2.sno from SC sc2,class C2 Where sc2.cno=c2.cno and C2.cno in (' 1 ', ' 2 ')GROUP by Sc2
;Select * From t_ SC;SelectSc1.s _ id from t_ SC SC1, t_ SC SC2 where sc1.s _ id = sc2.s _ id and sc1.c _ id ='001' and sc2.c _ id = '002' and sc1.score> sc2.score;-- 2. query the student ID and average score of students whose average score is greater than 60;Select s_id, AVG (score) average score from t_ SC group by s
count (distinct cno)> = 2
) SC Where S. SNO = SC. SNO
4. List the student IDs of all students whose scores are higher than those of students whose scores are equal to those of the course No.
-- Implementation code:Select SC. sno from SC,(Select sc1.sno from(Select SC. sno, SC. scgrade from SC, c where SC. cno = c. cno and c. cname = '1') sc1,(Select SC. sno, SC. scgrade from SC, c where SC. cno = c. cno and c. cname = '1') sc2,Where sc1.sno =
count (sc2.id) num3, info. fouth_area as areacode from jd_safe_check SC2 inner join jd_company C on C. ID = sc2.par _ Id2Inner join fk_user_info info on info. ID = sc2.user _ idWhere sc2.is _ deleted = 0And sc2.father _ id is not
Today, I accidentally sawCodeMaybe I have never seen it. I think it's new. I just wrote the following code. Maybe I 've seen it, Maybe I forgot ...... Haha, let's make a souvenir on your own ......
I found that the singleton mode is good ......
Using System; Namespace Ca_staticconstructor { Class Staticclass { Public Static Staticclass instance { Get ; Set ;} Public String Name { Get ;Set ;} Static Staticclass (){ If(Instance =Null) { Instance = New Staticclass (); } }} Clas
SNAME FROM S
Where not exists (
Select * from SC, C
Where SC. CNO = C. CNO
And cname = 'lilim'
And SC. SNO = S. SNO)
2. List the names and average scores of students whose two or more courses fail.
-- Implementation code:
Select S. SNO, S. SNAME, AVG_SCGRADE = AVG (SC. SCGRADE)
From s, SC ,(
Select SNO
FROM SC
Where SCGRADE
GROUP BY SNO
Having count (distinct cno)> = 2
) A Where S. SNO = A. sno and SC. SNO = A. SNO
Group by s. SNO, S. SNAME
3. List the names of all students who have learned co
from S
Where not exists (
Select * from SC, c
Where SC. CNO = C. CNO
And cname = 'lilim'
And SC. Sno = S. SnO)
2. List the names and average scores of students whose two or more courses fail.
-- Implementation code:
Select S. Sno, S. sname, avg_scgrade = AVG (SC. scgrade)
From S, SC ,(
Select SnO
From SC
Where scgrade
Group by SnO
Having count (distinct CNO)> = 2
) A where S. Sno = A. SnO and SC. Sno = A. SnO
Group by S. Sno, S. sname
3. List the names of all students who have learned course 1
System.Object instance is the same instance. Parameters://OBJB: The second System.Object to compare. Obja: The first System.Object to compare. Returns the result://True if Obja is the same instance as OBJB, or False if both are null references. public static bool ReferenceEquals (object Obja, Object OBJB); }}Three methods for equality of comparisons are defined in System.Object. There is also an operator (= =) that can compare references or compare values.Here is a detai
. List "1" class scores than the "2" students who have high grades of the student's school number Select S.sno,s.snameFrom S, (Select SC1. SNOFrom SC sc1,c c1,sc sc2,c C2Where SC1. Cno=c1. CNO and c1.name= ' 1 'and SC2. Cno=c2. CNO and C2.name= ' 2 'and SC1. SCGRADE>SC2. Scgrade) SC Where S.SNO=SC. SNO5. List the scores of all students with "1" class scores hig
--Implementation code:Select SNAME from Swhere not EXISTS (SELECT * from Sc,c Where SC. Cno=c.cno and Cname= ' Li Ming ' and SC. SNO=S.SNO) 2. List of the names of students with two or more (including two) failed courses and their average scores--Implementation code:Select S.sno,s.sname,avg_scgrade=avg (SC. Scgrade) from S,SC, (Select SNO from SC Where scgrade 3. List the names of all students who have studied the course "1" and have studied "2"--Implementation code:Select S.sno,s.sname fr
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.