{"id":359106,"date":"2024-05-21T00:25:37","date_gmt":"2024-05-21T00:25:37","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=359106"},"modified":"-0001-11-30T00:00:00","modified_gmt":"2024-05-21T00:25:37","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=359106","title":{"rendered":"<span>\u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445: \u0438\u0441\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u043e\u0432 \u0438 SQL OLAP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w780q1\/getpro\/habr\/upload_files\/66e\/102\/84d\/66e10284da1138c9ada0955f720aff74.jpg\" width=\"1280\" height=\"698\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/66e\/102\/84d\/66e10284da1138c9ada0955f720aff74.jpg\" data-blurred=\"true\"\/><\/figure>\n<p><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/em><\/p>\n<p>\u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0437\u043d\u0435\u0441-\u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0434\u0430\u0436, \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043e\u0446\u0435\u043d\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043c \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p><strong>SQL<\/strong> (Structured Query Language) \u0438 <strong>OLAP<\/strong> (Online Analytical Processing) \u2013 \u0434\u0432\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445. SQL \u2013 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c, \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c, \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>OLAP \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u043a\u0443\u0431\u044b, \u0433\u0434\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 OLAP-\u043a\u0443\u0431\u0430 \u0441 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c\u0438 &#171;\u0412\u0440\u0435\u043c\u044f&#187;, &#171;\u041f\u0440\u043e\u0434\u0443\u043a\u0442&#187; \u0438 &#171;\u0420\u0435\u0433\u0438\u043e\u043d&#187;:<\/p>\n<pre><code>+---------+----------+---------+------------+ | \u0412\u0440\u0435\u043c\u044f  | \u041f\u0440\u043e\u0434\u0443\u043a\u0442  | \u0420\u0435\u0433\u0438\u043e\u043d  | \u041f\u0440\u043e\u0434\u0430\u0436\u0438    | +---------+----------+---------+------------+ | 2023 Q1 | \u041f\u0440\u043e\u0434\u0443\u043a\u0442 \u0410 | \u0420\u0435\u0433\u0438\u043e\u043d 1 | 1000     | | 2023 Q1 | \u041f\u0440\u043e\u0434\u0443\u043a\u0442 \u0411 | \u0420\u0435\u0433\u0438\u043e\u043d 1 | 1500     | | 2023 Q1 | \u041f\u0440\u043e\u0434\u0443\u043a\u0442 \u0410 | \u0420\u0435\u0433\u0438\u043e\u043d 2 | 800      | | 2023 Q1 | \u041f\u0440\u043e\u0434\u0443\u043a\u0442 \u0411 | \u0420\u0435\u0433\u0438\u043e\u043d 2 | 1200     | | ...     | ...      | ...     | ...      | +---------+----------+---------+------------+ <\/code><\/pre>\n<p>\u041a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 SQL \u0438 OLAP \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442\u044b \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u044b \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 (Multi-dimensional Data Analysis) \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. <\/p>\n<p>\u0427\u0435\u043c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0430\u043a \u0432\u0430\u0436\u0435\u043d?<\/p>\n<ol>\n<li>\n<p><strong>\u0418\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/strong>: \u0414\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0434\u043a\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0438\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043f\u0440\u043e\u0434\u0430\u0436 \u0432 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435, \u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0434\u0430\u0436, \u043d\u043e \u0438 \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c, \u0432 \u043a\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0432 \u043a\u0430\u043a\u0438\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445 \u0438 \u0441 \u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u0431\u044b\u043b\u044c\u044e. \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u0438 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u0438\u0437\u0431\u0435\u0433\u0430\u044f \u043f\u043e\u0442\u0435\u0440\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0413\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>: \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u0441\u0432\u044f\u0437\u0438 \u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0435. \u042d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0440\u0435\u043d\u0434\u043e\u0432, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/strong>: \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043e\u043d\u0438 \u0445\u043e\u0442\u044f\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u0447\u0435\u0442\u044b \u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b.<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u043a\u0443\u0431\u044b, \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 OLAP-\u043a\u0443\u0431\u0430\u043c\u0438 (Online Analytical Processing), \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430. <\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c13\/609\/004\/c13609004067ab2c14a2257c93002dbf.png\" width=\"501\" height=\"458\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c13\/609\/004\/c13609004067ab2c14a2257c93002dbf.png\"\/><\/figure>\n<p>\u041e\u043d\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439. <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u043e\u0432:<\/p>\n<ol>\n<li>\n<p><strong>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f<\/strong>: \u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0441\u0438 \u043a\u0443\u0431\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043f\u0440\u043e\u0434\u0430\u0436 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u043a\u0430\u043a &#171;\u0412\u0440\u0435\u043c\u044f&#187;, &#171;\u041f\u0440\u043e\u0434\u0443\u043a\u0442&#187; \u0438 &#171;\u0420\u0435\u0433\u0438\u043e\u043d&#187;. \u041a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0443\u0442\u043e\u0447\u043d\u044f\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437.<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/strong>: \u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f &#171;\u041f\u0440\u043e\u0434\u0443\u043a\u0442&#187; \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438<\/strong>: \u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0438 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0443\u0440\u043e\u0432\u043d\u0438 \u043e\u0442 \u0433\u043e\u0434\u0430 \u0434\u043e \u0434\u043d\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u042f\u0447\u0435\u0439\u043a\u0438 \u043a\u0443\u0431\u0430<\/strong>: \u0412\u043d\u0443\u0442\u0440\u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0430 \u043a\u0430\u0436\u0434\u0430\u044f \u044f\u0447\u0435\u0439\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0441\u0443\u043c\u043c\u044b, \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u043e\u0432<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0430 \u0432\u0430\u0436\u043d\u043e \u0447\u0435\u0442\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u042d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 (\u043c\u0435\u0440\u044b, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u044b) \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435\u043c. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043a\u0443\u0431\u043e\u043c \u043f\u0440\u043e\u0434\u0430\u0436:<\/p>\n<pre><code class=\"sql\">-- \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0430 \u043f\u0440\u043e\u0434\u0430\u0436 CREATE CUBE SalesCube DIMENSION TimeDim (Year, Quarter, Month, Day) DIMENSION ProductDim (ProductID, Category, Price) DIMENSION RegionDim (RegionID, City, Country) MEASURE SalesAmount <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043a\u0443\u0431 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c &#171;SalesCube&#187;. \u0423 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f: &#171;TimeDim&#187;, &#171;ProductDim&#187; \u0438 &#171;RegionDim&#187;. \u041a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a &#171;Year&#187;, &#171;Quarter&#187;, &#171;ProductID&#187;, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<h4>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u0443\u0431<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u0443\u0431\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ETL (Extract, Transform, Load) \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0438\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 OLAP:<\/p>\n<pre><code class=\"sql\">-- \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u0443\u0431 \u043f\u0440\u043e\u0434\u0430\u0436 INSERT INTO SalesCube SELECT      t.Year, t.Quarter, t.Month, t.Day,     p.ProductID, p.Category, p.Price,     r.RegionID, r.City, r.Country,     SUM(s.SalesAmount) as SalesAmount FROM Sales s JOIN TimeDim t ON s.TimeID = t.TimeID JOIN ProductDim p ON s.ProductID = p.ProductID JOIN RegionDim r ON s.RegionID = r.RegionID GROUP BY      t.Year, t.Quarter, t.Month, t.Day,     p.ProductID, p.Category, p.Price,     r.RegionID, r.City, r.Country; <\/code><\/pre>\n<h4>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0443\u0431\u0430<\/h4>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u0430\u0445 \u043c\u043e\u0433\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0443\u0431\u0430. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438\u043b\u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u0430\u0445 \u0441\u043b\u0443\u0436\u0430\u0442 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0433\u043b\u043e\u0432 \u0437\u0440\u0435\u043d\u0438\u044f. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<h4>1. \u0412\u044b\u0431\u043e\u0440 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/h4>\n<p>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043c, \u043c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f &#171;\u0412\u0440\u0435\u043c\u044f&#187; \u0438 &#171;\u0420\u0435\u0433\u0438\u043e\u043d&#187;.<\/p>\n<h4>2. \u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u0441\u0440\u0435\u0437\u044b<\/h4>\n<p>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0440\u0435\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0440\u0435\u0437 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0440\u0435\u0437 &#171;\u0412\u0441\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0432 2023 \u0433\u043e\u0434\u0443 \u0434\u043b\u044f \u0420\u0435\u0433\u0438\u043e\u043d\u0430 1&#187;.<\/p>\n<pre><code class=\"sql\">SELECT * FROM SalesCube WHERE TimeDim.Year = 2023 AND RegionDim.RegionID = 1; <\/code><\/pre>\n<h4>3. \u0411\u0443\u0440\u0435\u043d\u0438\u0435 \u0432\u043d\u0438\u0437 \u0438 \u043f\u043e\u0434\u044a\u0435\u043c<\/h4>\n<p>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0431\u0443\u0440\u0435\u043d\u0438\u0435 \u0432\u043d\u0438\u0437 \u0438 \u043f\u043e\u0434\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445. \u0411\u0443\u0440\u0435\u043d\u0438\u0435 \u0432\u043d\u0438\u0437 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 \u043a\u0432\u0430\u0440\u0442\u0430\u043b\u043e\u0432 \u043a \u043c\u0435\u0441\u044f\u0446\u0430\u043c), \u0430 \u043f\u043e\u0434\u044a\u0435\u043c &#8212; \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043a \u0433\u043e\u0434\u0430\u043c).<\/p>\n<h3>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u0430\u0445<\/h3>\n<p>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u0430\u0445:<\/p>\n<h4>1. \u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438<\/h4>\n<p>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0443\u0440\u043e\u0432\u043d\u0438 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0433\u043e\u0434\u0430 \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u0434\u043d\u0435\u043c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u044f\u0445 \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<h4>2. \u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/h4>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &#171;\u041f\u0440\u043e\u0434\u0443\u043a\u0442&#187; \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 &#171;\u0426\u0435\u043d\u0430&#187;. \u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043e\u0431\u043e\u0433\u0430\u0449\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u043c \u043a\u0443\u0431\u0435:<\/p>\n<pre><code class=\"sql\">-- \u0418\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 DIMENSION TimeDim (Year, Quarter, Month, Day)  -- \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \"\u0426\u0435\u043d\u0430\" \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \"\u041f\u0440\u043e\u0434\u0443\u043a\u0442  \" DIMENSION ProductDim (ProductID, Category, Price) <\/code><\/pre>\n<h2>SQL \u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u043e\u0432, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043a\u0443\u0431 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043c\u0435\u0440\u0430\u043c\u0438. \u0414\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043a\u0443\u0431\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>SELECT<\/code>, \u0430 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 &#8212; <code>WHERE<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0430 \u043f\u0440\u043e\u0434\u0430\u0436:<\/p>\n<pre><code class=\"sql\">SELECT TimeDim.Year, ProductDim.Category, RegionDim.City, SUM(SalesAmount) as TotalSales FROM SalesCube WHERE TimeDim.Year = 2023 AND RegionDim.Country = 'USA' GROUP BY TimeDim.Year, ProductDim.Category, RegionDim.City; <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u0445 \u0432 2023 \u0433\u043e\u0434\u0443 \u0434\u043b\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 &#8216;USA&#8217; \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e \u0433\u043e\u0434\u0443, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438 \u0433\u043e\u0440\u043e\u0434\u0443.<\/p>\n<h4>\u0410\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f<\/h4>\n<p>SQL \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u044b \u0438 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u044b \u0432\u0430\u0448\u0438\u0445 \u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0441\u0443\u043c\u043c\u044b \u043f\u0440\u043e\u0434\u0430\u0436 \u043f\u043e \u0433\u043e\u0434\u0430\u043c \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432:<\/p>\n<pre><code class=\"sql\">SELECT TimeDim.Year, ProductDim.Category, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY TimeDim.Year, ProductDim.Category; <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u043e\u043f-10 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043f\u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u043c:<\/p>\n<pre><code class=\"sql\">SELECT ProductDim.Category, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY ProductDim.Category ORDER BY TotalSales DESC LIMIT 10; <\/code><\/pre>\n<p>SQL \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u0430\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<h4>JOIN \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/h4>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 JOIN \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043f\u043e \u043e\u0431\u0449\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c \u0438 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c JOIN \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c JOIN:<\/p>\n<pre><code class=\"sql\">SELECT TimeDim.Year, ProductDim.Category, RegionDim.City, SUM(SalesAmount) as TotalSales FROM SalesCube JOIN TimeDim ON SalesCube.TimeID = TimeDim.TimeID JOIN ProductDim ON SalesCube.ProductID = ProductDim.ProductID JOIN RegionDim ON SalesCube.RegionID = RegionDim.RegionID GROUP BY TimeDim.Year, ProductDim.Category, RegionDim.City; <\/code><\/pre>\n<h4>GROUP BY \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/h4>\n<p>GROUP BY \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0434\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 GROUP BY:<\/p>\n<pre><code class=\"sql\">SELECT TimeDim.Year, ProductDim.Category, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY TimeDim.Year, ProductDim.Category; <\/code><\/pre>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/h4>\n<p><strong>1. \u0422\u043e\u043f-\u043d \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043f\u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u043c:<\/strong><\/p>\n<pre><code class=\"sql\">SELECT ProductDim.ProductName, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY ProductDim.ProductName ORDER BY TotalSales DESC LIMIT 10; <\/code><\/pre>\n<p><strong>2. \u0414\u0438\u043d\u0430\u043c\u0438\u043a\u0430 \u043f\u0440\u043e\u0434\u0430\u0436 \u043f\u043e \u0433\u043e\u0434\u0430\u043c:<\/strong><\/p>\n<pre><code class=\"sql\">SELECT TimeDim.Year, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY TimeDim.Year ORDER BY TimeDim.Year; <\/code><\/pre>\n<p><strong>3. \u0421\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0430\u0436 \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0433\u043e\u0434\u044b:<\/strong><\/p>\n<pre><code class=\"sql\">SELECT TimeDim.Year, ProductDim.Category, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY TimeDim.Year, ProductDim.Category; <\/code><\/pre>\n<h2>OLAP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b<\/h2>\n<p>OLAP-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0442 \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u043c\u0438 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u043a\u0443\u0431\u044b, \u043a\u0430\u043a \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0440\u0430\u043d\u0435\u0435. \u041e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0434\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b, \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0430\u0434 \u0434\u0430\u043d\u043d\u044b\u043c\u0438.<\/p>\n<p><strong>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043f\u043e\u043d\u044f\u0442\u0438\u044f OLAP-\u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:<\/strong><\/p>\n<ul>\n<li>\n<p><strong>\u0421\u0440\u0435\u0437 (Slice)<\/strong>: \u0421\u0440\u0435\u0437 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0432\u044b\u0431\u043e\u0440\u043a\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0430 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u0438\u043b\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u0431\u0440\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0433\u043e \u0433\u043e\u0434\u0430 \u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0414\u0430\u0439\u0441 (Dice)<\/strong>: \u0414\u0430\u0439\u0441 &#8212; \u044d\u0442\u043e \u043f\u043e\u0434\u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0441\u043e\u0437\u0434\u0430\u0435\u0442\u0441\u044f \u043f\u0443\u0442\u0435\u043c \u0432\u044b\u0431\u043e\u0440\u0430 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043d\u043e\u0432\u043e\u0433\u043e \u0441\u0440\u0435\u0437\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u043e\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0434\u0430\u0439\u0441, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u043a\u0432\u0430\u0440\u0442\u0430\u043b\u0430 \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u0432\u043e\u0440\u043e\u0442 (Pivot)<\/strong>: \u041f\u043e\u0432\u043e\u0440\u043e\u0442 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043e\u0440\u0438\u0435\u043d\u0442\u0430\u0446\u0438\u044e \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0430, \u043f\u0435\u0440\u0435\u043a\u043b\u044e\u0447\u0430\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043c\u0435\u0441\u0442\u0430\u043c\u0438. \u042d\u0442\u043e \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u0440\u0430\u043a\u0443\u0440\u0441\u043e\u0432.<\/p>\n<\/li>\n<\/ul>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430<\/h4>\n<p><strong>1. \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0440\u0435\u0437\u0430 (Slice) \u0438 \u0434\u0430\u0439\u0441\u0430 (Dice):<\/strong><\/p>\n<pre><code class=\"sql\">-- \u0421\u0440\u0435\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f 2023 \u0433\u043e\u0434\u0430 \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 '\u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0430' SELECT * FROM SalesCube WHERE TimeDim.Year = 2023 AND ProductDim.Category = '\u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0430';  -- \u0414\u0430\u0439\u0441 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f 2023 \u0433\u043e\u0434\u0430 \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 '\u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0430' \u0438 \u043a\u0432\u0430\u0440\u0442\u0430\u043b\u0430 Q1 SELECT * FROM SalesCube WHERE TimeDim.Year = 2023 AND ProductDim.Category = '\u042d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u0438\u043a\u0430' AND TimeDim.Quarter = 'Q1'; <\/code><\/pre>\n<p><strong>2. \u041f\u043e\u0432\u043e\u0440\u043e\u0442 (Pivot) \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430:<\/strong><\/p>\n<pre><code class=\"sql\">-- \u041f\u043e\u0432\u043e\u0440\u043e\u0442 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u043f\u0440\u043e\u0434\u0430\u0436 \u043f\u043e \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0432 \u0440\u0430\u0437\u043d\u044b\u0435 \u0433\u043e\u0434\u044b SELECT TimeDim.Year, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY TimeDim.Year, ProductDim.Category; <\/code><\/pre>\n<p><strong>3. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 ROLLUP \u0438 CUBE:<\/strong><\/p>\n<pre><code class=\"sql\">-- \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u0441\u0432\u043e\u0434\u043d\u043e\u0439 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c ROLLUP SELECT TimeDim.Year, ProductDim.Category, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY ROLLUP (TimeDim.Year, ProductDim.Category); <\/code><\/pre>\n<p><strong>4. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439:<\/strong><\/p>\n<pre><code class=\"sql\">-- \u0420\u0430\u043d\u0436\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043f\u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u043c \u0432 \u043a\u0430\u0436\u0434\u043e\u0439 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 SELECT ProductDim.Category, ProductDim.ProductName, SUM(SalesAmount) as TotalSales,        RANK() OVER (PARTITION BY ProductDim.Category ORDER BY SUM(SalesAmount) DESC) as SalesRank FROM SalesCube GROUP BY ProductDim.Category, ProductDim.ProductName; <\/code><\/pre>\n<p><strong>5. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0430\u0433\u0440\u0435\u0433\u0430\u0442\u043e\u0432:<\/strong><\/p>\n<pre><code class=\"sql\">-- \u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u043b\u044c\u0437\u044f\u0449\u0435\u0433\u043e \u0441\u0440\u0435\u0434\u043d\u0435\u0433\u043e \u043f\u0440\u043e\u0434\u0430\u0436 \u043f\u043e \u043c\u0435\u0441\u044f\u0446\u0430\u043c SELECT TimeDim.Year, TimeDim.Month, AVG(SUM(SalesAmount)) OVER (ORDER BY TimeDim.Year, TimeDim.Month ROWS BETWEEN 2 PRECEDING AND CURRENT ROW) as MovingAvgSales FROM SalesCube GROUP BY TimeDim.Year, TimeDim.Month; <\/code><\/pre>\n<p>\u041f\u0440\u0438 \u0440\u0430\u0431\u043e\u0442\u0435 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438 \u043e\u0431\u044a\u0435\u043c\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 OLAP-\u0437\u0430\u043f\u0440\u043e\u0441\u0430\u043c\u0438 \u0432\u0430\u0436\u043d\u043e \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432:<\/p>\n<ul>\n<li>\n<p>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0439\u0442\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b \u043d\u0430 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439, \u0447\u0442\u043e\u0431\u044b \u0443\u0441\u043a\u043e\u0440\u0438\u0442\u044c \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u0442\u0435 \u043f\u0440\u0435\u0434\u0432\u0430\u0440\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0438 \u043a\u044d\u0448\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445, \u0447\u0442\u043e\u0431\u044b \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432.<\/p>\n<\/li>\n<li>\n<p>\u041f\u0435\u0440\u0438\u043e\u0434\u0438\u0447\u0435\u0441\u043a\u0438 \u043f\u0435\u0440\u0435\u0441\u0442\u0440\u0430\u0438\u0432\u0430\u0439\u0442\u0435 \u043a\u0443\u0431\u044b, \u0447\u0442\u043e\u0431\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u0443\u043b\u0443\u0447\u0448\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p>\u041e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u0443\u0439\u0442\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432, \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u044b\u0445 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u0439 \u0438 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u0435\u0440\u0435\u0434 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0435\u0439.<\/p>\n<\/li>\n<\/ul>\n<h2>\u0417\u0430\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435<\/h2>\n<p>\u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0446\u0435\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0430\u0439\u0442\u044b \u0438\u0437 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u044f, \u043f\u043b\u0430\u043d\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u0430\u0440\u043a\u0435\u0442\u0438\u043d\u0433\u043e\u0432\u044b\u0435 \u0430\u043a\u0446\u0438\u0438 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u0438\u0437\u043d\u0435\u0441-\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u044b.<\/p>\n<p>\u0412 \u043f\u0440\u0435\u0434\u0434\u0432\u0435\u0440\u0438\u0438 \u0441\u0442\u0430\u0440\u0442\u0430 \u043a\u0443\u0440\u0441\u0430 <a href=\"https:\/\/otus.pw\/ZgS2\/\">&#171;\u0421\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a. Team Lead&#187;<\/a> \u0445\u043e\u0447\u0443 \u043f\u0440\u0438\u0433\u043b\u0430\u0441\u0438\u0442\u044c \u0432\u0430\u0441 \u043d\u0430 \u0431\u0435\u0441\u043f\u043b\u0430\u0442\u043d\u044b\u0435 \u0432\u0435\u0431\u0438\u043d\u0430\u0440\u044b \u043a\u0443\u0440\u0441\u0430 \u043f\u043e \u0442\u0435\u043c\u0430\u043c:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/otus.pw\/0sR9\/\">\u0412\u044b\u0431\u043e\u0440 \u0438 \u0430\u0434\u0430\u043f\u0442\u0430\u0446\u0438\u044f \u0418\u0422-\u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u0438 \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0440\u044b\u043d\u043a\u0430<\/a><\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/otus.pw\/bbDP\/\">\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0438 \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u044f \u0441\u0438\u0441\u0442\u0435\u043c\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u043a\u043e\u0432.<\/a> <\/p>\n<\/li>\n<\/ul>\n<p>\u041f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0435, \u0431\u0443\u0434\u0435\u0442 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e!<\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/771390\/\"> https:\/\/habr.com\/ru\/articles\/771390\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<figure class=\"full-width\"><\/figure>\n<p><em>\u041f\u0440\u0438\u0432\u0435\u0442, \u0425\u0430\u0431\u0440!<\/em><\/p>\n<p>\u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043e\u043f\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0436\u0435\u0441\u0442\u0432\u043e\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u044f \u0431\u043e\u043b\u0435\u0435 \u0433\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445. \u042d\u0442\u043e \u0432\u0430\u0436\u043d\u043e \u0434\u043b\u044f \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u044f \u043e\u0431\u043e\u0441\u043d\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0431\u0438\u0437\u043d\u0435\u0441-\u0440\u0435\u0448\u0435\u043d\u0438\u0439, \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432.<\/p>\n<p>\u0420\u0430\u0431\u043e\u0442\u0430\u044f \u0441 \u0434\u0430\u043d\u043d\u044b\u043c\u0438, \u043c\u044b \u0441\u0442\u0430\u043b\u043a\u0438\u0432\u0430\u0435\u043c\u0441\u044f \u0441 \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u043c\u0438 \u0437\u0430\u0434\u0430\u0447\u0430\u043c\u0438, \u0442\u0430\u043a\u0438\u043c\u0438 \u043a\u0430\u043a \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u0440\u043e\u0434\u0430\u0436, \u043c\u043e\u043d\u0438\u0442\u043e\u0440\u0438\u043d\u0433 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432, \u043e\u0446\u0435\u043d\u043a\u0430 \u043a\u043b\u0438\u0435\u043d\u0442\u0441\u043a\u043e\u0439 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0438 \u043c\u043d\u043e\u0433\u043e\u0435 \u0434\u0440\u0443\u0433\u043e\u0435. \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0438\u043c \u043b\u0443\u0447\u0448\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u0442\u044c \u0432\u0437\u0430\u0438\u043c\u043e\u0441\u0432\u044f\u0437\u0438 \u043c\u0435\u0436\u0434\u0443 \u0434\u0430\u043d\u043d\u044b\u043c\u0438 \u0438 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p><strong>SQL<\/strong> (Structured Query Language) \u0438 <strong>OLAP<\/strong> (Online Analytical Processing) \u2013 \u0434\u0432\u0430 \u0432\u0430\u0436\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445. SQL \u2013 \u044d\u0442\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0439 \u044f\u0437\u044b\u043a \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u0432 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0440\u0435\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u043c\u0438 \u0431\u0430\u0437\u0430\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c, \u0444\u0438\u043b\u044c\u0442\u0440\u043e\u0432\u0430\u0442\u044c, \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0438 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435.<\/p>\n<p>OLAP \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b \u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430. \u041e\u043d \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u043a\u0443\u0431\u044b, \u0433\u0434\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u0432\u043e\u043a\u0440\u0443\u0433 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439, \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u044f \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0438 \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e \u043f\u043e \u0434\u0430\u043d\u043d\u044b\u043c.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 OLAP-\u043a\u0443\u0431\u0430 \u0441 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c\u0438 &#171;\u0412\u0440\u0435\u043c\u044f&#187;, &#171;\u041f\u0440\u043e\u0434\u0443\u043a\u0442&#187; \u0438 &#171;\u0420\u0435\u0433\u0438\u043e\u043d&#187;:<\/p>\n<pre><code>+---------+----------+---------+------------+ | \u0412\u0440\u0435\u043c\u044f  | \u041f\u0440\u043e\u0434\u0443\u043a\u0442  | \u0420\u0435\u0433\u0438\u043e\u043d  | \u041f\u0440\u043e\u0434\u0430\u0436\u0438    | +---------+----------+---------+------------+ | 2023 Q1 | \u041f\u0440\u043e\u0434\u0443\u043a\u0442 \u0410 | \u0420\u0435\u0433\u0438\u043e\u043d 1 | 1000     | | 2023 Q1 | \u041f\u0440\u043e\u0434\u0443\u043a\u0442 \u0411 | \u0420\u0435\u0433\u0438\u043e\u043d 1 | 1500     | | 2023 Q1 | \u041f\u0440\u043e\u0434\u0443\u043a\u0442 \u0410 | \u0420\u0435\u0433\u0438\u043e\u043d 2 | 800      | | 2023 Q1 | \u041f\u0440\u043e\u0434\u0443\u043a\u0442 \u0411 | \u0420\u0435\u0433\u0438\u043e\u043d 2 | 1200     | | ...     | ...      | ...     | ...      | +---------+----------+---------+------------+ <\/code><\/pre>\n<p>\u041a\u043e\u043c\u0431\u0438\u043d\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 SQL \u0438 OLAP \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u0435 \u0430\u043d\u0430\u043b\u0438\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043e\u0442\u0447\u0435\u0442\u044b \u0438 \u0432\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0442\u044c \u0444\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u0438\u0437\u043d\u0435\u0441-\u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0444\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>\u041e\u0441\u043d\u043e\u0432\u044b \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u0430\u043d\u0430\u043b\u0438\u0437\u0430 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 (Multi-dimensional Data Analysis) \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u043c\u0435\u0442\u043e\u0434\u043e\u043b\u043e\u0433\u0438\u044e, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043d\u0430\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435, \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0438\u043b\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432 \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e. <\/p>\n<p>\u0427\u0435\u043c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u0442\u0430\u043a \u0432\u0430\u0436\u0435\u043d?<\/p>\n<ol>\n<li>\n<p><strong>\u0418\u0437\u0431\u044b\u0442\u043e\u0447\u043d\u043e\u0441\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438<\/strong>: \u0414\u0430\u043d\u043d\u044b\u0435 \u0440\u0435\u0434\u043a\u043e \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0432\u0441\u0435\u0433\u043e \u043e\u0434\u043d\u0438\u043c \u0430\u0441\u043f\u0435\u043a\u0442\u043e\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043f\u0440\u043e\u0434\u0430\u0436 \u0432 \u043c\u0430\u0433\u0430\u0437\u0438\u043d\u0435, \u043d\u0430\u043c \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043d\u043e \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0434\u0430\u0436, \u043d\u043e \u0438 \u043a\u0430\u043a\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u043f\u0440\u043e\u0434\u0430\u0432\u0430\u043b\u0438\u0441\u044c, \u0432 \u043a\u0430\u043a\u043e\u0439 \u043f\u0435\u0440\u0438\u043e\u0434 \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u0432 \u043a\u0430\u043a\u0438\u0445 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u0445 \u0438 \u0441 \u043a\u0430\u043a\u043e\u0439 \u043f\u0440\u0438\u0431\u044b\u043b\u044c\u044e. \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c \u0432\u0441\u0435 \u044d\u0442\u0438 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u043e\u0434\u043d\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u043e, \u0438\u0437\u0431\u0435\u0433\u0430\u044f \u043f\u043e\u0442\u0435\u0440\u0438 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438.<\/p>\n<\/li>\n<li>\n<p><strong>\u0413\u043b\u0443\u0431\u043e\u043a\u043e\u0435 \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445<\/strong>: \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0432\u044b\u044f\u0432\u043b\u044f\u0442\u044c \u0441\u043a\u0440\u044b\u0442\u044b\u0435 \u0441\u0432\u044f\u0437\u0438 \u0438 \u043f\u0430\u0442\u0442\u0435\u0440\u043d\u044b \u0432 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043c\u043e\u0433\u043b\u0438 \u0431\u044b \u043e\u0441\u0442\u0430\u0442\u044c\u0441\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u0447\u0435\u043d\u043d\u044b\u043c\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0435. \u042d\u0442\u043e \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u0435\u0437\u043d\u043e \u043f\u0440\u0438 \u043f\u0440\u043e\u0433\u043d\u043e\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u0442\u0440\u0435\u043d\u0434\u043e\u0432, \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u0438\u0438 \u0441\u0442\u0440\u0430\u0442\u0435\u0433\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0440\u0435\u0448\u0435\u043d\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p><strong>\u041f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u0441\u043a\u0430\u044f \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/strong>: \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u0435\u043b\u044f\u043c \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c, \u043a\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043e\u043d\u0438 \u0445\u043e\u0442\u044f\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c. \u042d\u0442\u043e \u0434\u0430\u0435\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043f\u0435\u0440\u0441\u043e\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043e\u0442\u0447\u0435\u0442\u044b \u0438 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u044b.<\/p>\n<\/li>\n<\/ol>\n<p>\u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0435 \u043a\u0443\u0431\u044b, \u0447\u0430\u0441\u0442\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u043c\u044b\u0435 OLAP-\u043a\u0443\u0431\u0430\u043c\u0438 (Online Analytical Processing), \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0442\u0441\u044f \u0434\u043b\u044f \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430. <\/p>\n<figure class=\"\"><\/figure>\n<p>\u041e\u043d\u0438 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0441\u0442\u043e\u0439 \u0438 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441 \u0443\u0447\u0435\u0442\u043e\u043c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439. <\/p>\n<p>\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0445\u0430\u0440\u0430\u043a\u0442\u0435\u0440\u0438\u0441\u0442\u0438\u043a\u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u043e\u0432:<\/p>\n<ol>\n<li>\n<p><strong>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f<\/strong>: \u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043e\u0441\u0438 \u043a\u0443\u0431\u0430. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0440\u0438 \u0430\u043d\u0430\u043b\u0438\u0437\u0435 \u043f\u0440\u043e\u0434\u0430\u0436 \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f, \u043a\u0430\u043a &#171;\u0412\u0440\u0435\u043c\u044f&#187;, &#171;\u041f\u0440\u043e\u0434\u0443\u043a\u0442&#187; \u0438 &#171;\u0420\u0435\u0433\u0438\u043e\u043d&#187;. \u041a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u043d\u0430\u0431\u043e\u0440 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0443\u0442\u043e\u0447\u043d\u044f\u0442\u044c \u0430\u043d\u0430\u043b\u0438\u0437.<\/p>\n<\/li>\n<li>\n<p><strong>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/strong>: \u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u043a\u043e\u043d\u043a\u0440\u0435\u0442\u043d\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0435 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f &#171;\u041f\u0440\u043e\u0434\u0443\u043a\u0442&#187; \u043c\u043e\u0433\u0443\u0442 \u0431\u044b\u0442\u044c \u043d\u0430\u0438\u043c\u0435\u043d\u043e\u0432\u0430\u043d\u0438\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f \u0438 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c.<\/p>\n<\/li>\n<li>\n<p><strong>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438<\/strong>: \u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u043e\u043c \u0438 \u043e\u0431\u043e\u0431\u0449\u0435\u043d\u043d\u043e\u043c \u0432\u0438\u0434\u0435. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u043e\u0436\u0435\u0442 \u0432\u043a\u043b\u044e\u0447\u0430\u0442\u044c \u0443\u0440\u043e\u0432\u043d\u0438 \u043e\u0442 \u0433\u043e\u0434\u0430 \u0434\u043e \u0434\u043d\u044f.<\/p>\n<\/li>\n<li>\n<p><strong>\u042f\u0447\u0435\u0439\u043a\u0438 \u043a\u0443\u0431\u0430<\/strong>: \u0412\u043d\u0443\u0442\u0440\u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0430 \u043a\u0430\u0436\u0434\u0430\u044f \u044f\u0447\u0435\u0439\u043a\u0430 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0434\u043b\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0439 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u043e \u0438\u0437\u0432\u043b\u0435\u043a\u0430\u0442\u044c \u0441\u0443\u043c\u043c\u044b, \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0435 \u043c\u0435\u0442\u0440\u0438\u043a\u0438.<\/p>\n<\/li>\n<\/ol>\n<h2>\u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u043e\u0432<\/h2>\n<p>\u041f\u0435\u0440\u0435\u0434 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u0435\u043c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0430 \u0432\u0430\u0436\u043d\u043e \u0447\u0435\u0442\u043a\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u042d\u0442\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 (\u043c\u0435\u0440\u044b, \u043f\u043e \u043a\u043e\u0442\u043e\u0440\u044b\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0431\u0443\u0434\u0443\u0442 \u0430\u0433\u0440\u0435\u0433\u0438\u0440\u043e\u0432\u0430\u043d\u044b) \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432, \u0441\u0432\u044f\u0437\u0430\u043d\u043d\u044b\u0445 \u0441 \u043a\u0430\u0436\u0434\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435\u043c. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441 \u043a\u0443\u0431\u043e\u043c \u043f\u0440\u043e\u0434\u0430\u0436:<\/p>\n<pre><code class=\"sql\">-- \u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0430 \u043f\u0440\u043e\u0434\u0430\u0436 CREATE CUBE SalesCube DIMENSION TimeDim (Year, Quarter, Month, Day) DIMENSION ProductDim (ProductID, Category, Price) DIMENSION RegionDim (RegionID, City, Country) MEASURE SalesAmount <\/code><\/pre>\n<p>\u0412 \u044d\u0442\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u043c\u044b \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043a\u0443\u0431 \u043f\u043e\u0434 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435\u043c &#171;SalesCube&#187;. \u0423 \u043d\u0435\u0433\u043e \u0435\u0441\u0442\u044c \u0442\u0440\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f: &#171;TimeDim&#187;, &#171;ProductDim&#187; \u0438 &#171;RegionDim&#187;. \u041a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u0432\u043e\u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b, \u0442\u0430\u043a\u0438\u0435 \u043a\u0430\u043a &#171;Year&#187;, &#171;Quarter&#187;, &#171;ProductID&#187;, \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435.<\/p>\n<h4>\u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u0443\u0431<\/h4>\n<p>\u041f\u043e\u0441\u043b\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u043a\u0443\u0431\u0430, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0437\u0430\u0433\u0440\u0443\u0437\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435. \u042d\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e ETL (Extract, Transform, Load) \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0432 \u0438\u043b\u0438 \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043c\u0435\u043d\u0442\u043e\u0432 OLAP:<\/p>\n<pre><code class=\"sql\">-- \u0417\u0430\u0433\u0440\u0443\u0437\u043a\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043a\u0443\u0431 \u043f\u0440\u043e\u0434\u0430\u0436 INSERT INTO SalesCube SELECT      t.Year, t.Quarter, t.Month, t.Day,     p.ProductID, p.Category, p.Price,     r.RegionID, r.City, r.Country,     SUM(s.SalesAmount) as SalesAmount FROM Sales s JOIN TimeDim t ON s.TimeID = t.TimeID JOIN ProductDim p ON s.ProductID = p.ProductID JOIN RegionDim r ON s.RegionID = r.RegionID GROUP BY      t.Year, t.Quarter, t.Month, t.Day,     p.ProductID, p.Category, p.Price,     r.RegionID, r.City, r.Country; <\/code><\/pre>\n<h4>\u041e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043a\u0443\u0431\u0430<\/h4>\n<p>\u0414\u0430\u043d\u043d\u044b\u0435 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u0430\u0445 \u043c\u043e\u0433\u0443\u0442 \u0438\u0437\u043c\u0435\u043d\u044f\u0442\u044c\u0441\u044f \u0441\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c. \u041f\u043e\u044d\u0442\u043e\u043c\u0443 \u0432\u0430\u0436\u043d\u043e \u0438\u043c\u0435\u0442\u044c \u043c\u0435\u0445\u0430\u043d\u0438\u0437\u043c\u044b \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u044f \u043a\u0443\u0431\u0430. \u042d\u0442\u043e \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0440\u0435\u0433\u0443\u043b\u044f\u0440\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0438\u0441\u0442\u043e\u0447\u043d\u0438\u043a\u043e\u0432 \u0438\u043b\u0438 \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0430\u043b\u044c\u043d\u043e\u0435 \u043e\u0431\u043d\u043e\u0432\u043b\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0438\u0437\u043c\u0435\u043d\u0435\u043d\u0438\u0439.<\/p>\n<p>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u0430\u0445 \u0441\u043b\u0443\u0436\u0430\u0442 \u0434\u043b\u044f \u043a\u043b\u0430\u0441\u0441\u0438\u0444\u0438\u043a\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0441 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0433\u043b\u043e\u0432 \u0437\u0440\u0435\u043d\u0438\u044f. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c, \u043a\u0430\u043a \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435:<\/p>\n<h4>1. \u0412\u044b\u0431\u043e\u0440 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u0430\u043d\u0430\u043b\u0438\u0437\u0430<\/h4>\n<p>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0432\u044b\u0431\u0438\u0440\u0430\u044e\u0442\u0441\u044f \u0432 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0437\u0430\u0434\u0430\u0447. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0438 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043c, \u043c\u044b \u0432\u044b\u0431\u0435\u0440\u0435\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f &#171;\u0412\u0440\u0435\u043c\u044f&#187; \u0438 &#171;\u0420\u0435\u0433\u0438\u043e\u043d&#187;.<\/p>\n<h4>2. \u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u0438 \u0441\u0440\u0435\u0437\u044b<\/h4>\n<p>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0440\u0435\u0437\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u0421\u0440\u0435\u0437 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u0441\u0440\u0435\u0437 &#171;\u0412\u0441\u0435 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u044b \u0432 2023 \u0433\u043e\u0434\u0443 \u0434\u043b\u044f \u0420\u0435\u0433\u0438\u043e\u043d\u0430 1&#187;.<\/p>\n<pre><code class=\"sql\">SELECT * FROM SalesCube WHERE TimeDim.Year = 2023 AND RegionDim.RegionID = 1; <\/code><\/pre>\n<h4>3. \u0411\u0443\u0440\u0435\u043d\u0438\u0435 \u0432\u043d\u0438\u0437 \u0438 \u043f\u043e\u0434\u044a\u0435\u043c<\/h4>\n<p>\u0418\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0431\u0443\u0440\u0435\u043d\u0438\u0435 \u0432\u043d\u0438\u0437 \u0438 \u043f\u043e\u0434\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445. \u0411\u0443\u0440\u0435\u043d\u0438\u0435 \u0432\u043d\u0438\u0437 \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437 \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u0435\u0439 \u0434\u0430\u043d\u043d\u044b\u0445 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 \u043a\u0432\u0430\u0440\u0442\u0430\u043b\u043e\u0432 \u043a \u043c\u0435\u0441\u044f\u0446\u0430\u043c), \u0430 \u043f\u043e\u0434\u044a\u0435\u043c &#8212; \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u043d\u0430 \u0431\u043e\u043b\u0435\u0435 \u0432\u044b\u0441\u043e\u043a\u0438\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 (\u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u043f\u0435\u0440\u0435\u0445\u043e\u0434 \u043e\u0442 \u043c\u0435\u0441\u044f\u0446\u0435\u0432 \u043a \u0433\u043e\u0434\u0430\u043c).<\/p>\n<h3>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u0430\u0445<\/h3>\n<p>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0440\u043e\u0432\u043d\u0438 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u0430\u0445:<\/p>\n<h4>1. \u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438<\/h4>\n<p>\u0418\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0443\u0440\u043e\u0432\u043d\u0438 \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0432\u043d\u0443\u0442\u0440\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0435 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u044e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0433\u043e\u0434\u0430 \u0438 \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u044f \u0434\u043d\u0435\u043c. \u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0439 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u043d\u0430 \u0440\u0430\u0437\u043d\u044b\u0445 \u0443\u0440\u043e\u0432\u043d\u044f\u0445 \u0434\u0435\u0442\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438.<\/p>\n<h4>2. \u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b<\/h4>\n<p>\u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0441\u043e\u0431\u043e\u0439 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0441\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u0445 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u043e\u0432. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0443 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 &#171;\u041f\u0440\u043e\u0434\u0443\u043a\u0442&#187; \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0430\u0442\u0440\u0438\u0431\u0443\u0442 &#171;\u0426\u0435\u043d\u0430&#187;. \u0410\u0442\u0440\u0438\u0431\u0443\u0442\u044b \u043e\u0431\u043e\u0433\u0430\u0449\u0430\u044e\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0434\u0435\u0442\u0430\u043b\u044c\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u0438\u0435\u0440\u0430\u0440\u0445\u0438\u0438 \u0438 \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430 \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u043c \u043a\u0443\u0431\u0435:<\/p>\n<pre><code class=\"sql\">-- \u0418\u0435\u0440\u0430\u0440\u0445\u0438\u044f \u0432\u0440\u0435\u043c\u0435\u043d\u0438 DIMENSION TimeDim (Year, Quarter, Month, Day)  -- \u0410\u0442\u0440\u0438\u0431\u0443\u0442 \"\u0426\u0435\u043d\u0430\" \u0434\u043b\u044f \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f \"\u041f\u0440\u043e\u0434\u0443\u043a\u0442  \" DIMENSION ProductDim (ProductID, Category, Price) <\/code><\/pre>\n<h2>SQL \u0438 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u0430\u043d\u0430\u043b\u0438\u0437 \u0434\u0430\u043d\u043d\u044b\u0445<\/h2>\n<p>\u0414\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u043e\u0432, \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u0435 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u044b. \u041c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0439 \u043a\u0443\u0431 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0430 \u0441 \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u043c\u0438 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u043c\u0435\u0440\u0430\u043c\u0438. \u0414\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043a\u0443\u0431\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 <code>SELECT<\/code>, \u0430 \u0434\u043b\u044f \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u0444\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u0438 &#8212; <code>WHERE<\/code>.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u043e\u0433\u043e \u043a\u0443\u0431\u0430 \u043f\u0440\u043e\u0434\u0430\u0436:<\/p>\n<pre><code class=\"sql\">SELECT TimeDim.Year, ProductDim.Category, RegionDim.City, SUM(SalesAmount) as TotalSales FROM SalesCube WHERE TimeDim.Year = 2023 AND RegionDim.Country = 'USA' GROUP BY TimeDim.Year, ProductDim.Category, RegionDim.City; <\/code><\/pre>\n<p>\u042d\u0442\u043e\u0442 \u0437\u0430\u043f\u0440\u043e\u0441 \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u0442 \u0434\u0430\u043d\u043d\u044b\u0435 \u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u0445 \u0432 2023 \u0433\u043e\u0434\u0443 \u0434\u043b\u044f \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 &#8216;USA&#8217; \u0441 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u043f\u043e \u0433\u043e\u0434\u0443, \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0438 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u0438 \u0433\u043e\u0440\u043e\u0434\u0443.<\/p>\n<h4>\u0410\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044f \u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f<\/h4>\n<p>SQL \u0442\u0430\u043a\u0436\u0435 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c, \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u044c \u0441\u0440\u0435\u0434\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c\u044b \u0438 \u043c\u0438\u043d\u0438\u043c\u0443\u043c\u044b \u0432\u0430\u0448\u0438\u0445 \u043c\u0435\u0440 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0441\u0443\u043c\u043c\u044b \u043f\u0440\u043e\u0434\u0430\u0436 \u043f\u043e \u0433\u043e\u0434\u0430\u043c \u0438 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u044f\u043c \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432:<\/p>\n<pre><code class=\"sql\">SELECT TimeDim.Year, ProductDim.Category, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY TimeDim.Year, ProductDim.Category; <\/code><\/pre>\n<p>\u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0431\u043e\u043b\u0435\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0442\u0438\u0432\u043d\u044b\u043c\u0438, \u0432\u044b \u043c\u043e\u0436\u0435\u0442\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438 \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u0432\u0430\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043f\u0438\u0441\u0435\u0439 \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430\u0445.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0434\u043b\u044f \u0432\u044b\u0431\u043e\u0440\u0430 \u0442\u043e\u043f-10 \u043a\u0430\u0442\u0435\u0433\u043e\u0440\u0438\u0439 \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043f\u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u043c:<\/p>\n<pre><code class=\"sql\">SELECT ProductDim.Category, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY ProductDim.Category ORDER BY TotalSales DESC LIMIT 10; <\/code><\/pre>\n<p>SQL \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u044b \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0434\u043e\u0441\u0442\u0443\u043f \u043a \u0434\u0430\u043d\u043d\u044b\u043c \u0432 \u043c\u043d\u043e\u0433\u043e\u043c\u0435\u0440\u043d\u044b\u0445 \u043a\u0443\u0431\u0430\u0445 \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0445 \u0430\u043d\u0430\u043b\u0438\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<h4>JOIN \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/h4>\n<p>\u041e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 JOIN \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0438\u0437 \u0440\u0430\u0437\u043d\u044b\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439 \u043f\u043e \u043e\u0431\u0449\u0438\u043c \u0430\u0442\u0440\u0438\u0431\u0443\u0442\u0430\u043c. \u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440, \u0435\u0441\u043b\u0438 \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0430\u043d\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u043e\u0434\u0430\u0436\u0438 \u043f\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438, \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0430\u043c \u0438 \u0440\u0435\u0433\u0438\u043e\u043d\u0430\u043c, \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c JOIN \u0434\u043b\u044f \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u0439.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440\u043e\u043c JOIN:<\/p>\n<pre><code class=\"sql\">SELECT TimeDim.Year, ProductDim.Category, RegionDim.City, SUM(SalesAmount) as TotalSales FROM SalesCube JOIN TimeDim ON SalesCube.TimeID = TimeDim.TimeID JOIN ProductDim ON SalesCube.ProductID = ProductDim.ProductID JOIN RegionDim ON SalesCube.RegionID = RegionDim.RegionID GROUP BY TimeDim.Year, ProductDim.Category, RegionDim.City; <\/code><\/pre>\n<h4>GROUP BY \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440<\/h4>\n<p>GROUP BY \u043e\u043f\u0435\u0440\u0430\u0442\u043e\u0440 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u044b\u043c \u0438\u0437\u043c\u0435\u0440\u0435\u043d\u0438\u044f\u043c. \u042d\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442\u044c \u0430\u0433\u0440\u0435\u0433\u0430\u0446\u0438\u044e \u0434\u0430\u043d\u043d\u044b\u0445 \u0438 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u0441\u0432\u043e\u0434\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b.<\/p>\n<p>\u041f\u0440\u0438\u043c\u0435\u0440 SQL-\u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u0441 GROUP BY:<\/p>\n<pre><code class=\"sql\">SELECT TimeDim.Year, ProductDim.Category, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY TimeDim.Year, ProductDim.Category; <\/code><\/pre>\n<h4>\u041f\u0440\u0438\u043c\u0435\u0440\u044b \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u044f<\/h4>\n<p><strong>1. \u0422\u043e\u043f-\u043d \u043f\u0440\u043e\u0434\u0443\u043a\u0442\u043e\u0432 \u043f\u043e \u043f\u0440\u043e\u0434\u0430\u0436\u0430\u043c:<\/strong><\/p>\n<pre><code class=\"sql\">SELECT ProductDim.ProductName, SUM(SalesAmount) as TotalSales FROM SalesCube GROUP BY ProductDim.ProductName ORDER BY TotalSales DESC LIMIT 10; <\/code><\/pre>\n<p><strong>2.<\/strong><\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-359106","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/359106","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=359106"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/359106\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=359106"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=359106"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=359106"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}