Skip to content

Commit 61b46c4

Browse files
committed
MySQL development completed
1 parent 0bd5824 commit 61b46c4

10 files changed

+358
-3
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
title,genre,release_year,director,studio,critics_rating
2+
Coat Of Mysteries,Children,1901,Julian Fowler,Studio 60,5.5
3+
Students And Boys,Horror,1903,Julian Fowler,Bix,3.4
4+
Created By The End,Sci-Fi,1910,Rebecca Adams,Falstead Group,5.9
5+
Men And Traitors,Sci-Fi,1912,Julian Fowler,Arpeggio Brothers,3.2
6+
Hunters Of Eternity,Sci-Fi,1913,Ryan Ross,Torchwood,7
7+
Vanish In The Slaves,Adventure,1914,Violet Wells,Falstead Group,8.8
8+
Shield Of Dreams,Children,1915,Alexander Moore,Arpeggio Brothers,8
9+
Bird Of Yesterday,Children,1919,Julian Fowler,Studio 60,3.1
10+
Opponent Of Fortune,Drama,1919,Steven Spencer,Lionel Brownstone,5
11+
Descendants And Wives,Adventure,1921,Arthur Evans,Torchwood,6.7
12+
Present From Petals,Children,1921,Violet Scott,Studio 60,5.4
13+
Origin Of Nowhere,Sci-Fi,1924,Julian Fowler,Lionel Brownstone,5.7
14+
Music In The Crypts,Horror,1925,Julian Fowler,Studio 60,6.6
15+
Extermination Of New Earth,Sci-Fi,1925,Alisa Barrett,Arpeggio Brothers,6.4
16+
Intelligence In Technolic Advancements,Sci-Fi,1930,Tyler Brooks,Lionel Brownstone,4
17+
Monsters And Wolves,Horror,1931,Julian Fowler,Lionel Brownstone,9
18+
Armies Without A Home,Drama,1932,Caroline Watson,Arpeggio Brothers,7.3
19+
Heirs And Farmers,Drama,1935,Amelia Turner,Torchwood,5.2
20+
Women And Mercenaries,Sci-Fi,1937,Sarah Adams,Falstead Group,8.4
21+
Homes Of Remorse,Drama,1938,Sienna Warren,Bix,3.7
22+
Creation Of Bad News,Drama,1939,Stuart Scott,Arpeggio Brothers,7.7
23+
Cleaning With The Neighbor,Children,1941,Jared Cooper,Lionel Brownstone,6.5
24+
Savior Of The End,Adventure,1943,Sophia Baker,Torchwood,4.6
25+
Perfection Of Rainbows,Adventure,1943,Sophia Baker,Arpeggio Brothers,4.4
26+
Bunnies In The River,Children,1946,Garry Scott,Lionel Brownstone,9.4
27+
Students With Black Hair,Horror,1947,Lilianna Mason,Falstead Group,9.8
28+
Gangsters And Blacksmiths,Adventure,1949,Sophia Baker,Bix,7.2
29+
Rebels Of The Void,Drama,1949,Garry Scott,Lionel Brownstone,6.8
30+
Peasant Of Dawn,Drama,1955,Garry Scott,Falstead Group,3.7
31+
Defiant In The North,Horror,1960,Sophia Baker,Bix,3.6
32+
Officer Of The Ocean,Sci-Fi,1960,Dominik Nelson,Falstead Group,4.3
33+
Captured In The Attic,Horror,1962,Sophia Baker,Torchwood,7.9
34+
Death In The Elements,Drama,1974,Sophia Baker,Falstead Group,4.2
35+
Spy Of The Sands,Sci-Fi,1980,Marcus Rogers,Falstead Group,6.6
36+
Supporters And Bearers,Drama,1983,Garry Scott,Studio 60,6.4
37+
Agent Of Perfection,Adventure,1985,Abigail Payne,Lionel Brownstone,3.1
38+
Friend Of The Forest,Horror,1986,Elise Harper,Arpeggio Brothers,3.8
39+
Wizards Of Riddles,Children,1988,Emma Russell,Lionel Brownstone,4.3
40+
Surprise Without Fear,Adventure,1991,Samantha Clark,Lionel Brownstone,9.8
41+
Guests In The Cabin,Horror,1992,Stuart Scott,Torchwood,9.8
42+
Turtles Of Next Year,Adventure,1994,Samantha Clark,Falstead Group,6.4
43+
Helpless In The Shadows,Horror,1995,Samantha Clark,Bix,5.4
44+
Tree Behind The Counter,Horror,1998,Miley Watson,Bix,3.2
45+
Little Girl Of The Sun,Children,2003,Julia Robinson,Falstead Group,8.3
46+
Starting The East,Drama,2003,Samantha Clark,Studio 60,6.6
47+
Thieves Of Eternity,Adventure,2012,Thomas Wright,Arpeggio Brothers,3.1
48+
Little Dragons And Dogs,Children,2012,Edward Wells,Lionel Brownstone,5.6
49+
Clones Of Honor,Sci-Fi,2014,Alina Morgan,Lionel Brownstone,6
50+
Cows And Chickens,Children,2017,Miley Watson,Torchwood,6.5
51+
Blinded By The Ashes,Adventure,2020,Anna Wilson,Lionel Brownstone,9.1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
id,titles_id,critics_rating
2+
1,50,3.1
3+
2,49,4.6
4+
3,48,6.4
5+
4,47,3.1
6+
5,46,6.7
7+
6,45,7.2
8+
7,44,4.4
9+
8,43,9.8
10+
9,42,9.1
11+
10,41,8.8
12+
11,40,8.3
13+
12,39,3.1
14+
13,38,4.3
15+
14,37,9.4
16+
15,36,6.5
17+
16,35,5.6
18+
17,34,5.5
19+
18,33,8
20+
19,32,5.4
21+
20,31,6.5
22+
21,30,5
23+
22,29,3.7
24+
23,28,7.3
25+
24,27,6.8
26+
25,26,5.2
27+
26,25,6.4
28+
27,24,3.7
29+
28,23,7.7
30+
29,22,6.6
31+
30,21,4.2
32+
31,20,3.2
33+
32,19,3.8
34+
33,18,9.8
35+
34,17,9.8
36+
35,16,3.4
37+
36,15,9
38+
37,14,6.6
39+
38,13,7.9
40+
39,12,3.6
41+
40,11,5.4
42+
41,10,4.3
43+
42,9,6.6
44+
43,8,6.1
45+
44,7,6
46+
45,6,8.4
47+
46,5,3.2
48+
47,4,5.7
49+
48,3,6.4
50+
49,2,5.9
51+
50,1,4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
id,dir_name
2+
1,Abigail Payne
3+
27,Aiden Foster
4+
3,Alina Morgan
5+
34,Alisa Barrett
6+
6,Amy Armstrong
7+
29,Amy Howard
8+
5,Arthur Evans
9+
10,Catherine Gibson
10+
22,Darcy Morgan
11+
30,Dominik Nelson
12+
24,Elise Harper
13+
11,Emma Russell
14+
25,Hailey Robinson
15+
19,Henry Murray
16+
15,Jared Cooper
17+
9,Julia Robinson
18+
13,Julian Fowler
19+
28,Kelvin Martin
20+
12,Kristian Foster
21+
26,Lucia Morrison
22+
18,Paige Watson
23+
35,Rebecca Adams
24+
31,Ryan Ross
25+
23,Ryan Wright
26+
7,Samantha Clark
27+
32,Sarah Adams
28+
20,Sienna Warren
29+
2,Sophia Baker
30+
16,Steven Spencer
31+
21,Stuart Scott
32+
4,Thomas Wright
33+
17,Tiana Hunt
34+
33,Victor Elliott
35+
14,Violet Scott
36+
8,Violet Wells
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
id,genre
2+
1,Adventure
3+
2,Children
4+
3,Drama
5+
4,Horror
6+
5,Sci-Fi
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
id,studio_name,city
2+
1,Lionel Brownstone,London
3+
2,Torchwood,New York City
4+
3,Falstead Group,Hollywood
5+
4,Arpeggio Brothers,Hollywood
6+
5,Bix,Paris
7+
6,Studio 60,New York City
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
id,title,genre_id,release_year_id,director_id,studio_id
2+
1,Agent Of Perfection,1,1901,1,1
3+
2,Savior Of The End,1,1903,2,2
4+
3,Turtles Of Next Year,1,1910,3,3
5+
4,Thieves Of Eternity,1,1912,4,4
6+
5,Descendants And Wives,1,1913,5,2
7+
6,Gangsters And Blacksmiths,1,1914,3,5
8+
7,Perfection Of Rainbows,1,1915,6,4
9+
8,Surprise Without Fear,1,1914,7,1
10+
9,Blinded By The Ashes,1,1915,4,1
11+
10,Vanish In The Slaves,1,1919,8,3
12+
11,Little Girl Of The Sun,2,1921,9,3
13+
12,Bird Of Yesterday,2,1924,10,6
14+
13,Wizards Of Riddles,2,1925,11,1
15+
14,Bunnies In The River,2,1930,12,1
16+
15,Cows And Chickens,2,1931,3,2
17+
16,Little Dragons And Dogs,2,1932,1,1
18+
17,Coat Of Mysteries,2,1935,13,6
19+
18,Shield Of Dreams,2,1935,3,4
20+
19,Present From Petals,2,1937,14,6
21+
20,Cleaning With The Neighbor,2,1938,15,1
22+
21,Opponent Of Fortune,3,1941,16,1
23+
22,Peasant Of Dawn,3,1943,17,3
24+
23,Armies Without A Home,3,1946,3,4
25+
24,Rebels Of The Void,3,1947,18,1
26+
25,Heirs And Farmers,3,1949,19,2
27+
26,Supporters And Bearers,3,1955,1,6
28+
27,Homes Of Remorse,3,1960,20,5
29+
28,Creation Of Bad News,3,1962,21,4
30+
29,Starting The East,3,1974,22,6
31+
30,Death In The Elements,3,1974,23,3
32+
31,Tree Behind The Counter,4,1980,4,5
33+
32,Friend Of The Forest,4,1983,24,4
34+
33,Guests In The Cabin,4,1983,3,2
35+
34,Students With Black Hair,4,1985,1,3
36+
35,Students And Boys,4,1986,25,5
37+
36,Monsters And Wolves,4,1988,26,1
38+
37,Music In The Crypts,4,1991,27,6
39+
38,Captured In The Attic,4,1991,28,2
40+
39,Defiant In The North,4,1991,29,5
41+
40,Helpless In The Shadows,4,1992,1,5
42+
41,Officer Of The Ocean,5,1994,30,3
43+
42,Spy Of The Sands,5,1994,4,3
44+
43,Hunters Of Eternity,5,1995,31,2
45+
44,Clones Of Honor,5,1998,3,1
46+
45,Women And Mercenaries,5,1998,32,3
47+
46,Men And Traitors,5,2003,33,4
48+
47,Origin Of Nowhere,5,2012,4,1
49+
48,Extermination Of New Earth,5,2014,34,4
50+
49,Created By The End,5,2017,35,3
51+
50,Intelligence In Technolic Advancements,5,2020,19,1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
titles_id,filename,resolution
2+
45,WomenAndMercenaries.jpg,800x600
3+
17,CoatOfMysteries.jpg,240x480
4+
11,LittleGirlOfTheSun.png,1020x768
5+
41,OfficerOfTheOcean.jpg,1020x768
6+
18,ShieldOfDreams.jpg,800x600
7+
22,PeasantOfDawn.png,1020x768
8+
7,PerfectionOfRainbows.jpg,1020x768
9+
4,ThievesOfEternity.png,1020x768
10+
40,HelplessInTheShadows.png,1020x768
11+
20,CleaningWithTheNeighbor.jpg,800x600
12+
13,WizardsOfRiddles.gif,800x600
13+
44,ClonesOfHonor.png,1020x768
14+
49,CreatedByTheEnd.gif,800x600
15+
39,DefiantInTheNorth.jpg,800x600
16+
8,SurpriseWithoutFear.jpg,800x600
17+
30,DeathInTheElements.jpg,240x480
18+
50,IntelligenceInTechAdv.tiff,800x600
19+
37,MusicInTheCrypts.jpg,800x600
20+
28,CreationOfBadNews.jpg,1020x768
21+
19,PresentFromPetals.jpg,240x480
22+
2,SaviorOfTheEnd.png,800x600
23+
5,DescendantsAndWives.png,240x480
24+
24,RebelsOfTheVoid.png,1020x768
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
/* Selecting Data */
2+
SELECT id,IF(critic_rating > 6, 'Good', 'Bad') AS score
3+
FROM critic_rating;
4+
5+
SELECT id,
6+
CASE
7+
WHEN critic_rating > 8 THEN 'Good'
8+
WHEN critic_rating > 6 THEN 'Decent'
9+
ELSE 'Bad'
10+
END AS score
11+
FROM critic_rating;
12+
13+
/* Challenge: Filter movie by score */
14+
SELECT
15+
t.title AS 'Title:',
16+
IF (t.release_year > 2000, '21st Century', '20th Century') AS 'Released:',
17+
d.dir_name AS 'Director:',
18+
cr.critic_rating,
19+
CASE
20+
WHEN cr.critic_rating >= 9 THEN 'Amazing'
21+
WHEN cr.critic_rating > 7 AND cr.critic_rating < 9 THEN 'Good'
22+
WHEN cr.critic_rating > 5 AND cr.critic_rating <= 7 THEN 'Decent'
23+
ELSE 'Bad'
24+
END AS 'Reviews:'
25+
FROM titles t
26+
JOIN director d ON t.director_id = d.id
27+
JOIN critic_rating cr ON t.id = cr.titles_id
28+
ORDER BY 1 DESC;
29+
30+
/* Challenge: fixing mistakes */
31+
/* add Rence movies */
32+
INSERT INTO movie_basic(title, genre, release_year, director, studio, critic_rating)
33+
VALUES('Run for the Forest', 'Drama', 1946, 'Rence Pera', 'Lionel Brownstone', 7.3),
34+
('Luck of the Night', 'Drama', 1951, 'Rence Pera', 'Lionel Brownstone', 6.8),
35+
('Invader Glory', 'Adventure', 1953, 'Rence Pera', 'Lionel Brownstone', 5.5);
36+
37+
/* change genre 'sci-fi' to 'sf' for all falsted group flims*/
38+
SELECT * FROM movie_basic
39+
WHERE studio LIKE 'Falstead Group';
40+
41+
UPDATE movie_basic
42+
SET genre = 'SF'
43+
WHERE genre = 'Sci-Fi'
44+
AND studio LIKE 'Falstead Group';
45+
46+
/* remove all the flims Garry Scott did for Lionel Brownstone as those were lost */
47+
SELECT * FROM movie_basic
48+
WHERE director = 'Garry Scott'
49+
AND studio = 'Lionel Brownstone';
50+
51+
DELETE
52+
FROM movie_basic
53+
WHERE director = 'Garry Scott'
54+
AND studio = 'Lionel Brownstone';
55+
56+
57+
/* Challenge: Find the best film */
58+
SELECT t.title, d.dir_name, cr.critic_rating, p.filename
59+
FROM titles t
60+
JOIN director d ON t.director_id = d.id
61+
JOIN critic_rating cr ON t.id = cr.titles_id
62+
JOIN posters p ON t.id = p.titles_id
63+
ORDER BY critic_rating DESC
64+
LIMIT 10;
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
CREATE DATABASE movies;
2+
3+
USE movies;
4+
5+
/* movie basic data */
6+
CREATE TABLE movie_basic(
7+
title VARCHAR(100) NOT NULL,
8+
genre VARCHAR(50) NOT NULL,
9+
release_year INT NOT NULL,
10+
director VARCHAR(50) NOT NULL,
11+
studio VARCHAR(50) NOT NULL,
12+
critic_rating DECIMAL(2,1) DEFAULT 0
13+
);
14+
15+
16+
/* ------------ */
17+
18+
/* movie genres*/
19+
CREATE TABLE Genre(
20+
id INT PRIMARY KEY AUTO_INCREMENT,
21+
genre VARCHAR(20) NOT NULL
22+
);
23+
24+
/* movie director */
25+
CREATE TABLE Director(
26+
id INT PRIMARY KEY AUTO_INCREMENT,
27+
dir_name VARCHAR(40) NOT NULL
28+
);
29+
30+
/* movie studio */
31+
CREATE TABLE Studio(
32+
id INT PRIMARY KEY AUTO_INCREMENT,
33+
studio_name VARCHAR(30) NOT NULL,
34+
city VARCHAR(50) NOT NULL
35+
);
36+
37+
38+
/* movie titles */
39+
CREATE TABLE Titles(
40+
id INT PRIMARY KEY AUTO_INCREMENT,
41+
title VARCHAR(100) NOT NULL,
42+
genre_id INT NOT NULL,
43+
release_year INT NOT NULL,
44+
director_id INT NOT NULL,
45+
studio_id INT NOT NULL,
46+
FOREIGN KEY(genre_id) REFERENCES Genre(id),
47+
FOREIGN KEY(director_id) REFERENCES Director(id),
48+
FOREIGN KEY(studio_id) REFERENCES Studio(id)
49+
);
50+
51+
/* movie critics rating */
52+
CREATE TABLE Critic_Rating(
53+
id INT PRIMARY KEY AUTO_INCREMENT,
54+
titles_id INT NOT NULL,
55+
critics_rating DECIMAL(2,1) DEFAULT 0,
56+
FOREIGN KEY(titles_id) REFERENCES titles(id)
57+
);
58+
59+
/* posters */
60+
CREATE TABLE posters(
61+
titles_id INT NOT NULL,
62+
filename VARCHAR(100) NOT NULL,
63+
resolution VARCHAR(20) NOT NULL,
64+
FOREIGN KEY(titles_id) REFERENCES titles(id)
65+
);

