1 列出emp表中各部门的部门P最高工资,最低工?BR>select max(sal) as 最高工?min(sal) as 最低工?deptno from emp group by deptno;
2 列出emp表中各部门job?CLERK'的员工的最低工资,最高工?BR>select max(sal) as 最高工?min(sal) as 最低工?deptno as 部门?from emp where job = 'CLERK' group by deptno;
3 对于emp中最低工资小?000的部门,列出job?CLERK'的员工的部门P最低工资,最高工?BR>select max(sal) as 最高工?min(sal) as 最低工?deptno as 部门?from emp as b where job='CLERK' and 1000>(select min(sal) from emp as a where a.deptno=b.deptno) group by b.deptno
4 Ҏ(gu)部门L(fng)高而低Q工资有低而高列出每个员工的姓名,部门P工资 select deptno as 部门?ename as 姓名,sal as 工资 from emp order by deptno desc,sal asc
5 写出对上题的另一解决Ҏ(gu) Q请补充Q?/P>
6 列出'张三'所在部门中每个员工的姓名与部门?BR>select ename,deptno from emp where deptno = (select deptno from emp where ename = '张三')
7 列出每个员工的姓名,工作Q部门号Q部门名 select ename,job,emp.deptno,dept.dname from emp,dept where emp.deptno=dept.deptno
8 列出emp中工作ؓ(f)'CLERK'的员工的姓名Q工作,部门P部门?BR>select ename,job,dept.deptno,dname from emp,dept where dept.deptno=emp.deptno and job='CLERK'
9 对于emp中有理者的员工Q列出姓名,理者姓名(理者外键ؓ(f)mgrQ?BR>select a.ename as 姓名,b.ename as 理?from emp as a,emp as b where a.mgr is not null and a.mgr=b.empno
10 对于dept表中Q列出所有部门名Q部门号Q同时列出各部门工作?CLERK'的员工名与工?BR>select dname as 部门?dept.deptno as 部门?ename as 员工?job as 工作 from dept,emp where dept.deptno *= emp.deptno and job = 'CLERK'
11 对于工资高于本部门^均水q的员工Q列出部门号Q姓名,工资Q按部门h?BR>select a.deptno as 部门?a.ename as 姓名,a.sal as 工资 from emp as a where a.sal>(select avg(sal) from emp as b where a.deptno=b.deptno) order by a.deptno
12 对于empQ列出各个部门中q_工资高于本部门^均水q的员工数和部门P按部门号排序 select count(a.sal) as 员工?a.deptno as 部门?from emp as a where a.sal>(select avg(sal) from emp as b where a.deptno=b.deptno) group by a.deptno order by a.deptno
13 对于emp中工资高于本部门q_水^Qh数多?人的Q列出部门号Qh敎ͼ按部门号排序 select count(a.empno) as 员工?a.deptno as 部门?avg(sal) as q_工资 from emp as a where (select count(c.empno) from emp as c where c.deptno=a.deptno and c.sal>(select avg(sal) from emp as b where c.deptno=b.deptno))>1 group by a.deptno order by a.deptno
14 对于emp中低于自己工资至?人的员工Q列出其部门P姓名Q工资,以及(qing)工资于自己的h?BR>select a.deptno,a.ename,a.sal,(select count(b.ename) from emp as b where b.sal<a.sal) as 人数 from emp as a where (select count(b.ename) from emp as b where b.sal<a.sal)>5
]]>在部|PORTAL目Ӟ遇到异常QRepoExceptionTextFormatter ClassNotFound http://www.tkk7.com/freddychu/archive/2006/02/15/30886.html风萧?/dc:creator>风萧?/author>Wed, 15 Feb 2006 15:14:00 GMThttp://www.tkk7.com/freddychu/archive/2006/02/15/30886.htmlhttp://www.tkk7.com/freddychu/comments/30886.htmlhttp://www.tkk7.com/freddychu/archive/2006/02/15/30886.html#Feedback0http://www.tkk7.com/freddychu/comments/commentRss/30886.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/30886.htmlException:weblogic.management.ApplicationException: prepare failed for content_repo.jar Module: content_repo.jar Error: Exception preparing module: EJBModule(content_repo.jar,status=NEW) Unable to deploy EJB: content_repo.jar from content_repo.jar: Class not found: com.bea.content.repo.i18n.RepoExceptionTextFormatter java.lang.NoClassDefFoundError: Class not found: com.bea.content.repo.i18n.RepoExceptionTextFormatter at weblogic.ejb20.compliance.EJBComplianceChecker.check([Ljava.lang.Object;)V(EJBComplianceChecker.java:287)
]]>GOOGLE挑战赛练?fn)??qing)答?/title>http://www.tkk7.com/freddychu/archive/2005/11/27/21591.html风萧?/dc:creator>风萧?/author>Sun, 27 Nov 2005 15:42:00 GMThttp://www.tkk7.com/freddychu/archive/2005/11/27/21591.htmlhttp://www.tkk7.com/freddychu/comments/21591.htmlhttp://www.tkk7.com/freddychu/archive/2005/11/27/21591.html#Feedback2http://www.tkk7.com/freddychu/comments/commentRss/21591.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/21591.html
Problem Statement
When editing a single line of text, there are four keys that can be used to move the cursor: end, home, left-arrow and right-arrow. As you would expect, left-arrow and right-arrow move the cursor one character left or one character right, unless the cursor is at the beginning of the line or the end of the line, respectively, in which case the keystrokes do nothing (the cursor does not wrap to the previous or next line). The home key moves the cursor to the beginning of the line, and the end key moves the cursor to the end of the line.
You will be given a int, N, representing the number of character in a line of text. The cursor is always between two adjacent characters, at the beginning of the line, or at the end of the line. It starts before the first character, at position 0. The position after the last character on the line is position N. You should simulate a series of keystrokes and return the final position of the cursor. You will be given a String where characters of the String represent the keystrokes made, in order. 'L' and 'R' represent left and right, while 'H' and 'E' represent home and end.
Definition
Class:
CursorPosition
Method:
getPosition
Parameters:
String, int
Returns:
int
Method signature:
int getPosition(String keystrokes, int N)
(be sure your method is public)
Constraints
-
keystrokes will be contain between 1 and 50 'L', 'R', 'H', and 'E' characters, inclusive.
-
N will be between 1 and 100, inclusive.
Examples
0)
"ERLLL"
10
Returns: 7
First, we go to the end of the line at position 10. Then, the right-arrow does nothing because we are already at the end of the line. Finally, three left-arrows brings us to position 7.
1)
"EHHEEHLLLLRRRRRR"
2
Returns: 2
All the right-arrows at the end ensure that we end up at the end of the line.
2)
"ELLLELLRRRRLRLRLLLRLLLRLLLLRLLRRRL"
10
Returns: 3
3)
"RRLEERLLLLRLLRLRRRLRLRLRLRLLLLL"
19
Returns: 12
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
]]>GOOGLE挑战赛练?fn)??qing)答?/title>http://www.tkk7.com/freddychu/archive/2005/11/27/21589.html风萧?/dc:creator>风萧?/author>Sun, 27 Nov 2005 15:40:00 GMThttp://www.tkk7.com/freddychu/archive/2005/11/27/21589.htmlhttp://www.tkk7.com/freddychu/comments/21589.htmlhttp://www.tkk7.com/freddychu/archive/2005/11/27/21589.html#Feedback0http://www.tkk7.com/freddychu/comments/commentRss/21589.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/21589.html
Problem Statement
A square matrix is a grid of NxN numbers. For example, the following is a 3x3 matrix:
4 3 5
2 4 5
0 1 9
One way to represent a matrix of numbers, each of which is between 0 and 9 inclusive, is as a row-major String. To generate the String, simply concatenate all of the elements from the first row followed by the second row and so on, without any spaces. For example, the above matrix would be represented as "435245019".
You will be given a square matrix as a row-major String. Your task is to convert it into a String[], where each element represents one row of the original matrix. Element i of the String[] represents row i of the matrix. You should not include any spaces in your return. Hence, for the above String, you would return {"435","245","019"}. If the input does not represent a square matrix because the number of characters is not a perfect square, return an empty String[], {}.
Definition
Class:
MatrixTool
Method:
convert
Parameters:
String
Returns:
String[]
Method signature:
String[] convert(String s)
(be sure your method is public)
Constraints
-
s will contain between 1 and 50 digits, inclusive.
Examples
0)
"435245019"
Returns: {"435", "245", "019" }
The example above.
1)
"9"
Returns: {"9" }
2)
"0123456789"
Returns: { }
This input has 10 digits, and 10 is not a perfect square.
This problem statement is the exclusive and proprietary property of TopCoder, Inc. Any unauthorized use or reproduction of this information without the prior written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder, Inc. All rights reserved.
1. Solve this cryptic equation, realizing of course that values for M and E could be interchanged. No leading zeros are allowed.
WWWDOT - GOOGLE = DOTCOM
2. Write a haiku describing possible methods for predicting search traffic seasonality.
3. 1 1 1 2 1 1 2 1 1 1 1 1 2 2 1
What is the next line?
4. You are in a maze of twisty little passages, all alike. There is a dusty laptop here with a weak wireless connection. There are dull, lifeless gnomes strolling about. What dost thou do?
A) Wander aimlessly, bumping into obstacles until you are eaten by a grue. B) Use the laptop as a digging device to tunnel to the next level. C) Play MPoRPG until the battery dies along with your hopes. D) Use the computer to map the nodes of the maze and discover an exit path. E) Email your resume to Google, tell the lead gnome you quit and find yourself in whole different world.
5. What's broken with Unix? How would you fix it?
6. On your first day at Google, you discover that your cubicle mate wrote the textbook you used as a primary resource in your first year of graduate school. Do you:
A) Fawn obsequiously and ask if you can have an autograph. B) Sit perfectly still and use only soft keystrokes to avoid disturbing her concentration. C) Leave her daily offerings of granola and English toffee from the food bins.
D) Quote your favorite formula from the textbook and explain how it's now your mantra. E) Show her how example 17b could have been solved with 34 fewer lines of code. 7. Which of the following expresses Google? over-arching philosophy?
A) "I'm feeling lucky" B) "Don't be evil" C) "Oh, I already fixed that" D) "You should never be more than 50 feet from food" E) All of the above
8. How many different ways can you color an icosahedron with one of three colors on each face?
What colors would you choose?
9. This space left intentionally blank. Please fill it with something that improves upon emptiness.
10.On an infinite, two-dimensional, rectangular lattice of 1-ohm resistors, what is the resistance between two nodes that are a knight's move away?
11.It's 2 PM on a sunny Sunday afternoon in the Bay Area. You're minutes from the Pacific Ocean, redwood forest hiking trails and world class cultural attractions. What do you do?
12.In your opinion, what is the most beautiful math equation ever derived?
13. Which of the following is NOT an actual interest group formed by Google employees?
A. Women's basketball B. Buffy fans C. Cricketeers D. Nobel winners E. Wine club
14.What will be the next great improvement in search technology?
15.What is the optimal size of a project team, above which additional members do not contribute productivity equivalent to the percentage increase in the staff size? A) 1 B) 3 C) 5 D) 11 E) 24
16.Given a triangle ABC, how would you use only a compass and straight edge to find a point P such that triangles ABP, ACP and BCP have equal perimeters? (Assume that ABC is constructed so that a solution does exist.)
17.Consider a function which, for a given whole number n, returns the number of ones required when writing out all numbers between 0 and n. For example, f(13)=6. Notice that f(1)=1. What is the next largest n such that f(n)=n?
18.What's the coolest hack you've ever written?
19.'Tis known in refined company, that choosing K things out of N can be done in ways as many as choosing N minus K from N: I pick K, you the remaining.
Find though a cooler bijection, where you show a knack uncanny, of making your choices contain all K of mine. Oh, for pedantry: let K be no more than half N.
20.What number comes next in the sequence: 10, 9, 60, 90, 70, 66,?
A)96 B) 1000000000000000000000000000000000 0000000000000000000000000000000000 000000000000000000000000000000000 C) Either of the above D) None of the above
21.In 29 words or fewer, describe what you would strive to accomplish if you worked at Google Labs.
]]>l于搞定Acegihttp://www.tkk7.com/freddychu/archive/2005/10/24/16511.html风萧?/dc:creator>风萧?/author>Sun, 23 Oct 2005 16:23:00 GMThttp://www.tkk7.com/freddychu/archive/2005/10/24/16511.htmlhttp://www.tkk7.com/freddychu/comments/16511.htmlhttp://www.tkk7.com/freddychu/archive/2005/10/24/16511.html#Feedback2http://www.tkk7.com/freddychu/comments/commentRss/16511.htmlhttp://www.tkk7.com/freddychu/services/trackbacks/16511.html今天׃一下午加一晚上Q终于做了一个基于Acegi的自qHelloWorld?BR>感觉在RDBMS的认证方式的扩展上有些不灉|。默认是Z开源的数据库HSQLDB的,实现q个机制的是JdbcDaoImpl.javacR看了sourcecodeQ发现类里面写死了两个SQL语句Q?BR> public static final String DEF_USERS_BY_USERNAME_QUERY = "SELECT username,password,enabled FROM users WHERE username = ?"; public static final String DEF_AUTHORITIES_BY_USERNAME_QUERY = "SELECT username,authority FROM authorities WHERE username = ?";