![Page 1: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/1.jpg)
ADVANCED TOPICS IN RELATIONAL DATABASES
Spring 2011
Instructor: Hassan Khosravi
![Page 2: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/2.jpg)
4.2
AUTHORIZATION
![Page 3: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/3.jpg)
4.3
Database Authorization
Make sure users see only the data they are supposed to see. Guard the database against modifications by malicious users.
Users have privileges Can only operate on data for which they are authorized
Select on R Insert on R Update on R Delete on R
![Page 4: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/4.jpg)
4.4
Example
Apply(dec), Select(Sid) Student select(SID,GPA)
![Page 5: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/5.jpg)
4.5
![Page 6: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/6.jpg)
4.6
How can we give the following privilege Select students info for Stanford applications only
Delete Berkeley applications only
![Page 7: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/7.jpg)
4.7
Obtaining Privileges
Relation creator is owner Owner has all privileges and may grant privileges
Grant privs on R to users [with grant option]
![Page 8: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/8.jpg)
4.8
Revoking Privileges
Cascade: also revoke privileges granted from privileges being revoked transitively, unless also granted from another source
Restrict: disallow if cascade would revoke any other privileges
![Page 9: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/9.jpg)
4.9
ON-LINE ANALYTICAL PROCESSING (OLAP)
![Page 10: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/10.jpg)
4.10
Two broad types of database activities OLTP: Online Transaction Processing
Short transactions Simple queries Touch small portion of data Frequent updates
OLAP: Online Analytical Processing Long transactions Complex queries Touch large portions of data Infrequent updates
![Page 11: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/11.jpg)
4.11
Data warehousing
Bring data from operational OLPT sources into a single warehouse for OLAP analysis
Decision Support System Data warehouse tuned for OLAP
![Page 12: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/12.jpg)
4.12
Star Schema
Fact table (relationships) Updated frequently, very large
Sales transaction, course enrollment
Dimension tables (entities, objects) Stores, items, customers Students, courses
![Page 13: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/13.jpg)
4.13
Example
![Page 14: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/14.jpg)
4.14
Performance Inherently very slow:
Special indexes Extensive use of materialized views
![Page 15: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/15.jpg)
4.15
DATA CUBES
![Page 16: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/16.jpg)
4.16
Multi-dimensional OLAPData Cube
Dimension data form axes of Cube Fact data in cells
Item
Stores
Customers
![Page 17: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/17.jpg)
4.17
Assuming one quantity for that
Item
Stores
Customers
Qty and price for I32, C4, s17
![Page 18: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/18.jpg)
4.18
Usually have defined aggregate functions that are meaningful Sum(qty * price)
Item
Stores
Customers
Aggregate over all items for C5, s11
![Page 19: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/19.jpg)
4.19
Usually have defined aggregate functions that are meaningful Sum(qty * price)
Item
Stores
Customers
Aggregate over all stores for I 61, C5, C21
![Page 20: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/20.jpg)
4.20
Usually have defined aggregate functions that are meaningful Sum(qty * price)
Item
Stores
Customers
Aggregate over all customers for I 5, s13
![Page 21: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/21.jpg)
4.21
Usually have defined aggregate functions that are meaningful Sum(qty * price)
Item
Stores
Customers
Aggregate over all customers and Items for s2
Aggregate over all stores and Items for c63
Aggregate over all stores and customers for I 52
![Page 22: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/22.jpg)
4.22
Usually have defined aggregate functions that are meaningful Sum(qty * price)
Item
Stores
Customers
Full aggregation
![Page 23: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/23.jpg)
4.23
Example
![Page 24: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/24.jpg)
4.24
![Page 25: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/25.jpg)
4.25
Drill Down
Add for category to the group by and selection
![Page 26: ADVANCED TOPICS IN RELATIONAL DATABASES Spring 2011 Instructor: Hassan Khosravi](https://reader034.vdocument.in/reader034/viewer/2022042522/5697bf8e1a28abf838c8cdf5/html5/thumbnails/26.jpg)
4.26
Roll Up