SQL exercises (original) (raw)

RatingsTop 100Top 100 on latest exercises"Liberal" ratingOlympic ratingTOP 100 of Learning StageRating by summation of ranksTop 10 (photos)Last-week resultsRating of second-stage exercises (average)Rating of 2nd-stage exercises (median)Author's rating • • •
StatisticsToday statisticsSite's old residentsRecent leaders activityСhanges in exercises' TOP 10Results' chart
SQL exercisesSite rulesSELECT (learning stage)SELECT (learning stage,       choosing DBMS)SELECT (rating stages)DML Transact-SQL testsData simulationData simulation (DML); • Visual simulation (painting)Exercises voting (SELECT)Exercises voting (DML)
ForumsLearning stageRating stagesFavoritesSearchBlogs
Certification   • About certificationCertified professionalsStatisticsStatistics over regions (map)Confirm certificate
HELPSQL(DML) helpSQL TutorialFAQGuide to Exercise AuthorsDatabases' scriptsDownload booksSend message
Query optimizationQuery planRating by costOptimization competition rulesOptimization competition
Personal page
Developers & Thanks
For employers
References
Feedback
Support SQL-EX.RU

Номинант Премии Рунета 2005

Today we have 248 visitors (27 new).
30 exercises solved (3 on SELECT and 27 on DML),
on learning stage - 460

Practical skills of SQL language

This site will help everyone to gain or improve skills in buildingSQL Data Manipulation Language statements. To train You will have to build yourself the SQL statements for retrieval or modification of specific data required in the exercises. When Your query is incorrect, You will be able to see rows returned by the correct query along with that returned by Your query. Furthermore, you may execute arbitraryDML statements on available databases by setting the "Without checking" option. There are five levels of difficulty (from 1 to 5), You may see it in second column of exercises list. We propose the exercises on retrieving data (SELECT statement) and the exercises on modifying data (INSERT, UPDATE, DELETE, and MERGE statements). Your success in the solving the exercises are shown by a rating of participants. As this takes place, there are three stages: the first one (first 4 exercises) is performed without time control for an individual exercise, the second one (begins with the exercise #5) controls time for completion of each task. At the third stage which refers to optimizing and begins with exercise #139, it is required not only to solve an exercise correctly, but also time of execution of inquiry should be commensurable with time of execution of the author's solution.
Exercises of the first stage are available without registration and may be solved in any order You like. The solution of the rest of exercises requires registration.REGISTRATION IS FREE as this for all other services of the site. In the third column of exercises list You will be able to see ("OK") notes with the numbers of done exercises, but that is available only to the registered users. In fact, that is the main reason for registration. If You would like to visit our web site again, You won't have to recollect which exercises You have done already and which You haven't. If You don't want to register, You may enter as a guest, but in that case Your results won't be traced by the system. Registered users also may discuss the solutions to exercises in our forum.

NOTE: The query stated incorrectly may return the "correct" data on a current state of database. For this reason You should not be surprised if the results of incorrect query are coincide with the results of right one with Your query is estimated as incorrect by the Verifying system.

NOTE: Your browser should support Cookies and Javascript to provide correct usage of this site. If you use content filter, it should allow opening child windows to explore help pages.

Certification

Successful testing of yours can be confirmed by the certificate "SQL Data Manipulation Language Specialist". We support quality of our certificate by periodically replacing exercises and changing the certificate requirements.

More about certification. What does the certificate give to you?

SQL syntax used

User's queries are executed by SQL server that brings some limitations to the syntax of SQL statements. Now we use Microsoft SQL Server 2019 (15.0) on the rating stages, and MariaDB-10.4 (compatible with MySQL 8), PostgreSQL 12.3, and Oracle Database 11g on the learn stage in addition. That is why You should follow the syntax of these realizations when building queries. It should be noted that SQL syntax, implemented in Microsoft SQL Server, is close to that of SQL-92 standard. But there are some distinctions, among them is absence of NATURAL JOIN of tables. Supplied help on SQL Data Manipulation Language is held in accordance with SQL-92 standard and contains information necessary for solving the exercises. In the same place it is possible to find features of used realization (SQL Server 2005).

Top 10 results

Person Scores Days Days_2 Days_3 Scores_3
Krasovskij E.A. (pegoopik) 727 5369 213.162 14.774 259
Chernov D.V. (Kursist) 727 3035 1934.683 1936.126 259
Filippkin D.V. (_dimon_) 723 5885 224.268 156.531 259
Doschenko V.N. (mcrain) 667 3878 2042.840 487.262 248
Kostomarov A.V. (al29) 645 3279 4333.744 2451.734 247
Kreslavskij O.M. (Arcan) 696 6232 284.062 218.820 244
Bezhaev A.Yu. (Baser) 660 4836 283.817 338.523 236
Boiko D. (Angellore) 649 6196 5433.452 3395.024 233
Karasyova N.V. (vlksm) 670 6635 289.660 242.855 225
Dubinskij A.V. (_velial) 646 4120 2796.148 3359.279 223