-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathprimer.html
More file actions
112 lines (84 loc) · 6.34 KB
/
primer.html
File metadata and controls
112 lines (84 loc) · 6.34 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<link href="https://www.owencampbell.me.uk/images/favicon/favicon.ico" rel="icon">
<title>SQL for Python Programmers</title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<link href="https://www.owencampbell.me.uk/theme/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="/sql_python_tutorial/static/styles.css">
</head>
<body>
<div class="fixed-top">
<nav class="navbar navbar-expand-md navbar-dark bg-dark">
<a class="navbar-brand" href="#">SQL for Python Programmers</a>
<button class="navbar-toggler" type="button" data-toggle="collapse" data-target="#navbarContent" aria-controls="navbarContent" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
</button>
<div class="collapse navbar-collapse" id="navbarContent">
<div class="navbar-nav">
<a class="nav-item nav-link" href="/sql_python_tutorial/"><i class="fa fa-home fa-fw" aria-hidden="true" title="home"></i> Home</a>
<a class="nav-item nav-link mr-auto" href="/sql_python_tutorial/chapters/"><i class="fa fa-book fa-fw" aria-hidden="true" title="contents"></i> Contents</a>
<a class="nav-item nav-link" href="/sql_python_tutorial/pages/intro.html"><i class="fa fa-info-circle fa-fw" aria-hidden="true" title="introduction"></i> Introduction</a>
<a class="nav-item nav-link" href="/sql_python_tutorial/pages/howto.html"><i class="fa fa-gears fa-fw" aria-hidden="true" title="how to"></i> How To</span></a>
<a class="nav-item nav-link" href="/sql_python_tutorial/pages/primer.html"><i class="fa fa-database fa-fw" aria-hidden="true" title="primer"></i> Primer</a>
</div>
<div class="navbar-nav ml-auto">
<a class="btn btn-link btn-lg" href="https://www.linkedin.com/in/owencampbell" title="linkedin"><i class="fa fa-linkedin" aria-hidden="true"></i></a>
<a class="btn btn-link btn-lg" href="http://github.com/meatballs" title="github"><i class="fa fa-github" aria-hidden="true"></i></a>
</div>
</div>
</nav>
</div>
<main role="main" class="container">
<h1><i class="fa fa-database" aria-hidden="true"></i> Primer</h1>
<h2>1. What Is A Relational Database?</h2>
<p>A relational database organises a collection of data into tables. A table is a two-dimensional structure with rows and columns. Rows are often also referred to as records and columns as fields or attributes.</p>
<p>Relationships can be established between tables by specifying how a value in a column of one table matches the values in a column of a second table.</p>
<h2>2. What IS A DBMS?</h2>
<p>A Database Management System (DBMS) is a software program used to manage and maintain a database.</p>
<p>Strictly speaking, a DBMS for a relational database is called a Relational Database Management System (RDBMS), but use of the shorter from is widespread.</p>
<p>Typically, a DBMS will use its own proprietary format for persisting databases (e.g. to disk) and provde a standard interface for interacting with those files.</p>
<h2>3. How Do DBMSs Differ?</h2>
<p>A client-server DBMS typically manages the databases on its server side and provides an SQL interface via client software. These may be installed on entirely separate computers with a network connection between them.</p>
<p>An embedded DBMS provides both interface and database management in the same software package. Typically, both the software and any database files reside on the same computer.</p>
<h2>4. What is SQL?</h2>
<p>Structured Query Language (SQL) is a language for managing data within a relational database. It is a standard adopted by both the American National Standard Institute (ANSI) and the International Organisation for Standardisation (ISO).</p>
<p>Any modern DBMS will provide an SQL interface for interaction with a database under its management, regardless of how that database is persisted.</p>
<h2>5. What DBMS Can I Use?</h2>
<p>There are many relational DBMSs on the market today. Here are some of the more well known:</p>
<h3>5.1. Client-Server</h3>
<ul>
<li><a href="https://postgresql.org">PostgreSQL</a> (Open Source)</li>
<li><a href="https://www.mysql.com">MySQL</a> (Open Source)</li>
<li><a href="https://www.oracle.com/database/">Oracle</a> (Commercial)</li>
<li><a href="https://microsoft.com/en-us/sql-server/">Microsoft SQL Server</a>
(Commercial)</li>
</ul>
<h3>5.2. Embedded</h3>
<ul>
<li><a href="https://sqlite.org">SQLite</a> (Open Source)</li>
<li><a href="https://office.microsoft.com/access/">Microsoft Access</a> (Commercial)</li>
</ul>
<h2>6. What Else Do I Need To Know?</h2>
<p>Although any modern DBMS will implement standard SQL, all of them go way beyond the standard to provide more advanced capabilities. Unfortunately, those enhancements are not standardised and will not port from one DBMS to another.</p>
<p>For example, here is <a href="http://www.owencampbell.me.uk/oracle-update-statements.html">an article</a> written by the author of this tutorial on how to update the contents of one table based on the content of another in an Oracle database. None of the techniques described in that article would execute successfully on any other DBMS.</p>
</main>
<footer class="footer d-none d-md-block">
<div class="container">
<span class="text-muted">
<p class="small">
This tutorial was inspired by a talk given by <a href="https://twitter.com/waveform80">Dave Jones</a> at <a href="https://twitter.com/pythonnw">Python North West</a>.
The flights database, and much of the SQL code, is taken, with grateful thanks,
from the <a href="https://waveform.org.uk/presentations/sql">slides</a> and
<a href="https://github.com/waveform80/presentations">source code</a> for that talk.
<br/>
Many thanks also to <a href="https://vknight.org/">Dr. Vincent Knight</a> of <a href="http://www.cardiff.ac.uk">Cardiff University</a> for the use of his
<a href="https://vknight.org/gt/">Game Theory Course Notes</a> and their <a href="https://github.com/drvinceknight/gt">source code</a>.
</p>
</span>
</div>
</footer>
</body>
</html>