SQL Test
TABLE Student
1 | CREATE TABLE Student_2018091601004( |
TABLE Teacher
1 | CREATE TABLE Teacher_2018091601004( |
TABLE Course
1 | CREATE TABLE Course_2018091601004( |
TABLE Grade
1 | CREATE TABLE Grade_2018091601004( |
INSERT Student
1 | INSERT INTO Student_2018091601004 VALUES('2018090015201','李同学','男'); |
INSERT Teacher
1 | INSERT INTO Teacher_2018091601004 VALUES('3202211','张老师','教授'); |
INSERT Course
1 | INSERT INTO Course_2018091601004 VALUES('C001','数据库原理','3202211',3); |
INSERT Grade
1 | INSERT INTO Grade_2018091601004 VALUES('2018091601004','C001',90); |
SELECT join on
1 | SELECT A.StudentID,A.StudentName,B.Score,C.CourseName |
CREATE VIEW
1 | CREATE VIEW View_Grade_2018091601004 as |
CREATE ROLE
1 | CREATE ROLE "Role_Student_2018091601004" WITH LOGIN |
GRANT ROLE
1 | GRANT SELECT,UPDATE ON Student_2018091601004 TO "Role_Student_2018091601004"; |