CODING MODULE
SQL, Python, Shell Scripting
SUMMARY OUTLINE
SQL Python Shell Scripting
What is
Database?
What is SQL?
SQL Command
Aggregate
Function
Table Relation
What is
Python?
Why Python?
Learn Python
Programming
(Tutorial)
What is Shell
Scripting?
The Application
Learn Shell
Scripting
(Tutorial)
It’s a structured system to put your data in
that imposes rules upon that data, and the
rules are yours, because the importance of
these problems changes based on your
needs.
WHAT'S A DATABASE?
WHY DO WE NEED A DATABASE?
SIZE
You may have thousands or
million of rows of customers, or
any piece of information.
ACCURACY
Nothing could actually prevent
you from typing incorrect data
into a spreadsheet.
SECURITY
If the data is sensitive, and you
need to restrict the access to
the data; It doesn’t need to be
shared with everyone.
REDUNDANCY
If the redundant data will lead
to conflict, you would need to
have only a non-repeated
unique data.
IMPORTANCE
It’s unacceptable to lose
important data like orders of a
customer, allergies of a
patient, flight bookings, …etc.
OVERWRITING
How about having more than one
person overwriting the same data
at the same time?. You’ll end up
with everybody overwriting
everybody else’s changes.
If you are saying “Yes” to one of these problems, or all of them and more besides, to keep the data
reliable, secured, and maintainable. So, you need to have a database.
DATABASE MANAGEMENT SYSTEM (DBMS)
The DBMS is the software that would be installed on your personal
computer or on a server, then you would use it to manage one or
more database.
There are different DBMS categories, one of
them is Relational Database Management
System (RDBMS), designed specifically for
relational databases, and it is the most
common used one. Example of this RDBMS are
like Oracle, MySQL, SQL Server, SQLite, DB2, …
etc.
RELATIONAL DATABASE MANAGEMENT SYSTEMS
(RDBMS)
WHAT IS SQL?
Structured Query Language (SQL) is the language that’s used
to create, read, update or delete data, and also to define the databases
themselves. It’s not a programming language, it’s considered as a
declarative query language. You just need to say what you want, and you
let the DBMS handle how that’s actually done for you.
SQL COMMANDS
Data Definition
Language (DDL)
Data Manipulation
Language (DML)
Data Control
Language (DCL)
CREATE : Creating
new table in
database
ALTER : Adding new
columns into an
existing table
DROP : Delete an
entire table and it's
content
SELECT : Selecting
data from database
INSERT : Adding new
rows to the table
UPDATE : Change
the value of existing
data
DELETE : Delete
certain row/data
GRANT : Provide
access/ privileges on
the database objects
to the users.
REVOKE : Withdraw
user privileges on
database objects if
any granted.
EXAMPLE
AGGREGATE FUNCTION
AGGREGATE FUNCTION
TABLE RELATION
PYTHON
PROGRAMMING
WHAT IS PYTHON?
Python is a popular programming language. It was
created by Guido van Rossum, and released in 1991.
Python can be used on a server to create web applications.
Python can be used alongside software to create workflows.
Python can connect to database systems. It can also read and modify files.
Python can be used to handle big data and perform complex mathematics.
Python can be used for rapid prototyping, or for production-ready software
development.
What can Python do?
WHY PYTHON?
Python works on different platforms (Windows, Mac, Linux,
Raspberry Pi, etc).
Python has a simple syntax similar to the English language.
Python has syntax that allows developers to write programs with
fewer lines than some other programming languages.
Python runs on an interpreter system, meaning that code can be
executed as soon as it is written. This means that prototyping can
be very quick.
Python can be treated in a procedural way, an object-orientated
way or a functional way.
https://www.udemy.com/course
https://www.w3schools.com/python/
default.asp
https://learn.datacamp.com/skill-
tracks/python-fundamentals
RECOMMENDED RESOURCES TO LEARN PYTHON
SHELL SCRIPTING
A shell script is a computer program designed to be run by the
Unix shell, a command-line interpreter.
WHAT IS SHELL SCRIPTING?
Write the script
Give the shell permission to execute it
Put it somewhere the shell can find it
To successfully write a shell script, you have to do 3 things:
1.
2.
3.
SHELL SCRIPT APPLICATION
Automating the code compiling process.
Running a program or creating a program environment.
Completing batch
Manipulating files.
Linking existing programs together.
Executing routine backups.
Monitoring a system.
Using a shell script is most useful for repetitive tasks that may
be time consuming to execute by typing one line at a time.
A few examples of applications shell scripts can be used for
include:
ADVANTAGES
Shell scripting is meant to be simple
and efficient. It uses the same syntax
in the script as it would on the shell
command line, removing any
interpretation issues. Writing code
for a shell script is also faster and
requires less of learning curve than
other programming languages.
DISADVANTAGES
if there is an error in a shell script,
this can prove to be extremely costly
if left unnoticed. Additionally,
differing platforms associated with
shell scripting may not be
compatible. Shell scripts can also be
slower to execute than individual
commands.
ADVANTAGES & DISADVANTAGES
OF SHELL SCRIPTING
https://www.udemy.com/topic/shell-
scripting
https://www.tutorialspoint.com/unix/i
ndex.htm
https://www.coursera.org/courses?
query=shell%20scripting
RECOMMENDED RESOURCES TO LEARN SHELL SCRIPTING
https://medium.com/omarelgabrys-blog/database-
introduction-part-1-4844fada1fb0
https://medium.com/omarelgabrys-blog/database-
fundamentals-part-2-b841032243ac
https://www.w3schools.com/sql/default.asp
https://searchdatacenter.techtarget.com
/definition/shell-script
EXTERNAL LINK

