Question: Task 2: Views Views are an additional mechanism which can help support secure access to table data when used with appropriate privileges. The following views
Task 2: Views Views are an additional mechanism which can help support secure access to table data when used with appropriate privileges. The following views are proposed to control the data visible to different Oracle users when logged on to Oracle. Give the SQL statements for the creation of views in Oracle to support these requirements. Note that in Oracle you may reference the function USER in an SQL statement, for example in a SELECT or WHERE clause. It returns the username of the person executing the SQL statement. Also, a function ROUND(n,1) returns n rounded to one decimal place. (a) One view is required with the same columns as PROJ_DETAILS which gives access to all rows to staff permitted to examine projects, but gives students access to only the row for their own project. (16 marks) (b) Two views are required summarising the project proposal marks and project report marks obtained by combining the individual examiners marks: PROJ_PROPOSAL_MARKS (YEAR, STUDENT, MARK) PROJ_REPORT_MARKS (YEAR, STUDENT, MARK) For example, a row in PROJ_PROPOSAL_MARKS (2019, 'NEIL01' 62)and a row in PROJ_REPORT_MARKS(2019, 'NEIL01' 57)record that NEIL01 had his project examined in 2019 with proposal mark 62 and report mark 57. Only projects which have all proposal marks recorded should be included in PROJ_PROPOSAL_MARKS while only projects which have all report marks recorded should be included in PROJ_REPORT_MARKS. Rows in each view should be accessible by staff permitted to examine projects but a student should only have access to rows for their own project. (24 marks) (c) One view is required summarising the overall project marks in each year PROJ_OVERALL_MARKS (YEAR, STUDENT, PROPOSAL_MARK, REPORT_MARK, PROJECT_MARK) which summarises the marks for the proposal, report and overall project mark each year. So, for NEIL01, a row for his project result in 2019 should be recorded: (2019, 'NEIL01' 62, 57, 58) Rows in the view should be accessible by staff permitted to examine projects but a student should only have access to the row for their own project. (16 marks)
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
