summaryrefslogtreecommitdiff
path: root/blog/dst/a
diff options
context:
space:
mode:
Diffstat (limited to 'blog/dst/a')
-rw-r--r--blog/dst/a/linux_video_notes.html199
-rw-r--r--blog/dst/a/shell_scripting_video_notes.html324
-rw-r--r--blog/dst/a/sql_video_notes.html261
3 files changed, 0 insertions, 784 deletions
diff --git a/blog/dst/a/linux_video_notes.html b/blog/dst/a/linux_video_notes.html
deleted file mode 100644
index e495ed6..0000000
--- a/blog/dst/a/linux_video_notes.html
+++ /dev/null
@@ -1,199 +0,0 @@
-<!DOCTYPE html>
-<html class="theme-dark" lang="en"
- prefix="og: https://ogp.me/ns#">
- <head>
- <base href="https://static.luevano.xyz">
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Linux tutorial video notes -- Luévano's Blog</title>
- <meta name="description" content"Notes of videos about basic Linux terms, usage and commands, as requested by a mentor of mine."/>
- <link rel="alternate" type="application/rss+xml" href="https://blog.luevano.xyz/rss.xml" title="Luévano's Blog RSS">
- <link rel="icon" href="images/icons/favicon.ico">
-
- <!-- general style -->
- <link rel="stylesheet" type="text/css" href="css/style.css">
- <link rel="stylesheet" type="text/css" href="fork-awesome/css/fork-awesome.min.css">
- <link rel="stylesheet" type="text/css" href="font-awesome/css/all.min.css">
-
- <!-- highlight support for code blocks -->
- <script type="text/javascript" src="hl/highlight.min.js"></script>
- <!--<script type="text/javascript" src="hl/highlight-ln.min.js"></script>-->
- <script type="text/javascript">
- hljs.initHighlightingOnLoad();
- // hljs.initLineNumbersOnLoad();
- </script>
-
- <!-- theme related -->
- <script type="text/javascript" src="scripts/theme.js"></script>
- <link id="theme-css" rel="stylesheet" type="text/css" href="css/theme.css">
- <link id="code-theme-css" rel="stylesheet" type="text/css" href="hl/styles/nord.min.css">
-
- <!-- og meta -->
- <meta property="og:title" content="Linux tutorial video notes -- Luévano's Blog"/>
- <meta property="og:type" content="article"/>
- <meta property="og:url" content="https://blog.luevano.xyz/a/linux_video_notes.html"/>
- <meta property="og:image" content="https://static.luevano.xyz//images/b/default.png"/>
- <meta property="og:description" content="Notes of videos about basic Linux terms, usage and commands, as requested by a mentor of mine."/>
- <meta property="og:locale" content="en"/>
- <meta property="og:site_name" content="Luévano's Blog"/>
- </head>
-
- <body>
- <header>
- <nav>
- <ul>
- <li>
- <a href="https://luevano.xyz/"><i class="fas fa-home" alt="Home"></i><span>Home</span></a>
- </li>
-
- <li>
- <a href="https://blog.luevano.xyz/"><i class="fas fa-book-open" alt="Blog"></i><span>Blog</span></a>
- </li>
-
- <li>
- <a href="https://art.luevano.xyz/"><i class="fas fa-paint-brush" alt="Art"></i><span>Art</span></a>
- </li>
-
- <li><i class="fab fa-git" alt="Git"></i><span>Git</span>
- <ul>
- <li><a href="https://git.luevano.xyz/" target="_blank"><i class="fab fa-git-alt" alt="Git-alt"></i></a></li>
-
- <li><a href="https://github.com/luevano" target="_blank"><i class="fab fa-github" alt="Github"></i></a></li>
-
- <li><a href="https://gitlab.com/dluevano" target="_blank"><i class="fab fa-gitlab" alt="Gitlab"></i></a></li>
- </ul>
- </li>
-
- <li><i class="fas fa-box-open" alt="Stuff"></i><span>Stuff</span>
- <ul>
- <li><a href="https://gb.luevano.xyz/"><i class="fas fa-gamepad" alt="Gameboy"></i><span>Gameboy</span></a></li>
- </ul>
- </li>
- </ul>
- </nav>
-
- <button class="theme-switcher" onclick="toggleTheme()"><i class="fas fa-moon"></i><i class="fas fa-sun"></i></button>
- </header>
-
- <main>
- <h1>Linux tutorial video notes</h1>
-
- <p>I was requested to make a summary of a video about basic Linux stuff (like the <a href="https://blog.luevano.xyz/a/sql_video_notes">SQL tutorial video notes</a>); this time, I did most of the notes depending on the topic since I&rsquo;m familiar with most of the stuff presented in the video. The video in question is: <a href="https://www.youtube.com/watch?v=wBp0Rb-ZJak">The Complete Linux Course: Beginner to Power User!</a>. Also, some notes were taken from <a href="https://wiki.archlinux.org/">Arch Linux Wiki</a> since it&rsquo;s got pretty decent documentation, and, of course, general googling.</p>
-<h2 id="basic-commands">(Basic) commands</h2>
-<p>A list of basic commands and small explanation (note that options are started with either <code>-</code> or <code>--</code>, depending on the program, but most of the time <code>-</code> is used for letter options and <code>--</code> for word options, <code>-l</code> vs <code>--list</code> for example):</p>
-<ul>
-<li><code>pwd</code>: &ldquo;print working directory&rdquo;, full <strong>absolute</strong> path to the current directory.</li>
-<li><code>cd</code>: &ldquo;change directory&rdquo;, followed by the absolute or relative path of the directory to change to.<ul>
-<li>Absolute path is started with <code>/</code>, while a relative path is started with <code>./</code> or just the name of the folder.</li>
-<li>Use <code>..</code> (two dots) to go up one directory.</li>
-<li>An abbreviation of <code>/home/username</code> is <code>~</code> (tilde).</li>
-</ul>
-</li>
-<li><code>ls</code>: &ldquo;list&rdquo; files and directories in current directory, or specify a directory from which to show the list after typing <code>ls</code>. Has many options, the most common ones being:<ul>
-<li><code>l</code>: use long listing format.</li>
-<li><code>r</code> or <code>reverse</code>: reverse order while sorting.</li>
-<li><code>s</code>: sort by file size, largest first.</li>
-<li><code>a</code> or <code>all</code>: do not ignore entries starting with <code>.</code>.</li>
-</ul>
-</li>
-<li><code>mkdir</code>: &ldquo;make directory&rdquo;, create a new directory with specified name.</li>
-<li><code>touch</code>: create new (empty) files.</li>
-<li><code>cp</code>: &ldquo;copy&rdquo; files or directories (using option <code>r</code> for recursive). Requires file/directory to copy and destination, separated by space.</li>
-<li><code>mv</code>: &ldquo;move&rdquo; files or directories, also requires file/directory to copy and destination, separated by space. This is also used to <strong>rename</strong> files/directories.</li>
-<li><code>rm</code>: &ldquo;remove&rdquo;, followed by a file to remove it.</li>
-<li><code>rmdir</code>: &ldquo;remove empty directory&rdquo;, followed by a directory to remove it. If the directory is not empty, use <code>rm -r</code> on the directory (&ldquo;remove recursive&rdquo;).</li>
-<li><code>su</code>: &ldquo;switch user&rdquo;, by default to <strong>root</strong> user, but another one can be specified.</li>
-<li><code>sudo</code>: &ldquo;switch user, do&rdquo;, similar to <code>su</code>, but only to execute a command as <strong>root</strong> or the specified user.</li>
-<li><code>clear</code>: clear the terminal window, a (common) keyboard shortcut is <code>Ctrl + l</code>.</li>
-<li><code>find</code>: search for files/directories matching a pattern or all contents of a directory (using <code>.</code>).</li>
-<li><code>grep</code>: comes from the <code>ed</code> command &ldquo;g/re/p&rdquo;, for searching plain-text for lines that match a regular expression (regex).</li>
-<li><code>top</code>: a task manager program, shows currently running commands and gives important info such as PID (process ID), user who is running that command, command name, cpu and ram usage, etc.. Some useful commands to manage programs running are:<ul>
-<li><code>pgrep</code>: get the PID of a running process, or a list in chronological order.</li>
-<li><code>kill</code> or <code>pkill</code>: kill a running process either by PID or by name.</li>
-<li><code>killall</code>: similar to <code>pkill</code>.</li>
-</ul>
-</li>
-<li><code>ssh</code>: &ldquo;secure shell&rdquo; is a remote login client used to connect into a remote machine and executing commands remotely, basically taking control of the remote machine. Widely used when managing servers.</li>
-<li><code>ftp</code> or <code>sftp</code>: &ldquo;(secure) file transfer protocol&rdquo; used to transfer files from one machine to another one (usually a server). It&rsquo;s recommended to use <code>sftp</code> instead of <code>ftp</code> because anyone can look through the packages if it&rsquo;s not secured (encrypted).</li>
-</ul>
-<p>And in general, to see the options supported by almost any command, use <code>command -h</code> or <code>command --help</code>, for a quick explanation. <strong>IMPORTANT</strong>: Most programs have <strong>man (manual) pages</strong>; to access them do <code>man command</code>, this is a very powerful tool to use.</p>
-<p>Commands can be redirected to other commands (the output), which is powerful to create mini scripts or to achieve a goal in a single command. Most of the time the redirection can be done with the special characters <code>&gt;</code>, <code>&lt;</code> and most powerful, the <code>|</code> (pipe). Also, some commands accept an option to execute another command, but this depends on a command to command basis (<code>exec</code> option for <code>find</code>, for example).</p>
-<p><strong>Most terminal programs accept <code>Ctrl-c</code> or just <code>q</code> to exit the program.</strong></p>
-<h2 id="file-permissions-and-ownership">File permissions and ownership</h2>
-<p>When listing files with <code>ls -l</code>, an output with file attributes (permissions) and ownership is shown, such as <code>drwxr-xr-x 2 user group 4096 Jul 5 21:03 Desktop</code>, where the first part are the attributes, and <code>user</code> and <code>group</code> the ownership info (all other info is irrelevant for now).</p>
-<p>File attributes (<code>drwxr-xr-x</code> in the example above) are specified by 10 (sometimes 11) characters, and can be break into 4 parts (or 5):</p>
-<ul>
-<li>The first character is just the file type, typically <code>d</code> for directories or just <code>-</code> for files. There is <code>l</code> too, which is for <strong>symlinks</strong>.</li>
-<li>The next 3 characters represent the permissions that the <strong>owner</strong> has over the file.</li>
-<li>Next 3 the permissions that the <strong>group</strong> has over the file.</li>
-<li>Next 3 the permissions everyone else (<strong>others</strong>) have over the file.</li>
-<li>An optional <code>+</code> character that specifies whether an alternate access method applies to the file. When the character is a space, there is no alterante access method.</li>
-</ul>
-<p>Each of the three permission triads (<code>rwx</code>) can be:</p>
-<ul>
-<li><code>-</code> or <code>r</code>, for the first character, if the file can be <strong>read</strong> or directory&rsquo;s content can be shown.</li>
-<li><code>-</code> or <code>w</code>, for the second character, if the file can be <strong>modified</strong> or the directory&rsquo;s content can be modified (create new files or folders or rename existing files or folders).</li>
-<li><code>-</code> or <code>x</code>, for the third character, if the file can be <strong>executed</strong> or the directory can be <strong>accessed</strong> with <code>cd</code>. Other characters can be present, like <code>s</code>, <code>S</code>, <code>t</code> and <code>T</code> (for more: <a href="https://wiki.archlinux.org/index.php/File_permissions_and_attributes">Arch Linux Wiki: File permissions and attributes</a>).</li>
-</ul>
-<p>To change attributes or ownership use <code>chmod</code> and <code>chown</code>, respectively.</p>
-<h2 id="services">Services</h2>
-<p>Special type of linux process (think of a program or set of programs that run in the background waiting to be used, or doing essential tasks). There are many ways to manage (start, stop, restart, enable, disable, etc.) services, the most common way (if using <code>systemd</code>) is to just use <code>systemctl</code>. Basic usage of <code>systemctl</code> is <code>systemctl verb service</code>, where <code>verb</code> could be <code>start</code>, <code>enable</code>, <code>stop</code>, <code>disable</code>, <code>restart</code>, etc. Also, to get a general system status run <code>systemctl status</code> or just <code>systemctl</code> for a list of running <strong>units</strong> (a unit is an instance of a service, or a mount point or even a device or a socket). For more: <a href="https://wiki.archlinux.org/index.php/systemd">Arch Linux Wiki: systemd</a>.</p>
-<p><code>systemd</code> also provides a way to do tasks based on a <strong>timer</strong>, where you can schedule from the second to the year. One could also use <code>cron</code> (using <code>crontab</code> with option <code>e</code>) to do this. These timers provide support for calendar time events, monotonic time events, and can be run asynchronously.</p>
-<h2 id="user-and-group-management">User and group management</h2>
-<p>Most mainstream linux distributions come with a Graphic User Interface (GUI) to manage users and groups on the system. For a Command-Line Interface (CLI) just use <code>useradd</code> (with <code>passwd</code> to create a password for a given user) and <code>groupadd</code>. Also, other useful commands are <code>usermod</code>, <code>userdel</code>, <code>groups</code>, <code>gpasswd</code>, <code>groupdel</code> and more, each used for a basic management of users/groups like modification, deletion, listing (of all existing users/groups), etc.. For more: <a href="https://wiki.archlinux.org/index.php/users_and_groups">Arch Linux Wiki: Users and groups</a>.</p>
-<h2 id="networking">Networking</h2>
-<h3 id="hosts-file">Hosts file</h3>
-<p>Located at <code>/etc/hosts</code>, serves as a translator from <strong>hostname</strong> (web addresses or URLs) into IP addresses (think of DNS records), meaning that any URL can be overridden to make it point to whatever IP address it&rsquo;s specified (only locally on the machine affected). The syntax of the file is pretty simple: first column for IP, second for hostname (URL) and third+ for aliases.</p>
-<h3 id="some-commands">(Some) commands</h3>
-<p>These commands serve the sole purpose of showing information about the network and stuff related to it:</p>
-<ul>
-<li><code>ping</code>: gives information about latency to a given ip/domain.</li>
-<li><code>ifconfig</code>: gives similar information to <code>ipconfig</code> on windows, general info of physical network devices with their addresses and properties. An alternative could be <code>ip addr</code>, depending on the linux distribution being used and programs installed.</li>
-<li><code>tcpdump</code>: &ldquo;transmission control protocol dump&rdquo; gives information on all &ldquo;packets&rdquo; being sent and received through the network.</li>
-<li><code>netstat</code>: &ldquo;network statistics&rdquo; general statistics about network devices usage, display connections to the machine and more.</li>
-<li><code>traceroute</code>: shows the route that the packets go through (how the packets jump from one server to another one) when trying to access an IP (or, for example, a website).</li>
-<li><code>nmap</code>: &ldquo;network mapper&rdquo; explore network available hosts, opened ports, reverse DNS names, can guess the operating system of the device, it&rsquo;s type, MAC address and more.</li>
-</ul>
-
- <hr>
- <div class="article-info">
- <p>By David Luévano</p>
- <p>Created: Sun, Mar 14, 2021 @ 05:57 UTC</p>
- <p>Modified: Fri, Jun 04, 2021 @ 07:59 UTC</p>
- <div class="article-tags">
- <p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@notes.html">notes</a> </p>
-</div>
-
- </div>
- </main>
-
- <footer>
- <span>
- <i class="fas fa-address-card" alt="Contact"></i>
- <a href="https://luevano.xyz/contact.html">Contact</a>
- </span>
-
- <span>
- <i class="fas fa-donate" alt="Donate"></i>
- <a href="https://luevano.xyz/donate.html">Donate</a>
- </span>
-
- <span>
- <i class="fas fa-rss" alt="RSS"></i>
- <a target="_blank" href="https://blog.luevano.xyz/rss.xml">RSS</a>
- </span>
-
- <br>
- <span class="created-with">
- <i class="fas fa-hammer" alt="Hammer"></i>
- Created with <a href="https://github.com/luevano/pyssg">pyssg</a>
- </span>
-
- <br>
- <span class="copyright">
- Copyright <i class="far fa-copyright" alt="Copyright"></i> 2021 David Luévano Alvarado
- </span>
- </footer>
- </body>
-</html> \ No newline at end of file
diff --git a/blog/dst/a/shell_scripting_video_notes.html b/blog/dst/a/shell_scripting_video_notes.html
deleted file mode 100644
index a2d0a47..0000000
--- a/blog/dst/a/shell_scripting_video_notes.html
+++ /dev/null
@@ -1,324 +0,0 @@
-<!DOCTYPE html>
-<html class="theme-dark" lang="en"
- prefix="og: https://ogp.me/ns#">
- <head>
- <base href="https://static.luevano.xyz">
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>Shell scripting tutorial video notes -- Luévano's Blog</title>
- <meta name="description" content"Notes of videos about shell scripting, as requested by a mentor of mine."/>
- <link rel="alternate" type="application/rss+xml" href="https://blog.luevano.xyz/rss.xml" title="Luévano's Blog RSS">
- <link rel="icon" href="images/icons/favicon.ico">
-
- <!-- general style -->
- <link rel="stylesheet" type="text/css" href="css/style.css">
- <link rel="stylesheet" type="text/css" href="fork-awesome/css/fork-awesome.min.css">
- <link rel="stylesheet" type="text/css" href="font-awesome/css/all.min.css">
-
- <!-- highlight support for code blocks -->
- <script type="text/javascript" src="hl/highlight.min.js"></script>
- <!--<script type="text/javascript" src="hl/highlight-ln.min.js"></script>-->
- <script type="text/javascript">
- hljs.initHighlightingOnLoad();
- // hljs.initLineNumbersOnLoad();
- </script>
-
- <!-- theme related -->
- <script type="text/javascript" src="scripts/theme.js"></script>
- <link id="theme-css" rel="stylesheet" type="text/css" href="css/theme.css">
- <link id="code-theme-css" rel="stylesheet" type="text/css" href="hl/styles/nord.min.css">
-
- <!-- og meta -->
- <meta property="og:title" content="Shell scripting tutorial video notes -- Luévano's Blog"/>
- <meta property="og:type" content="article"/>
- <meta property="og:url" content="https://blog.luevano.xyz/a/shell_scripting_video_notes.html"/>
- <meta property="og:image" content="https://static.luevano.xyz//images/b/default.png"/>
- <meta property="og:description" content="Notes of videos about shell scripting, as requested by a mentor of mine."/>
- <meta property="og:locale" content="en"/>
- <meta property="og:site_name" content="Luévano's Blog"/>
- </head>
-
- <body>
- <header>
- <nav>
- <ul>
- <li>
- <a href="https://luevano.xyz/"><i class="fas fa-home" alt="Home"></i><span>Home</span></a>
- </li>
-
- <li>
- <a href="https://blog.luevano.xyz/"><i class="fas fa-book-open" alt="Blog"></i><span>Blog</span></a>
- </li>
-
- <li>
- <a href="https://art.luevano.xyz/"><i class="fas fa-paint-brush" alt="Art"></i><span>Art</span></a>
- </li>
-
- <li><i class="fab fa-git" alt="Git"></i><span>Git</span>
- <ul>
- <li><a href="https://git.luevano.xyz/" target="_blank"><i class="fab fa-git-alt" alt="Git-alt"></i></a></li>
-
- <li><a href="https://github.com/luevano" target="_blank"><i class="fab fa-github" alt="Github"></i></a></li>
-
- <li><a href="https://gitlab.com/dluevano" target="_blank"><i class="fab fa-gitlab" alt="Gitlab"></i></a></li>
- </ul>
- </li>
-
- <li><i class="fas fa-box-open" alt="Stuff"></i><span>Stuff</span>
- <ul>
- <li><a href="https://gb.luevano.xyz/"><i class="fas fa-gamepad" alt="Gameboy"></i><span>Gameboy</span></a></li>
- </ul>
- </li>
- </ul>
- </nav>
-
- <button class="theme-switcher" onclick="toggleTheme()"><i class="fas fa-moon"></i><i class="fas fa-sun"></i></button>
- </header>
-
- <main>
- <h1>Shell scripting tutorial video notes</h1>
-
- <p>Another summary, this time about shell scripting in general. And just like with the <a href="https://blog.luevano.xyz/a/linux_video_notes">Linux notes</a>, I also did most of the notes myself or with resources outside the video. The videos in question are: <a href="https://www.youtube.com/playlist?list=PL7B7FA4E693D8E790">The Bad Tutorials (YT): Shell Scripting Tutorials</a> and <a href="https://www.youtube.com/playlist?list=PL2qzCKTbjutJRM7K_hhNyvf8sfGCLklXw">Automation with SCripting (YT): Complete Shell Scripting Tutorials</a>. Also, some notes were taken from <a href="https://www.tutorialspoint.com/unix/index.htm">tutorialspoint: UNIX / LINUX Tutorial</a> and general googling.</p>
-<h2 id="basic-concepts">Basic concepts</h2>
-<p>A <strong>shell</strong> it&rsquo;s an <strong>interface</strong> between the user and the <strong>kernel</strong>. While the kernel it&rsquo;s the layer that interacts between the shell and the <strong>hardware</strong>. And you access the shell either via a <strong>terminal</strong>, or executing a <strong>shell script</strong>. Note that if you&rsquo;re using a GUI environment, you need a <strong>terminal emulator</strong> to actually use a terminal (most Linux distros come with everything needed, so no need to worry).</p>
-<p>When using a terminal a blank screen with some text and a cursor that shows you where to type will appear and depending on the shell being used (<code>sh</code>, <code>dash</code>, <code>ksh</code>, <code>bash</code>, <code>zsh</code>, <code>fish</code>, etc.) the <strong>prompt</strong> will be different. The most common one being of the form <code>user@host:~$</code>, which tells that the <code>user</code> is using <code>host</code> machine and the current working directory is <code>~</code> (can be <code>/any/path/</code> too), and lastly, the <code>$</code> shows the current privileges of the shell/user using the shell (a <code>$</code> for normal user and <code>#</code> for root access).</p>
-<p>To clear the screen use command <code>clear</code> or simply do <code>Ctrl + l</code> (most terminals let you do this) and to cancel or create a new prompt do <code>Ctrl + c</code>, this also cancels any running program that&rsquo;s using the terminal (typing <code>q</code> when a program is running also stops the process, sometimes).</p>
-<p>Also there are <strong>POSIX</strong> (portable operating system interface) compliant shells like <code>sh</code>, <code>dash</code>, <code>ksh</code>, etc., that have a standard syntax and are portable to any Unix system. Non POSIX compliant shells (or not necessary fully POSIX compliant) are <code>bash</code>, <code>zsh</code>, <code>fish</code>, etc., that provide a more modern syntax but lack speed on executing scripts.</p>
-<h3 id="common-commandsprograms">Common commands/programs</h3>
-<p>A list of common commands or programs with a short description (for more, do <code>man command</code> or <code>command -h</code> or <code>command --help</code>):</p>
-<ul>
-<li><strong><code>man</code>: an interface to the system reference manuals.</strong></li>
-<li><code>pwd</code>: print name of current/working directory.</li>
-<li><code>cd</code>: change the working directory.</li>
-<li><code>ls</code>: list directory contents.</li>
-<li><code>echo</code>: display a line of text. Also, see <strong>escape sequences</strong> (<a href="https://tldp.org/HOWTO/Bash-Prompt-HOWTO/bash-prompt-escape-sequences.html">Bash Prompt HOWTO: Chapter 2. Bash and Bash Prompts: 2.5. Bash Prompt Escape Sequences</a>).</li>
-<li><code>mkdir</code>: make directories.</li>
-<li><code>touch</code>: change file timestamps (if no file exists, creates a new blank one).</li>
-<li><code>cat</code>: concatenate files and print on the standard output.</li>
-<li><code>mv</code>: move (rename) files.</li>
-<li><code>rm</code>: remove files or directories.</li>
-<li><code>rmdir</code>: remove empty directories.</li>
-<li><code>cp</code>: copy files and directories.</li>
-<li><code>ln</code>: make links between files (hard or soft, also known as symbolic).</li>
-<li><code>umask</code>: get or set the file mode creation mask.</li>
-<li><code>chmod</code>: change file mode bits (change file permissions).</li>
-<li><code>chown</code>: change file owner and group.</li>
-<li><code>wc</code>: print newline, word, and byte counts for each file.</li>
-<li><code>file</code>: determine file type.</li>
-<li><code>sort</code>: sort lines of text files.</li>
-<li><code>cut</code>: remove sections from each line of files.</li>
-<li><code>dd</code>: convert and copy a file (mostly used to make bootable USBs).</li>
-<li><code>compress</code>: compress data.</li>
-<li><code>gzip</code>, <code>gunzip</code>, <code>zcat</code>: compress or expand files.</li>
-<li><code>uname</code>: print system information.</li>
-<li><code>cal</code>: display a calendar.</li>
-<li><code>date</code>: print or set the system date and time.</li>
-<li><code>read</code>: read from standard input into shell variables (also used to read from a file).</li>
-<li><code>tr</code>: translate or delete characters.</li>
-<li><code>readonly</code>: set the readonly attribute for variables.</li>
-<li><code>set</code>: set or unset options and positional parameters.</li>
-<li><code>unset</code>: unset values and attributes of variables and functions.</li>
-<li><code>expr</code>: evaluate expressions.</li>
-<li><code>tput</code>, <code>reset</code>: initialize a terminal or query terminfo database (used for more complex terminal output).</li>
-<li><code>grep</code>, <code>egrep</code>, <code>fgrep</code>: print lines that match patterns (usually used to find text in a file or some text).</li>
-<li><code>sleep</code>: delay for a specified amount of time.</li>
-<li><code>break</code>: exit from for, while, or until loop.</li>
-<li><code>continue</code>: continue for, while, or until loop.</li>
-<li><code>logname</code>: print user&rsquo;s login name.</li>
-<li><code>write</code>: send a message to another user.</li>
-<li><code>mesg</code>: display (or do not display) messages from other users.</li>
-<li><code>return</code>: return from a function or dot script.</li>
-<li><code>exit</code>: cause the sell to exit.</li>
-</ul>
-<p>And some special &ldquo;commands&rdquo; or &ldquo;operators&rdquo; (for more: <a href="https://www.gnu.org/software/bash/manual/html_node/Redirections.html">gnu: 3.6 Redirections</a>):</p>
-<ul>
-<li><code>|</code> (pipe): used between two commands and the output from the command from the left serves as input to the command from the right.</li>
-<li><code>&gt;</code>: redirects output to a file, overwriting the file (or creating a new file).</li>
-<li><code>&gt;&gt;</code>: redirects output to a file, appending to the file (or creating a new file).</li>
-</ul>
-<h2 id="shell-scripting">Shell scripting</h2>
-<p>A shell script is nothing more but a file that contains commands in it; they&rsquo;re executed in the same order they are present in the file. A shell script file is usually terminated with a <code>.sh</code> extension, independently of the shell being used, but it&rsquo;s not 100% necessary as in Unix systems, an extension mean nothing, other than distinction (visually) between files. Then one can just have an extension-less file as a script. <strong>The script must have execution permissions (<code>chmod +x file</code>)</strong>, unless <code>shell script</code> is executed in the terminal, where <code>shell</code> could be <code>sh</code>, <code>bash</code>, etc. <strong>Comments</strong> are created by prepending <code>#</code> to whatever the text should be a comment.</p>
-<p>It&rsquo;s common practice to have the first line as a <strong>she-bang</strong> (<code>#!</code>), which is just a comment telling the interpreter which shell to execute the script with (usable when having the script in your <strong>PATH</strong> so you only call the name of the script like any other command/program). A she-bang has the syntax <code>#!/path/to/shell some_other_options</code>, the most common she-bangs being: <code>#!/bin/sh</code>, <code>#!/bin/bash</code>, <code>#!/usr/bin/python</code>, etc.</p>
-<p>Also, some people argue that you shouldn&rsquo;t use absolute paths, since not all Unix operating systems have the same directory structure, or not all programs are going to be installed in the same folder. So a portable she-bang can be made by prepending <code>/usr/bin/env</code> and the specify the program to run, for example: <code>#!/usr/bin/env bash</code>.</p>
-<p>Like always&hellip; the basic &ldquo;Hello, world!&rdquo; script:</p>
-<pre><code class="language-sh">#!/bin/sh
-echo &quot;Hello, world!&quot;
-</code></pre>
-<p>Three ways of executing this script (assuming the file name is <code>hw</code>):</p>
-<ol>
-<li>Type in terminal <code>sh hw</code>.</li>
-<li>Type in terminal <code>./hw</code>. Requires the file to have execute permissions.</li>
-<li>Type in terminal <code>hw</code>. Requires the file to have execute permissions. Requires the file to be in your PATH.</li>
-</ol>
-<h3 id="variables">Variables</h3>
-<p>Variables are case sensitive, meaning that <code>my_var</code> and <code>MY_VAR</code> are different and a variable name can only contain letters and numbers (<code>a-z</code>, <code>A-Z</code> and <code>0-9</code>) or the underscore character <code>_</code>. Can&rsquo;t contain a space. Variables are called by prepending <code>$</code> to the variable name.</p>
-<p>Like in most programming languages, there are some reserved words like <code>if</code>, <code>select</code>, <code>then</code>, <code>until</code>, <code>while</code>, etc., that can&rsquo;t be used as variables or as values of variables. For more: <a href="https://www.gnu.org/software/bash/manual/html_node/Reserved-Word-Index.html">D.2 Index of Shell Reserved Words</a>.</p>
-<p>There is no need to specify a variable type. Anything surrounded by <code>"</code> will be treated as text. You can use booleans, numbers, text and arrays (the implementation of arrays depends on the shell being used). Make a variable readonly by calling <code>readonly variable_name</code>. Basic syntax:</p>
-<ul>
-<li>Text variables: <code>var="my var"</code>.</li>
-<li>Numeric variables: <code>var=123</code>.</li>
-<li>Boolean variables: <code>var=true</code> and <code>var=false</code>.</li>
-<li>Arrays (assuming <code>bash</code> is the shell):<ul>
-<li><code>var[0]=value1</code>, <code>var[...]=...</code>, <code>var[n]=valuen</code>, etc.</li>
-<li><code>var=(value1 ... valuen)</code></li>
-<li>Access single values with <code>${var[index]}</code> and all values with <code>${var[*]}</code> or <code>${var[@]}</code>.</li>
-</ul>
-</li>
-</ul>
-<p>There are special variables (for more. <a href="https://www.tutorialspoint.com/unix/unix-special-variables.htm">tutorialspoint: Unix / Linux - Special Variables</a>):</p>
-<ul>
-<li><code>$</code>: represents the process ID number, or PID, of the current shell.</li>
-<li><code>0</code>: the filename of the current script.</li>
-<li><code>n</code>: where <code>n</code> can be any whole number, correspond to arguments passed to the script (<code>command arg1 arg2 arg3 argn</code>).</li>
-<li><code>#:</code> number of arguments supplied to the script.</li>
-<li><code>*:</code> all the arguments are double quoted.</li>
-<li><code>@:</code> all the arguments are individually double quoted.</li>
-<li><code>?:</code> exit status of the last command executed.</li>
-<li><code>!:</code> process number of the last background command.</li>
-</ul>
-<p>When calling a script, you can pass optional (or required) positional arguments like: <code>command arg1 arg2 arg3 argn</code>.</p>
-<p>Note that a variable can also take the output of another command, one common way to do this is using <code>$(command)</code> or <code>`command`</code>, for example: <code>var="$(echo 'this is a command being executed inside the definition of a variable')"</code> which, since the <code>echo</code> command is being run, <code>var="this is a command being executed inside the definition of a variable"</code>, which doesn&rsquo;t seem like much, but there could be any command inside <code>$()</code> or <code>`command`</code>. Note that this is not special to defining variables, could also be used as arguments of another command.</p>
-<h4 id="internal-field-separator-ifs">Internal Field Separator (IFS)</h4>
-<p>This is used by the shell to determine how to do word splitting (how to recognize word boundaries). The default value for <code>IFS</code> consists of whitespace characters (space, tab and newline). This value can ve overridden by setting the variable <code>IFS</code> to something like, for example, <code>:</code>.</p>
-<h3 id="conditionals">Conditionals</h3>
-<h4 id="exit-status">Exit status</h4>
-<p>Any command being run has an exit status, either <code>0</code> or <code>1</code>, if the command has been executed successfully or otherwise (an error), respectively.</p>
-<h4 id="if-statement"><code>if</code> statement</h4>
-<p>Pretty similar to other programming languages, evaluates an expression to a <code>true</code> or <code>false</code> and executes code as specified. <code>if</code> statements can be nested, and follow normal rules of logical operations. Basic syntax is:</p>
-<pre><code class="language-sh">#!/bin/sh
-if expression
-then
-do_something
-elif another_expression
-then
-do_another_thing
-else
-do_something_else
-fi
-</code></pre>
-<p>The expression is usually wrapped around <code>[]</code> or <code>[[]]</code>, the first being POSIX compliant and the second <code>bash</code>-specific (and other shells).</p>
-<p>Also, some <strong>operators</strong> to compare things use <code>==</code> for &ldquo;equals&rdquo; and <code>&gt;</code> for &ldquo;greater than&rdquo;, for example; while in a POSIX compliant shell, <code>=</code> for &ldquo;equals&rdquo; and <code>-gt</code> for &ldquo;greater than&rdquo; has to be used. For more operators: <a href="https://www.tutorialspoint.com/unix/unix-basic-operators.htm">tutorialspoint: Unix / Linux - Shell Basic Operators</a> (this also covers <strong>logical operators</strong> and <strong>file test operators</strong>).</p>
-<h3 id="case-statement">Case statement</h3>
-<p>A common good alternative to multilevel <code>if</code> statements, enables you to match several values against one variable. Basic syntax is:</p>
-<pre><code class="language-sh">case $var in
- pattern1)
- do_something1
- ;;
- pattern2)
- subpattern1)
- do_subsomething1
- ;;
- subpattern2)
- do_subsomething2
- ;;
- *)
- pattern3|pattern4|...|patternN)
- do_something3
- ;;
- patternM)
- do_somethingM
- ;;
- *)
- do_something_default
- ;;
-esac
-</code></pre>
-<p>Where the <code>*</code> pattern is not necessary but serves the same purpose as a &ldquo;default&rdquo; case.</p>
-<h3 id="loops">Loops</h3>
-<p>Loops enable execution of a set of commands repeatedly. Loops, naturally, can be nested. <code>expression</code> here (in the basic syntax examples) work the same as mentioned in the &ldquo;<code>if</code> statement&rdquo; section. For more: <a href="https://www.tutorialspoint.com/unix/unix-shell-loops.htm">tutorialspoint: Unix / Linux - Shell Loop Types</a>.</p>
-<h4 id="loop-control">Loop control</h4>
-<p>Similar than other programming languages, there are loop controls to interrupt or continue a loop:</p>
-<pre><code>* `break` statement.
-* `continue` statement.
-</code></pre>
-<p>These statements accept an argument that specify from which loop to exit/continue.</p>
-<h4 id="while-loop"><code>while</code> loop</h4>
-<p>Enables to execute a set of commands repeatedly until some condition occurs. Basic syntax:</p>
-<pre><code class="language-sh">#!/bin/sh
-while expression
-do
- do_something
-done
-</code></pre>
-<h4 id="until-loop"><code>until</code> loop</h4>
-<p>Similar to the <code>while</code> loop, the difference is that the <code>while</code> loop is executed as long as a condition is true, but the <code>until</code> loop&hellip; until a condition is true. Basic syntax (similar to <code>while</code> loop):</p>
-<pre><code class="language-sh">#!/bin/sh
-until expression
-do
- do_something
-done
-</code></pre>
-<h4 id="for-loop"><code>for</code> loop</h4>
-<p>Operates on lists of items. It repeats a set of commands for every item in a list. Basic syntax:</p>
-<pre><code class="language-sh">#!/bin/sh
-for var in word1 word2 ... wordN
-do
- do_something_with_var
-done
-</code></pre>
-<p>Where <code>var</code> is the current value (<code>word1</code>, <code>word2</code>, etc.) in the loop and the expression after <code>for</code> can refer to an array, or the output of a command that outputs a list of things, etc.</p>
-<h4 id="select-loop"><code>select</code> loop</h4>
-<p>Provides an easy way to create a numbered menu from which users can select options. Basic syntax (similar to <code>for</code> loop):</p>
-<pre><code class="language-sh">select var in word1 word2 ... wordN
-do
- do_something_with_var
-done
-</code></pre>
-<h3 id="meta-characters">Meta characters</h3>
-<p>Meta characters are used to execute several commands on a single line (depending on what it&rsquo;s needed). The most used meta characters to accomplish this are semi-colon <code>;</code>, double ampersand <code>&amp;&amp;</code> and double &ldquo;pipe&rdquo; <code>||</code>.</p>
-<ul>
-<li><code>;</code>: is used to finish one command (similar to some programming languages), after the command on the left of <code>;</code> is finished (whatever the exit code is), the command on the right will be executed.</li>
-<li><code>&amp;&amp;</code>: similar to <code>;</code>, but only if the command on the left exits with code <code>0</code> (success).</li>
-<li><code>||</code>: similar to <code>&amp;&amp;</code>, but for exit code <code>1</code>(error).</li>
-</ul>
-<h3 id="functions">Functions</h3>
-<p>Enable to break down the overall functionality of a script into smaller, logical subsections, which can then be called upon to perform their individual tasks when needed (like in any other programming language&hellip;). For more: <a href="https://www.tutorialspoint.com/unix/unix-shell-functions.htm">tutorialspoint: Unix / Linux - Shell Functions</a>. Basic syntax:</p>
-<pre><code class="language-sh">#!/bin/sh
-function_name () {
- do_something
-}
-</code></pre>
-<p>Functions can also take arguments and can access their individual arguments (each function will have a different &ldquo;storage&rdquo; for their arguments). Functions can also be nested. Here <code>exit</code> will not only will finish the function code, but also the shell script that called it, instead use <code>return</code> plus an exit code to just exit the function.</p>
-
- <hr>
- <div class="article-info">
- <p>By David Luévano</p>
- <p>Created: Sun, Mar 14, 2021 @ 05:57 UTC</p>
- <p>Modified: Fri, Jun 04, 2021 @ 08:00 UTC</p>
- <div class="article-tags">
- <p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@notes.html">notes</a> </p>
-</div>
-
- </div>
- </main>
-
- <footer>
- <span>
- <i class="fas fa-address-card" alt="Contact"></i>
- <a href="https://luevano.xyz/contact.html">Contact</a>
- </span>
-
- <span>
- <i class="fas fa-donate" alt="Donate"></i>
- <a href="https://luevano.xyz/donate.html">Donate</a>
- </span>
-
- <span>
- <i class="fas fa-rss" alt="RSS"></i>
- <a target="_blank" href="https://blog.luevano.xyz/rss.xml">RSS</a>
- </span>
-
- <br>
- <span class="created-with">
- <i class="fas fa-hammer" alt="Hammer"></i>
- Created with <a href="https://github.com/luevano/pyssg">pyssg</a>
- </span>
-
- <br>
- <span class="copyright">
- Copyright <i class="far fa-copyright" alt="Copyright"></i> 2021 David Luévano Alvarado
- </span>
- </footer>
- </body>
-</html> \ No newline at end of file
diff --git a/blog/dst/a/sql_video_notes.html b/blog/dst/a/sql_video_notes.html
deleted file mode 100644
index 69fb8e7..0000000
--- a/blog/dst/a/sql_video_notes.html
+++ /dev/null
@@ -1,261 +0,0 @@
-<!DOCTYPE html>
-<html class="theme-dark" lang="en"
- prefix="og: https://ogp.me/ns#">
- <head>
- <base href="https://static.luevano.xyz">
- <meta charset="utf-8">
- <meta name="viewport" content="width=device-width, initial-scale=1">
- <title>SQL tutorial video notes -- Luévano's Blog</title>
- <meta name="description" content"Notes of videos about basic SQL syntax and usage, as requested by a mentor of mine."/>
- <link rel="alternate" type="application/rss+xml" href="https://blog.luevano.xyz/rss.xml" title="Luévano's Blog RSS">
- <link rel="icon" href="images/icons/favicon.ico">
-
- <!-- general style -->
- <link rel="stylesheet" type="text/css" href="css/style.css">
- <link rel="stylesheet" type="text/css" href="fork-awesome/css/fork-awesome.min.css">
- <link rel="stylesheet" type="text/css" href="font-awesome/css/all.min.css">
-
- <!-- highlight support for code blocks -->
- <script type="text/javascript" src="hl/highlight.min.js"></script>
- <!--<script type="text/javascript" src="hl/highlight-ln.min.js"></script>-->
- <script type="text/javascript">
- hljs.initHighlightingOnLoad();
- // hljs.initLineNumbersOnLoad();
- </script>
-
- <!-- theme related -->
- <script type="text/javascript" src="scripts/theme.js"></script>
- <link id="theme-css" rel="stylesheet" type="text/css" href="css/theme.css">
- <link id="code-theme-css" rel="stylesheet" type="text/css" href="hl/styles/nord.min.css">
-
- <!-- og meta -->
- <meta property="og:title" content="SQL tutorial video notes -- Luévano's Blog"/>
- <meta property="og:type" content="article"/>
- <meta property="og:url" content="https://blog.luevano.xyz/a/sql_video_notes.html"/>
- <meta property="og:image" content="https://static.luevano.xyz//images/b/default.png"/>
- <meta property="og:description" content="Notes of videos about basic SQL syntax and usage, as requested by a mentor of mine."/>
- <meta property="og:locale" content="en"/>
- <meta property="og:site_name" content="Luévano's Blog"/>
- </head>
-
- <body>
- <header>
- <nav>
- <ul>
- <li>
- <a href="https://luevano.xyz/"><i class="fas fa-home" alt="Home"></i><span>Home</span></a>
- </li>
-
- <li>
- <a href="https://blog.luevano.xyz/"><i class="fas fa-book-open" alt="Blog"></i><span>Blog</span></a>
- </li>
-
- <li>
- <a href="https://art.luevano.xyz/"><i class="fas fa-paint-brush" alt="Art"></i><span>Art</span></a>
- </li>
-
- <li><i class="fab fa-git" alt="Git"></i><span>Git</span>
- <ul>
- <li><a href="https://git.luevano.xyz/" target="_blank"><i class="fab fa-git-alt" alt="Git-alt"></i></a></li>
-
- <li><a href="https://github.com/luevano" target="_blank"><i class="fab fa-github" alt="Github"></i></a></li>
-
- <li><a href="https://gitlab.com/dluevano" target="_blank"><i class="fab fa-gitlab" alt="Gitlab"></i></a></li>
- </ul>
- </li>
-
- <li><i class="fas fa-box-open" alt="Stuff"></i><span>Stuff</span>
- <ul>
- <li><a href="https://gb.luevano.xyz/"><i class="fas fa-gamepad" alt="Gameboy"></i><span>Gameboy</span></a></li>
- </ul>
- </li>
- </ul>
- </nav>
-
- <button class="theme-switcher" onclick="toggleTheme()"><i class="fas fa-moon"></i><i class="fas fa-sun"></i></button>
- </header>
-
- <main>
- <h1>SQL tutorial video notes</h1>
-
- <p>I was requested to make summaries of videos about SQL, these are the notes (mostly this is a transcription of what I found useful). The videos in question are: <a href="https://www.youtube.com/watch?v=HXV3zeQKqGY">SQL Tutorial - Full Database Course for Beginners</a>, <a href="https://www.youtube.com/watch?v=7S_tz1z_5bA">MySQL Tutorial for Beginners [Full Course]</a> and <a href="https://www.youtube.com/watch?v=2Fn0WAyZV0E">Advanced SQL course | SQL tutorial advanced</a>. Also, some notes were taken from <a href="https://www.w3schools.com/sql/">w3schools.com&rsquo;s SQL Tutorial</a> and <a href="https://dev.mysql.com/doc/refman/8.0/en/">MySQL 8.0 Reference Manual</a>.</p>
-<h2 id="what-is-a-database-db">What is a database (DB)?</h2>
-<p>Any collection of related information, such as a phone book, a shopping list, Facebook&rsquo;s user base, etc.. It can be stored in different ways: on paper, on a computer, in your mind, etc..</p>
-<h3 id="database-management-systems-dbms">Database Management Systems (DBMS)</h3>
-<p>A special software program that helps users create and maintain a database that makes it easy to manage large amounts of information, handles security, backups and can connect to programming languages for automation.</p>
-<h3 id="crud">CRUD</h3>
-<p>The four main operations that a DBMS will do: create, read, update and delete.</p>
-<h3 id="two-types-of-databases">Two types of databases</h3>
-<ul>
-<li>Relational (SQL)<ul>
-<li>Organize data into one or more tables.</li>
-<li>Each table has columns and rows.</li>
-<li>A unique key identifies each row.</li>
-</ul>
-</li>
-<li>Non-relational (noSQL/not just SQL)<ul>
-<li>Key-value stores.</li>
-<li>Documents (JSON, XML, etc).</li>
-<li>Graphs.</li>
-<li>Flexible tables.</li>
-</ul>
-</li>
-</ul>
-<h4 id="relational-databases-rdb-sql">Relational databases (RDB) (SQL)</h4>
-<p>When we want to create a RDB we need a Relational Database Management System (RDBMS) that uses Structured Query Language (SQL) which is a standardized language for interacting with RDBMS and it&rsquo;s used to perform CRUD operations (and other administrative tasks).</p>
-<h4 id="non-relational-databases-nrdb-nosqlnot-just-sql">Non-relational databases (NRDB) (noSQL/not just SQL)</h4>
-<p>Anything that&rsquo;s not relational, stores data in anything but static tables. Could be a document (JSON, XML, etc.), graph (relational nodes), key-value hash (strings, json, etc.), etc.</p>
-<p>NRDB also require a Non-Relational Database Management System (NRDBMS) to maintain a database. But it doesn&rsquo;t have a standardized language for performing CRUD and administrative operations like how RDB have.</p>
-<h3 id="database-queries">Database queries</h3>
-<p>A DB query is a request that is made to the (R/NR)DBMS for a specific information. A google search is a query, for example.</p>
-<h2 id="tables-and-keys">Tables and keys</h2>
-<p>A table is composed of columns, rows and a primary key. The primary key is unique and identifies one specific row. Columns and rows are trivial, a column identifies a field and has a specific data type (name, email, birth) and a row identifies a table entry (person that contains a name, email and birth).</p>
-<p>Also, there are foreign keys, it&rsquo;s purpose is to relate to another database table; this foreign key is unique in it&rsquo;s own table, but can be repeated where you use it as a foreign key.</p>
-<p>It&rsquo;s possible to use the same table keys as foreign keys to make relations inside the same table.</p>
-<h2 id="sql-basics">SQL basics</h2>
-<p>It&rsquo;s actually a hybrid language, basically 4 types of languages in one:</p>
-<ul>
-<li>Data Query Language (DQL)<ul>
-<li>Used to query the database for information.</li>
-<li>Get information that is already stored there.</li>
-</ul>
-</li>
-<li>Data Definition Language (DDL)<ul>
-<li>Used for defining database schemas.</li>
-</ul>
-</li>
-<li>Data Control Language (DCL)<ul>
-<li>Used for controlling access to the data in the database.</li>
-<li>User and permissions management.</li>
-</ul>
-</li>
-<li>Data Manipulation Language (DML)<ul>
-<li>Used for inserting, updating and deleting data from a database.</li>
-</ul>
-</li>
-</ul>
-<h3 id="queries">Queries</h3>
-<p>A set of instructions given to the RDBMS (written in SQL) that tell the RDBMS what information you want it to retrieve. Instead of getting the whole database, retrieve only a bit of information that you need.</p>
-<p>Also, SQL keywords can be either lower or upper case, but it&rsquo;s <strong>convention to use upper case</strong>. And <strong>queries are ended by a semi-colon</strong>.</p>
-<h4 id="data-types">Data types</h4>
-<p>Just some SQL data types (for more: <a href="https://dev.mysql.com/doc/refman/8.0/en/data-types.html">MySQL 8.0 Reference Manual: Chapter 11 Data Types</a>, the notation is <code>DATATYPE(SIZE(,SIZE))</code>:</p>
-<ul>
-<li><code>INT</code>: integer numbers.</li>
-<li><code>DECIMAL(M,N)</code>: decimal numbers.</li>
-<li><code>VARCHAR(N)</code>: string of text of length N.</li>
-<li><code>BLOB</code>: Binary Large Object, stores large data.</li>
-<li><code>DATE</code>: YYYY-MM-DD.</li>
-<li><code>TIMESTAMP</code>: YYYY-MM-DD HH:MM:SS.</li>
-</ul>
-<h4 id="basic-management-of-tables">Basic management of tables</h4>
-<p>To <strong>create a table</strong>, the basic syntax is <code>CREATE TABLE tablename (column1 datatype constraint, column2 datatype constraint, ...)</code>, where a constraint could be (for more: <a href="https://dev.mysql.com/doc/refman/8.0/en/create-table.html">MySQL 8.0 Reference Manual: 13.1.20 CREATE TABLE Statement</a>):</p>
-<ul>
-<li><code>NOT NULL</code>: can&rsquo;t have a <code>NULL</code> value.</li>
-<li><code>UNIQUE</code>: all values are unique.</li>
-<li><code>PRIMARY KEY</code>: uniquely identifies each row.</li>
-<li><code>FOREIGN KEY</code>: uniquely identifies a row in another table.</li>
-<li><code>CHECK expresion</code>: satisfy a special condition (<code>expresion</code>).</li>
-<li><code>DEFAULT value</code>: if no value is specified use value <code>value</code>.</li>
-<li><code>INDEX</code>: to create and retrieve data from the database very quickly.</li>
-</ul>
-<p>Get the <strong>table structure</strong> with <code>DESCRIBE tablename</code> and delete it with <code>DROP TABLE tablename</code>. <strong>Add columns</strong> to the table with <code>ALTER TABLE tablename ADD column DATATYPE(N,M)</code>, similar syntax to <strong>delete a specific column</strong> <code>ALTER TABLE tablename DRORP COLUMN column</code>.</p>
-<p><strong>Add entries</strong> to the table with <code>INSERT INTO tablename VALUES(value1, value2, ...)</code> where all the fields must be specified, or <code>INSERT INTO tablename(column1, column2) VALUES(value1, value2)</code> to just add some fields to the new entry. While at it, (all) the table content can be fetched with <code>SELECT * FROM tablename</code>.</p>
-<p>Basic <strong>Updating of entries</strong> with <code>UPDATE tablename SET expression1 WHERE expression2</code>, where <code>expression1</code> could be <code>column = value2</code> and <code>expression2</code> could be <code>column = value1</code>, meaning that the value of <code>column</code> will be changed from <code>value1</code> to <code>value2</code>. Note that the expressions are not limited by <code>column = value</code>, and that the <code>column</code> has to be the same, it would be any expression. Also, this is really extensive as <code>SET</code> can set multiple variables and <code>WHERE</code> take more than one condition by chaining conditions with <code>AND</code>, <code>OR</code> and <code>NOT</code> keywords, for example.</p>
-<h5 id="on-delete-statement">ON DELETE statement</h5>
-<p>When an entry needs to be updated somehow based on a modification on a foreign key. If two tables are related to each other, if something is deleted on one end, update the other end in some way.</p>
-<p>For example on creation of a table, on the specification of a foreign key: <code>CREATE TABLE tablename (..., FOREIGN KEY(column) REFERENCES othertable(othertablecolumn) ON DELETE something)</code>. That something could be <code>SET NULL</code>, <code>CASCADE</code>, etc..</p>
-<h4 id="select-queries">SELECT queries</h4>
-<p>Instead of doing <code>SELECT * FROM tablename</code>, which gets all the data from a table, more complex <code>SELECT</code> queries can be implemented, such as <code>SELECT column FROM tablename</code> to only get all data from one column of the table. Append <code>LIMIT N</code> to limit the query to <code>N</code> entries. Append <code>WHERE condition</code> to meet a custom condition.</p>
-<p>Other statements that can be used in conjunction with <code>SELECT</code> are <code>ORDER BY column ASC|DESC</code>, <code>SELECT DISTINCT</code>, <code>MIN(column)</code>, <code>MAX(column)</code>, <code>COUNT(column)</code>, <code>AVG(column)</code>, <code>SUM(column)</code>, <code>LIKE</code> and more. For more, visit <a href="https://dev.mysql.com/doc/refman/8.0/en/select.html">MySQL 8.0 Reference Manual: 13.2.10 SELECT Statement</a>.</p>
-<p>MySQL uses regular expressions (regex) like pattern matching, some wildcards that can be used with the <code>LIKE</code> statement are:</p>
-<ul>
-<li><code>%</code>: zero or more characters.</li>
-<li><code>_</code>: a single character.</li>
-<li><code>[]</code>: any single character within the brackets.</li>
-<li><code>^</code>: any character not in the brackets.</li>
-<li><code>-</code>: a range of characters.</li>
-</ul>
-<p>An extended regex can be used with the statement <code>REGEX_LIKE(expression)</code>; <code>REGEXP</code> and <code>RLIKE</code> are synonyms for <code>REGEX_LIKE</code>. For more: <a href="https://dev.mysql.com/doc/refman/8.0/en/pattern-matching.html">MySQL 8.0 Reference Manual: 3.3.4.7 Pattern Matching</a>.</p>
-<h4 id="unions">Unions</h4>
-<p>A specialized SQL operator that is used to combine multiple <code>SELECT</code> statements into one. The basic syntax is <code>SELECT ... UNION SELECT ...</code>, where <code>...</code> is a whole <code>SELECT</code> statement; there can be any amount of unions. There are some rules that apply when doing unions, such as having the same amount of columns on both statements and being of the same data type.</p>
-<h4 id="joins">Joins</h4>
-<p>Used to combine rows from two or more tables based on a related column between them. Basic syntax is <code>SELECT table1.column1, ..., table2.column1, ... FROM table(1|2) JOIN table(1|2) ON table1.common_column = table2.common_column</code>, where the table specified in the <code>FROM</code> statement is called the &ldquo;left&rdquo; table, where the one in the <code>JOIN</code> statement is the &ldquo;right&rdquo; table. For more: <a href="https://dev.mysql.com/doc/refman/8.0/en/join.html">MySQL 8.0 Reference Manual: 13.2.10.2 JOIN Clause</a>.</p>
-<p>There are different types of SQL JOINs:</p>
-<ul>
-<li><code>(INNER) JOIN</code>: returns records that have matching values in both tables.</li>
-<li><code>LEFT (OUTER) JOIN</code>: returns all records from the left table, and the matched records from the right table.</li>
-<li><code>RIGHT (OUTER) JOIN</code>: returns all records from the right table, and the matched records from the left table.</li>
-<li><code>FULL (OUTER) JOIN</code>: returns all records when there is a match in either left or right table.</li>
-</ul>
-<div class="img-grid">
-<p><img alt="INNER JOIN" src="images/b/notes/sql/img_innerjoin.gif">
-<img alt="LEFT JOIN" src="images/b/notes/sql/img_leftjoin.gif">
-<img alt="RIGHT JOIN" src="images/b/notes/sql/img_rightjoin.gif">
-<img alt="FULL OUTER JOIN" src="images/b/notes/sql/img_fulljoin.gif"></p>
-</div>
-<h4 id="nested-queries">Nested queries</h4>
-<p>A query composed of multiple select statements to get a specific piece of information. This is self explanatory, you do a <code>SELECT</code> query somewhere inside another one, for example <code>SELECT ... IN (SELECT ...)</code>, where the nesting is occurring inside the parenthesis after the <code>IN</code> statement.</p>
-<p>A nesting isn&rsquo;t constrained to the <code>IN</code> statement, it can appear anywhere, for example in a <code>WHERE</code> statement: <code>SELECT ... WHERE something = (SELECT ...)</code>.</p>
-<h4 id="triggers">Triggers</h4>
-<p>A block of SQL code that will define a certain action that will happen when a specific operation is performed on the database. It is <strong>recommended to change the <code>DELIMITER</code> temporarily from semi-colon to something else</strong> (since we need to use semi-colon to end the trigger) while the trigger is created. The basic syntax is <code>CREATE TRIGGER trigername triggertime triggerevent ON tablename FOR EACH ROW triggerorder triggerbody</code>. For more: <a href="https://dev.mysql.com/doc/refman/8.0/en/create-trigger.html">MySQL 8.0 Reference Manual: 13.1.22 CREATE TRIGGER Statement</a> and <a href="https://dev.mysql.com/doc/refman/8.0/en/trigger-syntax.html">MySQL 8.0 Reference Manual: 25.3.1 Trigger Syntax and Examples</a>.</p>
-<h4 id="entity-relationship-diagrams-erd">Entity Relationship Diagrams (ERD)</h4>
-<p>When designing a database it&rsquo;s important to define a <strong>database schema</strong> which is just a definition of all the different tables and their attributes that are going to live inside the database. So, basically, an ERD diagram is a diagram that consists of text, symbols and shapes that are combined to create a relationship model.</p>
-<p>The diagram consists of:</p>
-<ul>
-<li><strong>Entity</strong>: a square with the name of the entity inside it.</li>
-<li><strong>Attributes</strong>: ovals with the name of the attributes inside it; an attribute defines specific pieces of information about an entity (columns).</li>
-<li><strong>Primary key</strong>: same as with attributes but with name underlined; the primary key uniquely identifies the entity.</li>
-<li><strong>Composite attribute</strong>: an attribute that consists on one or more (sub-)attributes.</li>
-<li><strong>Multi-valued attribute</strong>: oval with another oval inside it and the name of the attribute.</li>
-<li><strong>Derived attribute</strong>: dotted oval; this attribute can be derived from other attributes from the entity.</li>
-<li><strong>Relationship</strong>: a diamond with the relationship name in it, for the connections a single line (partial participation) or a doubled line (total participation); it denotes how two or more attributes are related to each other; all members must participate in the relationship.</li>
-<li><strong>Relationship attribute</strong>: denoted like a normal attribute, but it&rsquo;s child of a relationship; it defines what attributes exists because of the relationship, it&rsquo;s not stored in any of the entities related, but on the relationship object itself.</li>
-<li><strong>Relationship cardinality</strong>: denoted with a number on the line connecting the relationship to the entity; detones the number of instances of an entity from a relation that can be associated with the relation.</li>
-<li><strong>Weak entity</strong>: rectangle inside a rectangle with its name inside; it cannot be uniquely identified by its attributes alone.</li>
-<li><strong>Weak entity&rsquo;s primary key</strong>: oval with its text underlined, but the line is dotted.</li>
-<li><strong>Identifying relationship</strong>: a diamond inside a diamond with its name inside; a relationship that serves to uniquely identify the weak entity.</li>
-</ul>
-<p><img alt="ERD example taken from wikipedia" src="images/b/notes/sql/erd_example.png"></p>
-
- <hr>
- <div class="article-info">
- <p>By David Luévano</p>
- <p>Created: Tue, Mar 02, 2021 @ 14:35 UTC</p>
- <p>Modified: Sun, Jun 06, 2021 @ 03:41 UTC</p>
- <div class="article-tags">
- <p>Tags:
-<a href="https://blog.luevano.xyz/tag/@english.html">english</a>, <a href="https://blog.luevano.xyz/tag/@notes.html">notes</a> </p>
-</div>
-
- </div>
- </main>
-
- <footer>
- <span>
- <i class="fas fa-address-card" alt="Contact"></i>
- <a href="https://luevano.xyz/contact.html">Contact</a>
- </span>
-
- <span>
- <i class="fas fa-donate" alt="Donate"></i>
- <a href="https://luevano.xyz/donate.html">Donate</a>
- </span>
-
- <span>
- <i class="fas fa-rss" alt="RSS"></i>
- <a target="_blank" href="https://blog.luevano.xyz/rss.xml">RSS</a>
- </span>
-
- <br>
- <span class="created-with">
- <i class="fas fa-hammer" alt="Hammer"></i>
- Created with <a href="https://github.com/luevano/pyssg">pyssg</a>
- </span>
-
- <br>
- <span class="copyright">
- Copyright <i class="far fa-copyright" alt="Copyright"></i> 2021 David Luévano Alvarado
- </span>
- </footer>
- </body>
-</html> \ No newline at end of file