Summary python coding

  • 1.
  • 2.
    SUMMARY OUTLINE SQL PythonShell Scripting What is Database? What is SQL? SQL Command Aggregate Function Table Relation What is Python? Why Python? Learn Python Programming (Tutorial) What is Shell Scripting? The Application Learn Shell Scripting (Tutorial)
  • 3.
    It’s a structuredsystem to put your data in that imposes rules upon that data, and the rules are yours, because the importance of these problems changes based on your needs. WHAT'S A DATABASE?
  • 4.
    WHY DO WENEED A DATABASE? SIZE You may have thousands or million of rows of customers, or any piece of information. ACCURACY Nothing could actually prevent you from typing incorrect data into a spreadsheet. SECURITY If the data is sensitive, and you need to restrict the access to the data; It doesn’t need to be shared with everyone. REDUNDANCY If the redundant data will lead to conflict, you would need to have only a non-repeated unique data. IMPORTANCE It’s unacceptable to lose important data like orders of a customer, allergies of a patient, flight bookings, …etc. OVERWRITING How about having more than one person overwriting the same data at the same time?. You’ll end up with everybody overwriting everybody else’s changes. If you are saying “Yes” to one of these problems, or all of them and more besides, to keep the data reliable, secured, and maintainable. So, you need to have a database.
  • 5.
    DATABASE MANAGEMENT SYSTEM(DBMS) The DBMS is the software that would be installed on your personal computer or on a server, then you would use it to manage one or more database.
  • 6.
    There are differentDBMS categories, one of them is Relational Database Management System (RDBMS), designed specifically for relational databases, and it is the most common used one. Example of this RDBMS are like Oracle, MySQL, SQL Server, SQLite, DB2, … etc. RELATIONAL DATABASE MANAGEMENT SYSTEMS (RDBMS)
  • 7.
    WHAT IS SQL? StructuredQuery Language (SQL) is the language that’s used to create, read, update or delete data, and also to define the databases themselves. It’s not a programming language, it’s considered as a declarative query language. You just need to say what you want, and you let the DBMS handle how that’s actually done for you.
  • 8.
    SQL COMMANDS Data Definition Language(DDL) Data Manipulation Language (DML) Data Control Language (DCL) CREATE : Creating new table in database ALTER : Adding new columns into an existing table DROP : Delete an entire table and it's content SELECT : Selecting data from database INSERT : Adding new rows to the table UPDATE : Change the value of existing data DELETE : Delete certain row/data GRANT : Provide access/ privileges on the database objects to the users. REVOKE : Withdraw user privileges on database objects if any granted.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
    WHAT IS PYTHON? Pythonis a popular programming language. It was created by Guido van Rossum, and released in 1991. Python can be used on a server to create web applications. Python can be used alongside software to create workflows. Python can connect to database systems. It can also read and modify files. Python can be used to handle big data and perform complex mathematics. Python can be used for rapid prototyping, or for production-ready software development. What can Python do?
  • 15.
    WHY PYTHON? Python workson different platforms (Windows, Mac, Linux, Raspberry Pi, etc). Python has a simple syntax similar to the English language. Python has syntax that allows developers to write programs with fewer lines than some other programming languages. Python runs on an interpreter system, meaning that code can be executed as soon as it is written. This means that prototyping can be very quick. Python can be treated in a procedural way, an object-orientated way or a functional way.
  • 16.
  • 17.
  • 18.
    A shell scriptis a computer program designed to be run by the Unix shell, a command-line interpreter. WHAT IS SHELL SCRIPTING? Write the script Give the shell permission to execute it Put it somewhere the shell can find it To successfully write a shell script, you have to do 3 things: 1. 2. 3.
  • 19.
    SHELL SCRIPT APPLICATION Automatingthe code compiling process. Running a program or creating a program environment. Completing batch Manipulating files. Linking existing programs together. Executing routine backups. Monitoring a system. Using a shell script is most useful for repetitive tasks that may be time consuming to execute by typing one line at a time. A few examples of applications shell scripts can be used for include:
  • 20.
    ADVANTAGES Shell scripting ismeant to be simple and efficient. It uses the same syntax in the script as it would on the shell command line, removing any interpretation issues. Writing code for a shell script is also faster and requires less of learning curve than other programming languages. DISADVANTAGES if there is an error in a shell script, this can prove to be extremely costly if left unnoticed. Additionally, differing platforms associated with shell scripting may not be compatible. Shell scripts can also be slower to execute than individual commands. ADVANTAGES & DISADVANTAGES OF SHELL SCRIPTING
  • 21.
  • 22.