| SQL exercises | Language Русский English | April 07, 20:38 MSK | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Practical skills of SQL languageThis site will help everyone to gain or improve skills in building
SQL 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 arbitrary
DML 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 ( 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». More about certification. What does the certificate give to you? SQL syntax usedUser’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 Top 10 results
|
SELECT statement exercises: learning stage
SELECT statement exercises: learning stage| SQL exercises | Language Русский English | April 07, 20:38 MSK |
SQL Exercises is intended for acquiring good practical experience,
which is focused on data operation, namely on SQL DML. Certain exercises for beginners are provided on the site,
they are supplied with the necessary reference source on SQL syntax with a great number of examples.
Apart from them, 3 rating stages are suggested, they are aimed at testing of specialists and their certification.
The source is absolutely free of charge, and the certificate purchase has a voluntary basis.
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. |
|
Here you can get practice in constructing queries on data retrieving (SELECT statement of SQL language). The exercises included are addressing to beginners and can be solved in arbitrary order. In order your solutions have been stored in system, the statistics of the solved exercises were conducted, there was an opportunity of participation in ratings and discussions in forum the registration and the authorized logon is required. |
| Home Week news |
Certification |
SQL exercises |
Forums |
Ratings |
HELP |
Performance |
Profile
References |
|
Copyright SQL-EX © 2002-2018. contact |
Состав Ru-Ex | Национальный музей американской истории
Предыдущий
Следующий
>>
Применяются условия использования
ЗагрузкиПрименяются условия использования
ЗагрузкиПрименяются условия использования
ЗагрузкиПрименяются условия использования
Загрузки- Местоположение
- В настоящее время не отображается
- Имя объекта
- безрецептурный препарат
- Тип объекта
- Наркотики
- производитель
- Компания Ру-Экс
- Физическое описание
- картон (тарный материал)
- металл (материал емкости)
- Измерения
- общий: 8 см х 6,5 см; 3 1/8 дюйма x 2 9/16 дюйма
- в целом: 3 1/8 дюйма x 2 1/2 дюйма; 7,9375 см x 6,35 см
- Идентификационный номер
- 1985.
0481.103 - регистрационный номер
- 1985.0481
- каталожный номер
- 1985.0481.103
- регистрационный номер
- 1985.0481
- Кредитная линия
- Дар Сидни Глейзера
- Посмотреть больше товаров в
- Медицина и наука: медицина
- Бальзам Америки
- Источник данных
- Национальный музей американской истории
Номинировать этот объект для фотографирования.
Наша база данных коллекций находится в стадии разработки. Мы можем обновить эту запись на основе дальнейших исследований и обзоров. Узнайте больше о нашем подходе к публикации нашей коллекции в Интернете.
Если вы хотите узнать, как вы можете использовать содержимое этой страницы, ознакомьтесь с Условиями использования Смитсоновского института. Если вам нужно запросить изображение для публикации или другого использования, посетите страницу Права и репродукции.
Примечание. Отправка комментариев временно недоступна, пока мы работаем над улучшением сайта. Приносим извинения за прерывание. Если у вас есть вопрос, касающийся коллекций музея, сначала ознакомьтесь с часто задаваемыми вопросами о коллекциях. Если вам нужен личный ответ, воспользуйтесь нашей контактной страницей.
mysql — Где ошибка в этом запросе? (sql-ex.ru упражнение 25)
спросил
Изменено 1 год, 9 месяцев назад
Просмотрено 684 раза
Пытаюсь решить Упражнение 25 с сайта sql-ex.
ru:
Схема базы данных состоит из четырех таблиц:
- Продукт (производитель, модель, тип)
- ПК(код, модель, скорость, оперативка, hd, cd, цена)
- Ноутбук(код, модель, скорость, оперативка, hd, экран, цена)
- Принтер(код, модель, цвет, тип, цена)
Найдите производителей принтеров, которые также производят ПК с наименьшим объемом ОЗУ и самой высокой скоростью процессора среди всех ПК с наименьшим объемом ОЗУ. Набор результатов: производитель.
Я не понимаю, почему следующий запрос не дает желаемого результата для второй проверочной базы данных:
ВЫБЕРИТЕ ОТЛИЧНЫЙ product.maker
ИЗ продукта
ПРАВОЕ СОЕДИНЕНИЕ принтер ВКЛ принтер.модель = продукт.модель
ГДЕ product.maker IN(
ВЫБЕРИТЕ продукт.производитель
ИЗ продукта
ПРАВОЕ СОЕДИНЕНИЕ pc ON pc.model = product.model
ГДЕ pc.ram = (ВЫБЕРИТЕ МИН.(ram) FROM pc)
И пк.скорость = (
ВЫБЕРИТЕ МАКС(t.
скорость)
ОТ (ВЫБЕРИТЕ скорость ОТ ПК, ГДЕ ОЗУ = (ВЫБЕРИТЕ МИН(ОЗУ) ОТ ПК)) КАК t
)
)
Ошибка следующая:
Неправильно Ваш запрос дал правильный набор результатов в основной базе данных, но не прошел проверку во второй, проверив базу данных * Неверное количество записей (меньше на 1)
Почему не удается выбрать ровно 1 производителя?
- MySQL
- SQL
2
Я не знаю, где ошибка в вашем запросе, но вы можете использовать что-то вроде этого:
С т АС ( SELECT * FROM PC c WHERE c.ram = (SELECT MIN(ram) FROM PC) ) ВЫБЕРИТЕ ОТЛИЧНЫЙ a.maker ОТ Продукта, ГДЕ a.type = 'ПК' И a.maker В ( ВЫБЕРИТЕ b.maker ИЗ продукта b ГДЕ b.type = 'Принтер' ) И а.модель В ( ВЫБЕРИТЕ модель ИЗ t ГДЕ скорость = (ВЫБЕРИТЕ МАКС(скорость) ИЗ t) )
2
Вот решение этой проблемы:
WITH CTE_Product AS ( ВЫБЕРИТЕ ОТЛИЧНЫЙ Создатель ОТ Продукт ГДЕ Тип = 'ПК' И Maker IN (ВЫБЕРИТЕ Maker FROM Product WHERE Type = 'Printer') ) выберите c.

RU
Mozolini)
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 5 exercises) is performed without time control for an individual
exercise, the second one (begins with the exercise #6) 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.
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.
In the same place it is possible to find features of used realization (SQL Server 2005).
N. (mcrain)
002
Certain exercises for beginners are provided on the site,
they are supplied with the necessary reference source on SQL syntax with a great number of examples.
Apart from them, 3 rating stages are suggested, they are aimed at testing of specialists and their certification.
The source is absolutely free of charge, and the certificate purchase has a voluntary basis.
0481.103
скорость)
ОТ (ВЫБЕРИТЕ скорость ОТ ПК, ГДЕ ОЗУ = (ВЫБЕРИТЕ МИН(ОЗУ) ОТ ПК)) КАК t
)
)
