1 / 8

PostgreSQL

PostgreSQL . History Homework objectives Using PostgreSQL @ TCU. Sybase 1990’s. Research. Oracle 1980’s. DB-2 1990’s. SQLserver 1990’s. Model R. Ilustra 1980’s. Ingres DB 1970’s. Ingres DB 1970’s. Posgres 1990’s. Theory T. Codd (IBM) Teaching C. Date (IBM)

villette
Télécharger la présentation

PostgreSQL

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. PostgreSQL History Homework objectives Using PostgreSQL @ TCU

  2. Sybase 1990’s Research Oracle 1980’s DB-2 1990’s SQLserver 1990’s Model R Ilustra 1980’s Ingres DB 1970’s Ingres DB 1970’s Posgres 1990’s Theory T. Codd (IBM) Teaching C. Date (IBM) Programming M. Stonebraker (UC-B) Businessman L. Ellison (Oracle) PosgreSQL 1996 Open Software (fine breed) From Ingres to PostgreSQL Commercial

  3. Source: http://www.thomasedison.com/ "Genius is 1% inspiration and 99% perspiration." Thomas Alva Edison(1847-1931) Homework Objectives Persistence From Latin: __________ per- "thoroughly” and sistere ”maintain existence” Be there & try continuously :-) “Be courageous! Whatever setbacks America has encountered, it has always emerged as a stronger and more prosperous nation....” Thomas Alva Edison Patience & Patented 1,100 inventions in 60 years Tested Over 3000 Filaments before he came Up with His version Of a Practical Light Bulb

  4. Using PosgreSQL at TCU • Login in to Riogrande and psql sanchez% ssh riogrande.cs.tcu.edu sanchez@riogrande.cs.tcu.edu's password: ******** Last login: Mon Oct 10 19:54:57 2005 from tt3322.mat.tcu.edu [sanchez@riogrande ~]$ psql Welcome to psql 8.0.3, the PostgreSQL interactive terminal. • Use a template1 the first time [sanchez@riogrande ~]$ psql

  5. Using PosgreSQL at TCU • Help command in terminal psql • \h for SQL commands CREATE [ database | index | table | trigger | schema | rule ], COMMENT, COMMIT, ROLLBACK INSERT, SELECT, SELECT INTO FETCH • \? For system commands (i.e. Non SQL) \q quit psql \c[onnect] [DBNAME|- [USER]] connect to new database (currently "sanchez") • Create a database sanchez-# CREATE DATABASE • Fittings database • Employee database

  6. Using PosgreSQL • Insert data • 10 rows per table • Do some basic SQL • SELECT FROM

  7. Creating Tables • CREATE [ [ GLOBAL | LOCAL ] { TEMPORARY | TEMP } ] TABLE table_name ( { column_namedata_type [ DEFAULT default_expr ] [ column_constraint [ ... ] ] | table_constraint | LIKE parent_table [ { INCLUDING | EXCLUDING } DEFAULTS ] } [, ... ])[ INHERITS ( parent_table [, ... ] ) ][ WITH OIDS | WITHOUT OIDS ][ ON COMMIT { PRESERVE ROWS | DELETE ROWS | DROP } ] where column_constraintis: [ CONSTRAINT constraint_name ]{ NOT NULL | NULL | UNIQUE | PRIMARY KEY | CHECK (expression) | REFERENCES reftable [ ( refcolumn ) ] [ MATCH FULL | MATCH PARTIAL | MATCH SIMPLE ] [ ON DELETE action ] [ ON UPDATE action ] }[ DEFERRABLE | NOT DEFERRABLE ] [ INITIALLY DEFERRED | INITIALLY IMMEDIATE ] Sources: http://www.cs.nott.ac.uk/TSG/manuals/databases/postgres/tutorial/ http://www.postgresql.org/docs/7.4/interactive/sql-createtable.html http://archives.postgresql.org/pgsql-docs/2001-04/msg00069.php

  8. Using SELECT SELECT [ALL|DISTINCT] { * | expr_1 [AS c_alias_1] [, ... [, expr_k [AS c_alias_k]]]} FROM table_name_1 [t_alias_1] [, ... [, table_name_n [t_alias_n]]] [WHERE condition] [GROUP BY name_of_attr_i [,... [, name_of_attr_j]] [HAVING condition]] [{UNION [ALL] | INTERSECT | EXCEPT} SELECT ...] [ORDER BY name_of_attr_i [ASC|DESC] Sources: http://www.cs.nott.ac.uk/TSG/manuals/databases/postgres/tutorial/ http://www.postgresql.org/docs/7.4/interactive/sql-createtable.html http://archives.postgresql.org/pgsql-docs/2001-04/msg00069.php

More Related