SQL exercises
Language 
December 12, 07:33 MSK
Login:

Password:

forgot password?
Registration

Personal page
Developers & Thanks
For employers
References
Feedback
Support SQL-EX.RU



SQL Exercises news letters, latest issue

#688 (2017-12-09)

Week news

§
As the important news can appear and between releases of news letters, I shall use this page for the publication of the information on all changes on the site.
The forum is not so suitable for this purpose since the message there "escapes" and can appear on previous page before it will lose a urgency.
So look in here if you wish to be well informed about last events on the site. The link to this page is in section of news at the main page below a subscription banner.
§
New exercises and replacements of exercises:
227 (SELECT, rating) from new author - mcrain (2 points).

§
New version of mobile application from Dmitry Ponomarenko is now available for work with site forums and more. Try this.

§
The most popular topics of the forum
Topic        Messages
§
Authors of the week in the forum
Author	Messages
qwrqwr  	16
kay1992		12
pegoopik  	9
Kursist		9
selber  	8
§
Available competitions on query optimization
Exercise	Date	     Author
147	2012-02-23	$erges
159	2012-07-25	anddros
170	2011-07-15	qwrqwr
182	2012-02-16	Baser
192	2012-03-03	Baser
197	2014-11-06	pegoopik
214	2015-06-24	pegoopik
259	2012-07-23	anddros
§
Additional non-optimization competitions
Exercise	Date	Author/Organizer of competition
71	2010-12-26	anddros (closed)
88	2012-07-12	crescent/Pegoopik  (closed)
91	2012-05-31	smog/$erges
102	2016-07-04	GriGrim/pegoopik
121	2012-07-06	ZrenBy/anddros
153	2010-09-21	Ozzy
§
Changes among leaders (solved exercises of third stage):
78. vasilyvanc (142, 170, 204)
§
New persons in TOP 100 or have returned (solved exercises and 2nd-stage time):
78. vasilyvanc (167, 1.522)
§
Applicants for Top 100 have advanced in rating:
121. MikhailFG (141, 109.092)
144. shipwright (123, 227.134)
147. Lesha.V (120, 63.325)
152. Masha279 (122, 85.432)
236. zda (100, 380.274)
242. anyman1979 (91, 2.804)
§
Have been certified last week:
ringman (A17385067) [BK] - g. Kostroma, Rossiya
§
Statistics:
Number of subscribers - 3013
Number of rating's participants - 11988
Number of second-stage's participants - 3039
Number of third-stage's participants - 126
On the learning stage - 235824
Certified specialists in total - 786

ТОР 20

NoPersonNumber of
Sel_ex
Last_SelNumber of
DML_ex
ScoresDaysDays_2Days_3S_3LastSolvedLastVisit
1Krasovskij E.A. (pegoopik)1261306336402704209.87113.7522332017-12-022017-12-08
2Boiko D. (Angellore)12613063364037665230.7653819.6322332017-12-022017-12-05
3Kreslavskij O.M. (Arcan)1260306336373958266.414208.7662302017-12-032017-12-08
4Bezhaev A.Yu. (Baser)1258225316302636199.957177.3102272017-07-202017-12-08
5Dubinskij A.V. (_velial)12573063363029412793.4023368.3692252017-12-022017-12-06
6Karasyova N.V. (vlksm)1254222326214179276.031227.5022162017-10-222017-12-06
7Kostomarov A.V. (al29)72362143058220391952.0201519.3822092017-11-242017-12-05
8Filippkin D.V. (_dimon_)1245115295982737194.624127.9092022016-07-202016-09-29
9Kurochkin P.A. (qwrqwr)1248306336022943250.826159.3151952017-12-012017-12-08
10Movlyanov A.P. (Oct)7245102958913072353.7512448.8471932017-01-232017-04-03
11Sal'nikov S.A. ($erges)122820625552253317.53314.4981812015-02-022017-04-13
12Kukushkin S.A. (smog)92261632952823681054.8611122.1811532017-10-032017-11-07
13Yatsuk A.A. (Faust_zp)1187255244601984144.150108.8401372012-07-122012-07-30
14Kuznetsov V.S. (herrRo)1172260234191167478.51173.3351222012-02-082013-06-18
15Grinkevich D.L. (Dmitrij Grinkevich)1320510274682059367.305932.3431092017-05-312017-11-25
16Drozdkov A.N. (anddros)51931624446224412.34111.0911082014-07-212015-01-29
17Shindin A.V. (AlShin)114825223367928408.505777.457992011-05-052014-05-18
18Vyazovetskov A.S. (alex_v)15197135234444200124.96042.620972017-12-072017-12-08
19Timofeeva E.V. (Umrikhina)12061031480338150.38047.237962017-07-272017-10-20
20Doschenko V.N. (mcrain)201953063346222561793.656276.831952017-12-052017-12-08

Best results for last week

Nosurnamen_selsel_allsel_scoresdml_scoresscoresratinglast_visit
1>Zvonarev (pavel1211)63631052613168808 Dec 2017
2Vyazovetskov A.S. (alex_v)9197210211808 Dec 2017
3>Voitovs A. (Lesha.V)71202002014708 Dec 2017
4A (A2017)122719019277007 Dec 2017
5Shaymardanov M.M. (xLiSPirit)7172130133108 Dec 2017
6Kopyonkin G. (ringman)5631001066908 Dec 2017
7Nikolaj (Bulocka_c_izumom)81010010477307 Dec 2017
8>Vasilevskaya E.A. (kattiks)37380840708 Dec 2017
9>Kirdan (shipwright)312371814408 Dec 2017
10>Kornievskiy A. (kottofey)57628277508 Dec 2017
11>Sigankov V.I. (vasilyvanc)41676067808 Dec 2017
12Zhdamorev (zda)110040423608 Dec 2017
13>Nikanorov (parra)29140427708 Dec 2017
14Gorbachev V.V. (SQL_rules)36404290805 Dec 2017

Let's learn SQL

MySQL. Usage of query variables

E.A. Krasovskiy

People rather often ask whether there are equivalents for analytic (windowing) functions in MySQL. No, there are not. To replace them, self join queries, complex subqueries, etc, are used. Most of such workarounds turn out to be ineffective.

There are no recursive queries in MySQL either. However, a part of problems usually solved by analytic functions or recursive queries can be handled by features available in MySQL.

One of these features is the unique mechanism of processing variables within a SQL query, which is very unusual for other DBMS. In MySQL, you can declare a variable within a query, change its value, and put it into the result set of the SELECT statement for output. And the most notable thing is, the processing order for query rows, and thus the order values are assigned to variables, can be defined by custom sorting!

Note: this article implies expressions within the SELECT statement are processed in order from left to right; however, there is no confirmation of such a processing order in the official MySQL documentation. You need to keep that in mind when switching from one server version to another. To ensure the required evaluation order, a fake CASE or IF statement can be used.

Read more:
Equivalent of recursive CTEs
Equivalents for analytic functions
Performance

Useful links

§ Official communities of the site sql-ex in social networks: SQL Exercises at VK.com and SQL Exercises at LinkedIn.com

§ .
    The resource is positioned as a "handbook" for this site SQL-EX.COM, but can be used irrespective of it also.

§ The following DBMS are used on the site for solving exercises: SQL Server 2012 Express, Oracle Database 11g Express Edition, MySQL 5, PostgreSQL 9.

§ If you like this site, vote for us:
del.icio.us
dzone.com
Digg.com
stumbleupon.com



Home
Week news
Profile
References
Rambler's Top100
Copyright SQL-EX © 2002-2017. All rights reserved.
contact