50 SQL Query Techniques, query statement examples, 50 SQL statements
Student (S #, Sname, Sage, Ssex) Student tableCourse (C #, Cname, T #) CurriculumSC (S #, C #, score) Orders tableTeacher (T #, Tname) Instructor tableProblem:1. query the student ID of all students whose score is higher than that of the "002" course;Copy codeThe Code is as follows:Select a. S # from (select s #, score from SC where C # = '001') a, (select s #, scoreFrom SC where C # = '002') BWhere a. score> B. score and a. s
Basic Database Operations, databasesI. Data Table Student (S #, Sname, Sage, Ssex) Student table S #: Student ID; Sname: Student name; Sage: Student age; Ssex: Student genderCourse (C #, Cname, T #) curriculum C #, Course No.; Cname: Course name; T #: Instructor No.SC (S #, C #, score) Student table S #: Student ID; C #, course number; score: scoreTeacher (T #, Tname) Instructor table T #: Instructor ID; Tname: Instructor name
Ii. Basic operations:1. query the student ID of all students whose sc
50 common SQL statements
Student (S #, Sname, Sage, Ssex) Student tableCourse (C #, Cname, T #) CurriculumSC (S #, C #, score) Orders tableTeacher (T #, Tname) Instructor table
Problem:1. query the student ID of all students whose score is higher than that of the "002" course;Select a. S # from (select s #, score from SC where C # = '001') a, (select s #, scoreFrom SC where C # = '002') BWhere a. score> B. score and a. s # = B. s #;2. query the student ID and average score of students whose ave
Student (s #, sname, sage, ssex) Student tableCourse (C #, cname, T #) CurriculumSC (s #, C #, score) Orders tableTeacher (T #, tname) Instructor table
Problem:1. query the student ID of all students whose score is higher than that of the "002" course;Select a. s # From (select s #, score from SC where C # = '001') A, (select s #, scoreFrom SC where C # = '002') BWhere a. score> B. score and a. s # = B. S #;2. query the student ID and average score of students whose average score is greater than
Student (s#,sname,sage,ssex) Student tableCourse (c#,cname,t#) timetableSC (s#,c#,score) score sheetTeacher (t#,tname) Teacher's TableProblem:1, Query the "001" Course than "002" course scores of all students of the school number;
Copy Code code as follows:
Select a.s# from (select S#,score from SC where c#= ' 001 ') A, (select S#,score
From SC where c#= ' 002 ') b
where A.score>b.score and a.s#=b.s#;
2, the average score is greater than 60 students of the school numb
Article Source: http://www.ynpxrz.com/n822738c2024.aspxT_tudent (sid,sname,sage,ssex,sdept) Student tableT_course (Cid,cname,tid) timetableT_score (scid,sid,cid,grade) score tableT_teacher (tid,tname) Teacher tableProblem:1, the inquiry "001" course is higher than "002" of all students of the school number;SelectT1.sid from(SelectSid,grade fromT_scorewhereCid= '001') T1, (SelectSid,grade fromT_scorewhereCid= '002') T2whereT1.grade>T2.grade andT1.sid=T2.sid;SelectT2.SID,T2.CA,T2.CB (SelectT1.sid,
Tags: Tween group by order Search show amp ASP other totalHttp://www.ynpxrz.com/n822738c2024.aspx T_tudent (sid,sname,sage,ssex,sdept) Student table T_course (Cid,cname,tid) timetable T_score (scid,sid,cid,grade) score table T_teacher (tid,tname) Teacher table Problem: 1, the inquiry "001" course is higher than "002" of all students of the school number; Select T1.sid from (select Sid,grade from t_score WHERE cid = ' 001 ') T1, (select Sid,grade from t_score WHERE cid = ' 002 ') T2 where T1.grad
all students whose score is higher than that of the "002" course;
select a.S# from (select s#,score from SC where C#='001') a,(select s#,score from SC where C#='002') b where a.score>b.score and a.s#=b.s#;2. query the student ID and average score of students whose average score is greater than 60;
select S#,avg(score) from sc group by S# having avg(score) >60;3. query the st
This text has been reprinted online, and some SQL statements are suitable for use in application systems. Some "reports" have a heavier feeling, mainly to review the former.
This text has been reprinted online, and some SQL statements are suitable for use in application systems. Some "reports" are more likely to be used, mainly to review the former.
50 common SQL statements
Student (S #, Sname, Sage, Ssex) Student table
Course (C #, Cname, T #) Curriculum
SC (S #, C #, score) Orders table
Teac
where C # = '002') BWhere a. score> B. score and a. s # = B. s #;2. query the student ID and average score of students whose average score is greater than 60;Select S #, avg (score)From SCGroup by S # having avg (score)> 60;3. query the student ID, name, number of course selections, and total score of all students;Select Student. S #, Student. Sname, count (SC. C #), sum (score)From Student left Outer join
50 SQL statements involved in one question
Student (s #, sname, sage, ssex) Student tableCourse (C #, cname, T #) CurriculumSC (s #, C #, score) Orders tableTeacher (T #, tname) Instructor table
Problem:1. query the student ID of all students whose score is higher than that of the "002" course;Select a. s # From (select s #, score from SC where C # = '001') A, (select s #, scoreFrom SC where C # = '002') BWhere a. score> B. score and a. s # = B. S #;2. query the student ID and average score
use_libiconv, change the value 1 to 0 ### then make make install again
# Configuration test, test if you can run $/usr/local/coreseek/bin/indexer-C/usr/local/coreseek/etc/sphinx-min.conf.dist # The following prompts for a normal test: coreseek Fulltext 3.2 [sph00000.9.9-release (r2117)] Copyright (c) 2007-2010, Beijing choice Software Technologies Inc (http://www.coreseek.com) using Config File '/usr/local/coreseek/etc/sphinx-min.conf.dist '... total 0 reads, 0.000 sec, 0.0 KB/call
can be understood as follows:
Rollup (a, B) Statistical columns include: (a, B), (),()Rollup (a, B, c) Statistical columns include: (a, B, c), (a, B), (),()
Unless it is not the beginning, there will be a foundation. Otherwise, you will be confused about some conceptual things, so please read the following data and use the data to speak.
The above table uses group by rollup (grade, clazz) to calculate the total score and average score. First, let's look at the results and then analyze them.
, ndbcluster, federated} [innodb]-Mysql-engine-trx = STRING whether storage engine used is transactional or not {yes, no, auto} [auto]-Mysql-ssl = [on | off] use SSL connections, if available in the client library [off]-Myisam-max-rows = N max-rows parameter for MyISAM tables [0, 1000000]-Mysql-create-options = STRING additional options passed to create table []Test
1. CPU Test
[Root @ localhost bin] #./sysbench-test = cpu-max-prime = 20000 run
Sysbench 0.4.12: multi-threaded system evaluation b
SQL database Interview Questions and answers
(22:52:54)
ReprintedBytes
Summary of course number of three c courses by Ye Ping
Category: Program World
Student (S #, Sname, Sage, Ssex) Student table S #: Student ID; Sname: Student name; Sage: Student age; Ssex: Student genderCourse (C #, Cname, T #) curriculum C #, Course No.; Cname: Course name; T #: Instructor No.SC (S #, C #, score) Student table S #: Student ID; C #, course number; score: scoreTeacher (T #, Tname) Instructor table T #: Instruc
50 Common SQL statements
Student (s#,sname,sage,ssex) Student table
Course (c#,cname,t#) timetable
SC (s#,c#,score) score sheet
Teacher (t#,tname) Teacher's Table
Problem:
1, Query the "001" Course than "002" course scores of all students of the school number;
Select a.s# from (select S#,score from SC where c#= ' 001 ') A, (select S#,score
From SC where c#= ' 002 ') b
where A.score>b.score and a.s#=b.s#;
2, the average score is greater than 60 students of the school number and average score;
S
Student (s#,sname,sage,ssex) Student tableCourse (c#,cname,t#) timetableSC (s#,c#,score) score tableTeacher (t#,tname) Teacher tableProblem:1, the inquiry "001" course is higher than "002" of all students of the school number;Select a.s# from (select S#,score from SC where c#= ' 001 ') A, (select S#,scoreFrom SC where c#= ' 002 ') bwhere A.score>b.score and a.s#=b.s#;2, the query average score is more than 60 points of the student's number and average score;Select S#,
without using magic methodsSequential execution of script n times under Php5.6.26-1Average/minimum/maximum of statistical execution timeSequential execution of script n times under Php7.0.12-2Average/minimum/maximum of statistical execution timeAt present, personal ability is limited, only in this way, if you have a better plan or advice can tell me, thank you, haha~
Test
__construct
First, let's take a look at the experiment of the constructor __construct, the PHP script is as follows:
PHP5.6
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.