SQL exercises
November 18, 02:24 MSK


forgot password?

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

Сколько стоит адвокат по уголовным делам
Адвокат по уголовным делам. Профессиональная помощь. Звоните

Аль факер
аль факер

SQL Exercises news letters, latest issue

#685 (2017-11-18)

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:
306 (SELECT, rating) -> 141 (learn stage).

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  	9
pegoopik  	6
somerandomname	5
kay1992		5
nick747		4
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):
2. Angellore (214)
26. Sleeping (212)
28. y4nzi (173, 183, 186)
50. Kursist (174)
Have to solve last exercise 138 for passing to the third stage:
123. Gosha (tasks 153, time 540.872)

Applicants for Top 100 have advanced in rating:
125. Gosha (153, 540.872)
169. alko58 (125, 595.991)
180. Lesha.V (108, 59.393)
239. zda (99, 363.457)
Number of subscribers - 3006
Number of rating's participants - 11936
Number of second-stage's participants - 3036
Number of third-stage's participants - 125
On the learning stage - 233436
Certified specialists in total - 784

ТОР 20

NoPersonNumber of
Last_SelNumber of
1Krasovskij E.A. (pegoopik)1261306326392680209.86613.7522332017-11-082017-11-16
2Boiko D. (Angellore)1259103263437465216.5883805.4642282017-11-122017-11-14
3Kreslavskij O.M. (Arcan)1259306326333929265.529207.9082272017-11-042017-11-17
4Bezhaev A.Yu. (Baser)1258225316302636199.957177.3102272017-07-202017-11-12
5Dubinskij A.V. (_velial)1256-173262829162793.3903368.3692252017-11-072017-11-15
6Karasyova N.V. (vlksm)1255306326224199276.059227.5022162017-11-112017-11-13
7Kostomarov A.V. (al29)72352233057819191835.7821403.1442052017-07-272017-10-27
8Filippkin D.V. (_dimon_)1245115295982737194.624127.9092022016-07-202016-09-29
9Kurochkin P.A. (qwrqwr)1248307326012923250.854159.3151952017-11-112017-11-17
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-08
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)1518435234164162123.46442.620972017-10-302017-10-30
19Timofeeva E.V. (Umrikhina)12061031480338150.38047.237962017-07-272017-10-20
20Tarasov D.B. (Gavrila)916515233942427151.34399.710952012-04-232012-05-25

Best results for last week

1>Voitovs A. (Lesha.V)81081801818017 Nov 2017
2Zhdamorev (zda)7991701723917 Nov 2017
3>Tatsyuk O.A. (archi_98)103617017180817 Nov 2017
4Makarov (qwerty12345678zxcvb)7821401433617 Nov 2017
5Baranova L. (Luda2)65112012113917 Nov 2017
6>Shabanov R.R. (Vertel)91811011194717 Nov 2017
7>Kopyonkin G. (ringman)54210010105016 Nov 2017
8>Zajtsev V.S. (Sleeping)41927072617 Nov 2017
9Shalavin D.E. (Juster81)29570730816 Nov 2017
10>L'vova M. (mlvova)541707115317 Nov 2017
11Goppen D. (Homo Ignavus)67707308316 Nov 2017
12anderson C.7. (andersoncouncil)45460685116 Nov 2017
13Sinitsyn A.A. (A_Sinitsyn)34560692816 Nov 2017
14Boiko D. (Angellore)2259505214 Nov 2017
15Aliev R. (y4nzi)31874042816 Nov 2017
16Shkarednyj (Gosha)115340412516 Nov 2017
17Kordyum A. (alko58)212540416917 Nov 2017
18Stark (qi)39404488015 Nov 2017
19Gorbachev V.V. (SQL_rules)33404730915 Nov 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

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:

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