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
| IF DB_ID('BarberShopDB1') IS NULL | |
| CREATE DATABASE BarberShopDB1; | |
| GO | |
| USE BarberShopDB1; | |
| GO | |
| DROP PROCEDURE IF EXISTS GetTopBarberByDateRange; | |
| DROP PROCEDURE IF EXISTS GetBarberSchedule; |
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 Academy5; | |
| GO | |
| CREATE OR ALTER PROCEDURE Task1 | |
| AS | |
| SELECT DISTINCT LR.Name | |
| FROM LectureRooms LR | |
| JOIN Schedules S ON S.LectureRoomId = LR.Id | |
| JOIN Lectures L ON L.Id = S.LectureId |
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 Academy4; | |
| GO | |
| SELECT DISTINCT LR.Name | |
| FROM LectureRooms LR | |
| JOIN Schedules S ON LR.Id = S.LectureRoomId | |
| JOIN Lectures L ON S.LectureId = L.Id | |
| JOIN Teachers T ON L.TeacherId = T.Id | |
| WHERE T.Name = 'Edward' AND T.Surname = 'Hopper'; |
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 Academy3; | |
| GO | |
| SELECT COUNT(*) | |
| FROM Teachers | |
| WHERE Id IN ( | |
| SELECT TeacherId | |
| FROM Lectures | |
| WHERE SubjectId IN ( | |
| SELECT Id |
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
| SELECT Building | |
| FROM Department | |
| GROUP BY Building | |
| HAVING SUM(Financing) > 100000; | |
| SELECT Name | |
| FROM StudentGroup | |
| WHERE Year = 5 | |
| AND DepartmentId = | |
| ( |
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
| --CREATE DATABASE SportShop; | |
| --GO | |
| USE SportShop; | |
| GO | |
| CREATE TABLE Employees | |
| ( | |
| EmployeeId INT IDENTITY(1,1) PRIMARY KEY, |
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 <vector> | |
| using namespace std; | |
| class House; | |
| class Bank; | |
| class Factory; | |
| class Visitor | |
| { |
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 <string> | |
| using namespace std; | |
| class Herbivore | |
| { | |
| public: | |
| int weight; | |
| bool life; |
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 <string> | |
| using namespace std; | |
| class Transport | |
| { | |
| public: | |
| virtual void input() = 0; | |
| virtual void info() = 0; | |
| }; |
NewerOlder