Sie sind auf Seite 1von 8

Announcement

• Topic Presentation (20%)


– A day in the life of a Database Administrator (suitable for someone in
the role now or in the past, or research and present)
– Overview of various platforms/stacks used to deploy Web Services with
database layer (LAMP, XAMPP, MAMP, and others) Taken by Group 2
Announcement – Cloud-based Data Warehouse Solutions (general intro, and one
example like AWS Amazon Redshift) Taken by Group 1
– Data Mining (general intro, and concepts in Data Mining section of
Database Processing text Appendix J) Taken by Group 4
– Not Only SQL (general intro, then delve into a product like Microsoft
Analytics Platform System http://www.microsoft.com/en-us/server-
cloud/products/analytics-platform-system/Features.aspx; no demo
needed, may use vendor videos as desired)
– SQL Server Utilities (SQL CMD and Microsoft PowerShell - see
Database Processing text Chapter 10A; demonstrate these two utilities)
2

Assignment #3
– Very Crude Version of Solution
Year

Director Genre
Keyword
Title
Data Modeling - IMDB #2 Langauge

Release 
Date Actor
Movies
MPAA  Running 
Rating Time

Metascore Storyline
Review_CNT Location

Star Rating Country
4
Assignment #3 Assignment #3
– Very Crude Version of Solution – Very Crude Version of Solution

If you implemented this far, you will get the half point
for Assignment #3.

Remaining half will be awarded based on your effort!

Again, there is no correct answer for this kind of modeling.


Maybe more acceptable solution for given situation.

5 6

Let’s Take One Step Further! Let’s Take One Step Further!
• A movie belongs to more than one genre. • An average score by 216,944 reviews
– How many movies are belonged to Action, – How many movies are above 5.0 by
Fantasy, or Sci-Fi? metascore?
– How many movies are belonged to Adventure – Which movie has the highest (lowest)
and Western? metascore?
– Which movies have the most diverse genres – Which movie has the highest (lowest) number
(# of genres)? of reviews?

7 8
Business Rules
Let’s Take One Step Further!
 A movie is uniquely identified by its title,
and release date.
• There are more than one actor per movie.  There exists more than one actor per
movie.
– How many actors played in Black Panther?  A few star actors are displayed per
– How many actors on average played in movie
 Director
movies that were released in 2018?
 Case 1) – A movie is directed by only
one director.
 Case 2) – A movie can be directed by
more than one director.
 A movie is searchable by more than one
keyword.
 A movie is categorized into more than
one genre.
 A movie has only one MPAA: G, PG, PG-
9 13, R, or NC-7 10

Business Rules – Cont’d Business Rules – Cont’d


Conceptual Model DDL Conceptual Model DDL

Movies Actors

PK Title PK Actor_ID

PK Release_Date
Name
Language
IsStar
Running_Time

Storyline

Country

AKA

MPAA

11 12
Business Rules – Cont’d Business Rules – Cont’d
Conceptual Model DDL

Advertise

PK FK Title

PK FK Release_Date Sites

PK FK Site PK Site

PK FK Country PK Country
Movies

PK Title

PK Release_Date

Language

Running_Time

Storyline

Country

AKA
 A movie is advertised by more than one official site.
MPAA

 An official site is uniquely identified by its site and its country.


 A movie is filmed in more than one location. 13 14

Business Rules – Cont’d Business Rules – Cont’d

638+1+36=675

Positive, Mixed, or Negative


per user
per review
487+138+13=638
Key Rules
 A user can rate or review more than Key Rules
one movie.
 A rate ranges from 0 to 10.  The sum of the counts of Positive, Mixed, and Negative equals to the total
review count of the Movies category.
 A user can rate without reviewing a
movie.  Probably, 7.4 is produced based upon 638 review scores of Compi24
per review 15 16
Business Rules – Cont’d Business Rules – Cont’d
Conceptual Model DDL

Review

PK FK Title

PK FK Release_Date

PK FK User_ID

Content

Positive > 0.5 Review_Date

