Skip to content

Commit bb0bcac

Browse files
committed
mysql update
1 parent d2b8238 commit bb0bcac

File tree

5 files changed

+244
-2
lines changed

5 files changed

+244
-2
lines changed

.gitignore

+158
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,158 @@
1+
2+
# Created by https://www.gitignore.io/api/python,vagrant,virtualenv,jupyternotebooks
3+
# Edit at https://www.gitignore.io/?templates=python,vagrant,virtualenv,jupyternotebooks
4+
5+
# score file
6+
points.csv
7+
8+
settings.json
9+
10+
### JupyterNotebooks ###
11+
# gitignore template for Jupyter Notebooks
12+
# website: http://jupyter.org/
13+
14+
.vscode/*
15+
16+
.ipynb_checkpoints
17+
*/.ipynb_checkpoints/*
18+
19+
# IPython
20+
profile_default/
21+
ipython_config.py
22+
23+
# Remove previous ipynb_checkpoints
24+
# git rm -r .ipynb_checkpoints/
25+
26+
### Python ###
27+
# Byte-compiled / optimized / DLL files
28+
__pycache__/
29+
*.py[cod]
30+
*$py.class
31+
32+
# C extensions
33+
*.so
34+
35+
# Distribution / packaging
36+
.Python
37+
build/
38+
develop-eggs/
39+
dist/
40+
downloads/
41+
eggs/
42+
.eggs/
43+
lib/
44+
lib64/
45+
parts/
46+
sdist/
47+
var/
48+
wheels/
49+
pip-wheel-metadata/
50+
share/python-wheels/
51+
*.egg-info/
52+
.installed.cfg
53+
*.egg
54+
MANIFEST
55+
56+
# PyInstaller
57+
# Usually these files are written by a python script from a template
58+
# before PyInstaller builds the exe, so as to inject date/other infos into it.
59+
*.manifest
60+
*.spec
61+
62+
# Installer logs
63+
pip-log.txt
64+
pip-delete-this-directory.txt
65+
66+
# Unit test / coverage reports
67+
htmlcov/
68+
.tox/
69+
.nox/
70+
.coverage
71+
.coverage.*
72+
.cache
73+
nosetests.xml
74+
coverage.xml
75+
*.cover
76+
.hypothesis/
77+
.pytest_cache/
78+
79+
# Translations
80+
*.mo
81+
*.pot
82+
83+
# Scrapy stuff:
84+
.scrapy
85+
86+
# Sphinx documentation
87+
docs/_build/
88+
89+
# PyBuilder
90+
target/
91+
92+
# pyenv
93+
.python-version
94+
95+
# pipenv
96+
# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control.
97+
# However, in case of collaboration, if having platform-specific dependencies or dependencies
98+
# having no cross-platform support, pipenv may install dependencies that don't work, or not
99+
# install all needed dependencies.
100+
#Pipfile.lock
101+
102+
# celery beat schedule file
103+
celerybeat-schedule
104+
105+
# SageMath parsed files
106+
*.sage.py
107+
108+
# Spyder project settings
109+
.spyderproject
110+
.spyproject
111+
112+
# Rope project settings
113+
.ropeproject
114+
115+
# Mr Developer
116+
.mr.developer.cfg
117+
.project
118+
.pydevproject
119+
120+
# mkdocs documentation
121+
/site
122+
123+
# mypy
124+
.mypy_cache/
125+
.dmypy.json
126+
dmypy.json
127+
128+
# Pyre type checker
129+
.pyre/
130+
131+
### Vagrant ###
132+
# General
133+
.vagrant/*
134+
135+
# Log files (if you are creating logs in debug mode, uncomment this)
136+
# *.log
137+
138+
### Vagrant Patch ###
139+
*.box
140+
141+
### VirtualEnv ###
142+
# Virtualenv
143+
# http://iamzed.com/2009/05/07/a-primer-on-virtualenv/
144+
pyvenv.cfg
145+
.env
146+
.venv
147+
env/
148+
venv/
149+
ENV/
150+
env.bak/
151+
venv.bak/
152+
pip-selfcheck.json
153+
154+
# End of https://www.gitignore.io/api/python,vagrant,virtualenv,jupyternotebooks
155+
156+
__pycache__
157+
*.pyc
158+
.vagrant
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,42 @@
1+
-- creation of new Access Roles
2+
CREATE ROLE 'app_dev', 'app_read', 'app_write';
3+
4+
5+
/* ---------------------------------------------------------- */
6+
7+
-- granting specific access to the roles
8+
GRANT ALL ON movies.* TO 'app_dev';
9+
10+
GRANT SELECT on movies.* TO 'app_read';
11+
12+
GRANT INSERT, UPDATE, DELETE ON movies.* TO 'app_write';
13+
14+
FLUSH PRIVILEGES;
15+
16+
/* ---------------------------------------------------------- */
17+
18+
-- creation of user
19+
CREATE USER 'read1'@'localhost' IDENTIFIED BY 'password123';
20+
21+
-- grand access role to testuser
22+
GRANT 'app_read' TO 'read1'@'localhost';
23+
24+
-- set default role
25+
SET DEFAULT ROLE 'app_read' TO 'read1'@'localhost';
26+
27+
/* ---------------------------------------------------------- */
28+
/* If we don't want to write the "SET DEFAULT ROLE" statement everytime we create new user,
29+
we can do like below.
30+
1) go to Admistration tab
31+
2) Under "Management" > "Status and System Variables"
32+
3) System Variables > search wit "activate"
33+
4) activate_all_roles_on_log_in = ON
34+
5) if we want this setting to be Persist, we can check the checkbox. This means everytime server is restarted, server will remember the setting.
35+
*/
36+
37+
/* ---------------------------------------------------------- */
38+
-- deletion of user
39+
DROP USER 'read1'@'localhost';
40+
41+
-- deletion of roles
42+
DROP ROLE 'app_dev', 'app_read', 'app_write';
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
-- Password Expiration for a user
2+
-- This will immediately make user to enter a new password when he/she tries to make a connection
3+
ALTER USER 'tempuser'@'%' PASSWORD EXPIRE;
4+
5+
-- password expire in 90 days for that particular user
6+
ALTER USER 'tempuser'@'%' PASSWORD EXPIRE INTERVAL 90 DAY;
7+
8+
9+
-- Default Password Expiration Setting
10+
/*
11+
This setting will allow us to set default password expiration on organization wide
12+
1)go to "Administration tab"
13+
2) Management tab > Status and System Variables
14+
3) System Variables > search for "default"
15+
4) default_password_lifetime : default is 0 which means never expire
16+
5) we can set by 30 days, 90 days etc.
17+
6) if we want this setting to be Persist, we can check the checkbox. This means everytime server is restarted, server will remember the setting.
18+
*/
+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
-- show engines
2+
SHOW ENGINES;
3+
4+
/*
5+
Default Storage Engine is InnoDB
6+
Others Engines are: MyISAM, MEMORY, CSV, BLACKHOLE, ARCHIVE, MERGE_MYISAM, performance, FEDERATED
7+
*/
8+
CREATE TABLE IF NOT EXISTS test(
9+
id INT AUTO_INCREMENT PRIMARY KEY,
10+
name VARCHAR(30)
11+
)ENGINE = InnoDB;
12+
13+
-- check engine information of a schema
14+
SELECT table_name, engine
15+
FROM information_schema.tables WHERE table_schema='movies';

