SQL exercises
April 30, 00:26 MSK


forgot password?

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

Would you get the following certificate?
Yes 68.5%
No 12.1%
Probably I would get it for supporting the project 9.4%
Such certificate is unnecessary one 5.6%
Such certificate is necessary on a site, but not for me 4.5%

Total Votes: 37199

SQL Exercises news letters, latest issue

#656 (2017-04-29)

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.
Mobile application from Dmitry Ponomarenko is now available for work with site forums. Try this.

Has corrected a bug with checking the exercises:
115 (SELECT, rating) - formulation from author.

The most popular topics of the forum
Topic        Messages
Authors of the week in the forum
Author	Messages
pegoopik  	18
Gosha		14
selber  	6
qwrqwr  	4
meranbel	3
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):
56. uff (202)
Applicants for Top 100 have advanced in rating:
128. Johnnymnemonic (148, 282.651)
143. Kursist (124, 85.773)
153. Gosha (131, 346.120)
202. freespoken (106, 653.387)
269. Chatte (98, 40.935)
Have been certified last week:
Natiq849 (A17259035) [BK] - Baku, Azerbaijan
Number of subscribers - 3236
Number of rating's participants - 11744
Number of second-stage's participants - 2988
Number of third-stage's participants - 119
On the learning stage - 213552
Certified specialists in total - 767

ТОР 20

NoPersonNumber of
Last_SelNumber of
1Kreslavskij O.M. (Arcan)1256224306253728260.298203.7052252017-04-172017-04-28
2Dubinskij A.V. (_velial)12562203062527102793.3943368.3692252017-04-152017-04-28
3Krasovskij E.A. (pegoopik)1256224306242474208.77012.6672242017-04-162017-04-28
4Bezhaev A.Yu. (Baser)1253305296192441197.797175.1682222017-01-062017-02-01
5Boiko D. (Angellore)12533052961635124677.3373268.2362182017-03-232017-03-29
6Karasyova N.V. (vlksm)1252306296133978275.194226.9262142017-04-042017-04-28
7Filippkin D.V. (_dimon_)1245115295982737194.624127.9092022016-07-202016-09-29
8Kurochkin P.A. (qwrqwr)1245306305942713250.319159.3151952017-04-152017-04-28
9Movlyanov A.P. (Oct)72463062959013562353.7572448.8471932017-03-132017-04-03
10Kostomarov A.V. (al29)9226-103055418211749.5181316.8801812017-04-202017-04-20
11Sal'nikov S.A. ($erges)122820625552253317.53314.4981812015-02-022017-04-13
12Yatsuk A.A. (Faust_zp)1187255244601984144.150108.8401372012-07-122012-07-30
13Kukushkin S.A. (smog)921410274932195985.9871059.9751242017-04-132017-04-24
14Kuznetsov V.S. (herrRo)1172260234191167478.51173.3351222012-02-082013-06-18
15Grinkevich D.L. (Dmitrij Grinkevich)1320445274671652367.281932.3431092016-04-192017-04-05
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)15177187234063246123.34242.620972015-04-282015-06-05
19Timofeeva E.V. (Umrikhina)120730630480328050.39047.237962017-04-172017-04-21
20Tarasov D.B. (Gavrila)916515233942427151.34399.710952012-04-232012-05-25

Best results for last week

1Basharin E. (eaniconer)16953503528828 Apr 2017
2>Kozlova M. (Auriga_dorado)10591811970028 Apr 2017
3>Escal Y. (NotASocialist)92415015150428 Apr 2017
4>Isavnina (swordy2014)63815015159728 Apr 2017
5>Dudochkin A. (dandr)101012012464028 Apr 2017
6sakulin 1.1. (valera123123)88909519625 Apr 2017
7Shkarednyj (Gosha)413181915328 Apr 2017
8>Rakhmatullin R. (Ranil)710819197328 Apr 2017
9>Poltoranin S.S. (Stas911)55580882328 Apr 2017
10Mityurin V. (mitvol)56680891326 Apr 2017
11Chernov D. (Kursist)212461714328 Apr 2017
12Zarrad (filzarrad)48617252128 Apr 2017
13Gorshelev M.O. (eximka)27641537728 Apr 2017
14Ushakov G.A. (genush)24741584426 Apr 2017
15Rzazade N.M. (Natiq849)26534750427 Apr 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

§ All articles from news letters are putting on the site Books and articles about SQL thereafter.

§ We invite you to visit the Interactive SQL textbook.
    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.