readme.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -32,15 +32,15 @@ MySQL data analysis project in helping Flim Rental Store to
3232
+ etc.
3333

3434

35-
## [Company Employee - SQL & Tableau Visualization Project](https://github.com/ptyadana/MySQL-Tableau-for-Data-Analytics-and-Business-Intelligence)
35+
## [Company Employees - SQL & Tableau Visualization Project](https://github.com/ptyadana/MySQL-Tableau-for-Data-Analytics-and-Business-Intelligence)
3636
MySQL & Tableau integration project for analyzing employee data and visualizing the findings across the departments for management including
3737
+ What is breakdown between the male and female employees working in the company each year, starting from 1990?
3838
+ What is the number of male managers to the number of female managers from different departments for each year, starting from 1990?
3939
+ What is the average salary of female versus male employees in the entire company until year 2002? Need to filter out by departments.
4040
+ etc.
4141

4242

43-
## [Parch & Posey Company Data-Analysis Project](https://github.com/ptyadana/SQL-for-Data-Analysis-Parch-and-Posey)
43+
## [Parch & Posey - Data Analysis Project](https://github.com/ptyadana/SQL-for-Data-Analysis-Parch-and-Posey)
4444
PostgreSQL project for helping fictional company called Parch & Posey for
4545
+ managing the Orders,
4646
+ finding out the relationship with different Accounts
@@ -55,7 +55,7 @@ PostgreSQL Data Analysis project to help Chinook Digital Music Store to help how
5555
+ finding out who the best customer is
5656
+ etc.
5757

58-
## [Restaurant & Library - Information & Patrons ](SQL%20Code%20Challenges%20-%20Lynda)
58+
## [Restaurant & Library - Information & Patrons Project](SQL%20Code%20Challenges%20-%20Lynda)
5959
SQLite project for
6060
+ **In the Restaurant** - helping the Restaurant to manage customer information, reservations, orders and party invities in for Restaurant 20th Anniversary.
6161
+ **At the Library** - helping the Library to manage the books statistics, check out and loan process, managing on due loans, encouraging patrons, etc.

0 commit comments

Comments
 (0)