sc1,c c1,sc sc2,c C2 Where 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. SNO 5. List the academic numbers of all students with the "1" grade higher than the "2" class and their results in "1" and "2" classes--Implementation code:Select S.sno,s.sname,sc.[1 results],sc.[2 class score]
, the Readresolve () method is invoked when the object is read from the I/O stream.
In effect, the 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 v
-class nameSELECT S.sno,s.snameFrom S, (SELECT SC. SNOFrom Sc,cWHERE SC. Cno=c.cnoand C.cname in (' 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
students with "01" Class score higher than "02" Class Select Sc1.sno as student number from SC as sc1,c as c1,sc as sc2,c as C2where sc1.cno=c1.cno and c1.cno= ' ' and S C2.cno=c2.cno and c2.cno= 'on ' andSc1.scgrade>sc2.scgrade Group by Sc1.sno; 5. List the academic numbers of all students with the "01" Grade higher than the "02" class and their results in "01" and "02" classes Select Sc1.sno as student n
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, course where
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
the name of the database to be exported.
Sup2; versions earlier than sybase12.5 must execute scripts to export the table structure. The script file is as follows:Use sybsystemprocsGo
If object_id ('dbo. sp_ddl_create_table ') is not nullDrop procedure sp_ddl_create_tablePrint "Dropping sp_ddl_create_table"Go
Create proc sp_ddl_create_tableAs
-- Creates the DDL for all the user tables in-- Current database
Select right ('create table' + so1.name + '(' +'', 255 * (abs (sign (sc1.colid-1)-1) +Sc1
student, SC where
sc. ' s# ' =student. ' s# ' and SC. ' C # ' =1 s_2 where Score2 9. Inquires the student number and name of the students who have not learned all classes
Select student. ' s# ', sname from student, SC where student. ' s# ' = sc. ' s# ' GROUP by ' s# ', sname have count (' C # ')
10. Inquiries at least one course and the student number "002" Students learn the same student number and name;
SELECT DISTINCT (sc. ' s# '), sname from student, SC where student. ' s# ' =sc. ' s# ' an
shallow copy (shallow copy) and a deep copy (deep copy).shallow copy and deep copy
Here are two examples of shallow copies and deep copies, examples using the ICloneable interface. The array in C # is a reference variable, which we demonstrate by using an array:
Shallow copy:
Using System;
Class shallowcopy:icloneable
{public
int[] v = {1,2,3};
Public Object Clone ()
{return this
. MemberwiseClone ();
}
public void Display ()
{
foreach (int i-V)
Console.Write (i + ",");
score from SC SC _2 where student.'s # '= SC _2.'s # 'and SC _2. 'C # '= 2) score2 from student, SC whereSC.'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 coursesSelect student.'s # ', Sname from student, SC where student.'s # '= SC.'s # 'group by's # ', sname having count ('C #') 10. query the student ID and name of at least one course with the student ID "002;Select distinct (SC.'s # '), sname from studen
, (select score from SC SC _2 where student.'s # '= SC _2.'s # 'and SC _2. 'C # '= 2) score2 from student, SC whereSC.'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 coursesSelect student.'s # ', Sname from student, SC where student.'s # '= SC.'s # 'group by's # ', sname having count ('C #')
10. query the student ID and name of at least one course with the student ID "002;Select distinct (SC.'s # '), sname f
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
which he is assigned the subject.
select SNAME,avgscore from S,(select stu_No,AVG(score) as avgscore from scwhere score
3. List the names of all students who have learned course 1001 and course 1002
select SNAME from S,(select stu_No from SCwhere cla_No in ("1001","1002")group by stu_No having count(distinct cla_No)=2) bwhere S.SNO=b.stu_Noselect SNAME from Swhere S.SNO in(select stu_No from SCwhere cla_No in ("1001","1002")group by stu_No having count(distinct cla_No)=2)
4. List the student ID
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.