Mixed = 0.5
Score
Negative < 0.5
Key Rules Sentiment

 A user can rate or review more than one movie. The sentiment of a ReadCNT

review can be positive (>0.5), Mixed (=0.5), or Negative (<0.5) HelpfulCNT

17 18

Business Rules – Cont’d Business Rules – Cont’d


Conceptual Model DDL
SELECT TOP 1 Score
FROM Rating
WHERE UserID = ‘compi24’
ORDER BY Rating_Date DESC,
Rating
Score DESC; or Score ASC;
PK FK Title

PK FK Release_Date

PK FK User_ID

Score

Rating_Date

Top 1 Score by a descending order? ?


19 20
Business Rules – Cont’d Business Rules – Cont’d
role An actor can act more than one role
An actor acts one role per movie.
per movie.
Movies

PK Title

PK Release_Date Act
Actors

Language PK FK Title
PK Actor_ID

Running_Time PK FK Release_Date
Name
Storyline PK FK Actor_ID
IsStar
Country Role

AKA Movies

MPAA PK Title

PK Release_Date Act
Key Rules Actors

Language PK FK Title
PK Actor_ID
 Role Running_Time PK FK Release_Date
Name
 An actor acts a role per movie. Storyline PK FK Actor_ID
IsStar

 An actor can act more than one role per movie. Country PK Role

AKA

21 MPAA
22

Final Model in MS SQL Server 2014 Final Model in MySQL Workbench

23 24
Assignment #4 Assignment #4
1. Based upon the figures, produce necessary business rules and a • Deliverables
corresponding relationship matrix.
a. Specify entities – Screen capture of database diagram
b. Determine relationships generated by using SQL Server or MySQL
2. Draw your conceptual model Workbench.
3. Examine whether your table(s) violates normal forms.
a. If no table violates, you are good to go
– Or, SQL DDL script which will implement your
b. If one or more tables violate, resolve problems physical model (including tables, columns,
4. Determine data types and necessary data integrities of columns. data types, relationships and so on).
a. Entity integrity
b. Domain integrity
c. Referential integrity • Due date: April 23 before the Class meeting
5. Convert your conceptual model into a physical model.
25 26

DB @ Metro State Univ.


• What database management system is used?
– We use Oracle and SQL

• What is the design of current database?


DB @ Metro State Univ. – Hardware (OS/FS): we use Linux (Red hat/Oracle).
– Per license agreement, we use 2 double-core CPUs (4 cores total) on pro
duction server.
– SQL runs on virtual servers with SAN
– Network: firewalled – high security
DB @ Metro State Univ. DB @ Metro State Univ.
• Do we have any information on usage analysis and data volume?
– Physical level of DBMS: we use Oracle’s ASM (Automated Storage
Management) to store database files that include system files, data files, – Server usage analysis is done automatically by OEM (Oracle Enterprise
redo files, and undo files. Management).
• How are data back-up requirements for this application being
– Logical level of DBMS: we currently have 9 database instances. addressed? What backup and recovery plans were developed in the
Each database has about 10/20 schemas event of system failure?
(Oracle/Microsoft term for logical users). Do we have any contingency or disaster recovery plan?
We have 60-70 applications which have their own schemas (in terms of – We backup the database in a 7-day cycle: full backup on Friday, increme
database model). ntal on other days. We purge backup files older than 7 days prior to full
backup. So the maximum span is up to 14 days.
– View level: we have about 1000 tables/views that feed our users. – We also export data for convenience purpose. We export full data sets
Supported Application Systems: over 10 systems every day.
– A backup of the backup data and exported data are securely stored in
another location.
– Yes, we have a DR Plan

DB @ Metro State Univ.


• Is the database protected by logs and audit trails?
– All user transactions are logged;
– System transactions are selectively unlogged for storage reason;
– DBA activity is automatically audit by the system
– All user activities are audited through configuration.

• How do we manage users?


– Database server user: due to small number, we manually manage
database users
– We manage other users (Star ID in AD, Tech ID, Library/Parking Card)
through processes, stored-procedures and Oracle jobs.

Das könnte Ihnen auch gefallen