This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --Inner joins | |
| --№2 | |
| --SELECT p.name AS ProductName, c.name AS CategoryName, s.name AS SupplierName | |
| --FROM Product p | |
| --INNER JOIN Supplier s ON p.id_producer = s.id | |
| --INNER JOIN Category c ON p.id_category = c.id | |
| --WHERE s.name NOT LIKE '%[АКМ]%' | |
| --AND c.name <> 'Крупы'; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| --№1 | |
| --SELECT name, AVG(price) AS avg_price | |
| --FROM Product | |
| --GROUP BY name | |
| --HAVING AVG(price) > 50; | |
| --№2 | |
| --SELECT id_category, COUNT(id) AS product_count | |
| --FROM Product | |
| --GROUP BY id_category |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [master] | |
| GO | |
| /****** Object: Database [DZ3] Script Date: 17.02.2025 17:51:18 ******/ | |
| CREATE DATABASE [DZ3] | |
| CONTAINMENT = NONE | |
| ON PRIMARY | |
| ( NAME = N'DZ3', FILENAME = N'E:\sql\MSSQL16.MSSQLSERVER\MSSQL\DATA\DZ3.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ) | |
| LOG ON | |
| ( NAME = N'DZ3_log', FILENAME = N'E:\sql\MSSQL16.MSSQLSERVER\MSSQL\DATA\DZ3_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB ) | |
| WITH CATALOG_COLLATION = DATABASE_DEFAULT, LEDGER = OFF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| USE [master] | |
| GO | |
| /****** Object: Database [DZ1] Script Date: 16.02.2025 21:01:16 ******/ | |
| CREATE DATABASE [DZ1] | |
| CONTAINMENT = NONE | |
| ON PRIMARY | |
| ( NAME = N'DZ1', FILENAME = N'E:\sql\MSSQL16.MSSQLSERVER\MSSQL\DATA\DZ1.mdf' , SIZE = 8192KB , MAXSIZE = UNLIMITED, FILEGROWTH = 65536KB ) | |
| LOG ON | |
| ( NAME = N'DZ1_log', FILENAME = N'E:\sql\MSSQL16.MSSQLSERVER\MSSQL\DATA\DZ1_log.ldf' , SIZE = 8192KB , MAXSIZE = 2048GB , FILEGROWTH = 65536KB ) | |
| WITH CATALOG_COLLATION = DATABASE_DEFAULT, LEDGER = OFF |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Перечисление для категорий товаров | |
| enum ProductCategory | |
| { | |
| Food, | |
| Electronics, | |
| Clothing, | |
| Household, | |
| Other | |
| } | |
| // Товары |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public class Student | |
| { | |
| public string LastName { get; set; } // Фамилия | |
| public string FirstName { get; set; } // Имя | |
| public string MiddleName { get; set; } // Отчество | |
| public DateTime DateOfBirth { get; set; } // Дата рождения | |
| public string Address { get; set; } // Домашний адрес | |
| public string PhoneNumber { get; set; } // Телефонный номер | |
| // Списки оценок | |
| public List<int> TestScores { get; set; } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System; | |
| using System.Text.RegularExpressions; | |
| /*class OdnoMasiv | |
| { | |
| static void Main() | |
| { | |
| // Ввод числа | |
| Console.Write("Введите число от 0 до 10 000 000: "); | |
| if (int.TryParse(Console.ReadLine(), out int number) && number >= 0 && number <= 10_000_000) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| #pragma warning(disable:4996) | |
| int main() | |
| { | |
| setlocale(0, ""); | |
| char word[100]; | |
| char theme[100]; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| using namespace std; | |
| struct Point | |
| { | |
| double x, y; | |
| }; | |
| struct Rectangle | |
| { | |
| Point bottomLeft; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #include <iostream> | |
| #include <Windows.h> | |
| using namespace std; | |
| //Задание 1 | |
| /*int main() | |
| { | |
| setlocale(0, ""); | |
| char str[256], ch; | |
| int count = 0; |
NewerOlder