readme.md

+11-2
Original file line numberDiff line numberDiff line change
@@ -55,14 +55,16 @@ 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+
5859
## [Restaurant & Library - Information & Patrons Project](SQL%20Code%20Challenges%20-%20Lynda)
5960
SQLite project for
60-
+ **In the Restaurant** - helping the Restaurant to manage customer information, reservations, orders and party invities in for Restaurant 20th Anniversary.
61-
+ **At the Library** - helping the Library to manage the books statistics, check out and loan process, managing on due loans, encouraging patrons, etc.
61+
+ **[In the Restaurant](SQL%20Code%20Challenges%20-%20Lynda/In%20the%20Restaurant)** - helping the Restaurant to manage customer information, reservations, orders and party invities in for Restaurant 20th Anniversary.
62+
+ **[At the Library](SQL%20Code%20Challenges%20-%20Lynda/At%20the%20Library)** - helping the Library to manage the books statistics, check out and loan process, managing on due loans, encouraging patrons, etc.
6263

6364

6465
------------
6566

67+
# Bootcamps
6668

6769
## [Ultimate MySQL](Ultimate%20MySQL)
6870
+ data analysis challenges for Books and Authors
@@ -90,6 +92,13 @@ SQLite project for
9092
+ Udemy Course: [SQL for Data Analysis: Weekender Crash Course](https://www.udemy.com/course/sql-for-newbs/)
9193

9294

95+
## Advancing SQL Journey - (In Progress)
96+
To skill up my SQL related skills in specific areas and topics:
97+
- MySQL Development - Lynda
98+
- MySQL Configurations
99+
- SQL Code Challenges - Lynda
100+
101+
93102

94103

95104
## License

0 commit comments

Comments
 (0)