Skip to content
Snippets Groups Projects
Commit 8b9627c0 authored by PavelBegunkov's avatar PavelBegunkov
Browse files

REF: stored functions optimization

parent a05d7e19
Branches
Tags
No related merge requests found
This diff is collapsed.
CREATE OR REPLACE VIEW `view_study_groups` AS
CREATE OR REPLACE VIEW `view_groups` AS
SELECT study_groups.ID AS 'GroupID',
study_groups.GroupNum AS 'GroupNum',
study_groups.Name AS 'GroupName',
......@@ -45,9 +45,9 @@ CREATE OR REPLACE VIEW `view_students` AS
students.FirstName,
students.SecondName,
students.AccountID,
view_study_groups.*
view_groups.*
FROM `students`
INNER JOIN `view_study_groups` ON view_study_groups.GroupID = students.GroupID;
INNER JOIN `view_groups` ON view_groups.GroupID = students.GroupID;
CREATE OR REPLACE VIEW `view_disciplines` AS
......
......@@ -23,3 +23,12 @@ ALTER TABLE `students`
ADD CONSTRAINT `students_ibfk_1` FOREIGN KEY (`GroupID`) REFERENCES `study_groups` (`ID`);
ALTER TABLE `page_access`
CHANGE `Pagename` `Pagename` VARCHAR( 150 ) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ;
ALTER TABLE `page_access` ADD UNIQUE (`Pagename`);
ALTER TABLE `accounts` ADD UNIQUE (`ActivationCode`);
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment