]> begriffs open source - ai-pg/blob - full-docs/html/tutorial-sql-intro.html
Include links to all subsection html pages, with shorter paths too
[ai-pg] / full-docs / html / tutorial-sql-intro.html
1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>2.1. Introduction</title><link rel="stylesheet" type="text/css" href="stylesheet.css" /><link rev="made" href="pgsql-docs@lists.postgresql.org" /><meta name="generator" content="DocBook XSL Stylesheets Vsnapshot" /><link rel="prev" href="tutorial-sql.html" title="Chapter 2. The SQL Language" /><link rel="next" href="tutorial-concepts.html" title="2.2. Concepts" /></head><body id="docContent" class="container-fluid col-10"><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="5" align="center">2.1. Introduction</th></tr><tr><td width="10%" align="left"><a accesskey="p" href="tutorial-sql.html" title="Chapter 2. The SQL Language">Prev</a> </td><td width="10%" align="left"><a accesskey="u" href="tutorial-sql.html" title="Chapter 2. The SQL Language">Up</a></td><th width="60%" align="center">Chapter 2. The <acronym class="acronym">SQL</acronym> Language</th><td width="10%" align="right"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="10%" align="right"> <a accesskey="n" href="tutorial-concepts.html" title="2.2. Concepts">Next</a></td></tr></table><hr /></div><div class="sect1" id="TUTORIAL-SQL-INTRO"><div class="titlepage"><div><div><h2 class="title" style="clear: both">2.1. Introduction <a href="#TUTORIAL-SQL-INTRO" class="id_link">#</a></h2></div></div></div><p>
3     This chapter provides an overview of how to use
4     <acronym class="acronym">SQL</acronym> to perform simple operations.  This
5     tutorial is only intended to give you an introduction and is in no
6     way a complete tutorial on <acronym class="acronym">SQL</acronym>.  Numerous books
7     have been written on <acronym class="acronym">SQL</acronym>, including <a class="xref" href="biblio.html#MELT93" title="Understanding the New SQL">[melt93]</a> and <a class="xref" href="biblio.html#DATE97" title="A Guide to the SQL Standard">[date97]</a>.
8     You should be aware that some <span class="productname">PostgreSQL</span>
9     language features are extensions to the standard.
10    </p><p>
11     In the examples that follow, we assume that you have created a
12     database named <code class="literal">mydb</code>, as described in the previous
13     chapter, and have been able to start <span class="application">psql</span>.
14    </p><p>
15     Examples in this manual can also be found in the
16     <span class="productname">PostgreSQL</span> source distribution
17     in the directory <code class="filename">src/tutorial/</code>.  (Binary
18     distributions of <span class="productname">PostgreSQL</span> might not
19     provide those files.)  To use those
20     files, first change to that directory and run <span class="application">make</span>:
21
22 </p><pre class="screen">
23 <code class="prompt">$</code> <strong class="userinput"><code>cd <em class="replaceable"><code>...</code></em>/src/tutorial</code></strong>
24 <code class="prompt">$</code> <strong class="userinput"><code>make</code></strong>
25 </pre><p>
26
27     This creates the scripts and compiles the C files containing user-defined
28     functions and types.  Then, to start the tutorial, do the following:
29
30 </p><pre class="screen">
31 <code class="prompt">$</code> <strong class="userinput"><code>psql -s mydb</code></strong>
32 <code class="computeroutput">
33 ...
34 </code>
35 <code class="prompt">mydb=&gt;</code> <strong class="userinput"><code>\i basics.sql</code></strong>
36 </pre><p>
37
38     The <code class="literal">\i</code> command reads in commands from the
39     specified file. <code class="command">psql</code>'s <code class="literal">-s</code> option puts you in
40     single step mode which pauses before sending each statement to the
41     server.  The commands used in this section are in the file
42     <code class="filename">basics.sql</code>.
43    </p></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="tutorial-sql.html" title="Chapter 2. The SQL Language">Prev</a> </td><td width="20%" align="center"><a accesskey="u" href="tutorial-sql.html" title="Chapter 2. The SQL Language">Up</a></td><td width="40%" align="right"> <a accesskey="n" href="tutorial-concepts.html" title="2.2. Concepts">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. The <acronym class="acronym">SQL</acronym> Language </td><td width="20%" align="center"><a accesskey="h" href="index.html" title="PostgreSQL 18.0 Documentation">Home</a></td><td width="40%" align="right" valign="top"> 2.2. Concepts</td></tr></table></div></body></html>