SlideServe
Menu
Préférences
© SlideServe · v2026

Programming and SQL

redford avatar
9 diapositives · 262 Views · Aug 13, 2014

Programming and SQL. Edel Sherratt. Motivation 1: Integrity Checking. Sometimes primary keys and foreign keys are not enough For example, they do not enforce mandatory participation on the many side of a one-to-many relationship So additional facilities are needed.

Programming and SQL - slide 1
01 / 9Programming and SQL
1 / 17

Télécharger la présentation

Programming and SQL
Une image / un lien ci-dessous est fourni (tel quel) pour télécharger la présentation

Politique de téléchargement : le contenu du site vous est fourni TEL QUEL pour votre information et votre usage personnel ; il ne peut être vendu, concédé sous licence ni partagé sur d’autres sites sans l’accord de son auteur.Le contenu vous est fourni TEL QUEL, pour votre information et votre usage personnel uniquement. Téléchargez la présentation en cliquant sur ce lien. Lors du téléchargement, si vous ne parvenez pas à télécharger une présentation, l’éditeur a peut-être supprimé le fichier de son serveur.Pendant le téléchargement, si vous ne parvenez pas à obtenir une présentation, le fichier a peut-être été supprimé par l’éditeur.

F I N

Plus de contenu associé

Transcription de la présentation
  1. Programming and SQL Edel Sherratt

  2. Motivation 1: Integrity Checking • Sometimes primary keys and foreign keys are not enough • For example, they do not enforce mandatory participation on the many side of a one-to-many relationship • So additional facilities are needed

  3. Integrity Checking (from before)

  4. Motivation 2: Impedance mismatch • Mismatches between application programming language and SQL • SQL handles rows of data; a language like C or Java handles only one row at a time • SQL is declarative; C is procedural; Java is object oriented and imperative • There are usually mismatches between SQL and programming language data types

  5. SQL/PSM (Persistent Stored Modules) • Extensions to SQL • part of the SQL standard: SQL/PSM (ANSI/ISO/IEC 9075-4:1999) • But not fully implemented • Partly because proprietary implementations were developed before the standard

  6. SQL Programming Languages • DBMS-specific SQL procedural languages: • Oracle: PL/SQL • Sybase and Microsoft: T-SQL • Informix: SPL • PostgreSQL: PL/pgSQL

  7. Oracle Manual, v10 Using Oracle PL/SQL to improve performance

  8. SQL Programming Language Constructs • Functions and procedures • IF, WHILE • Assignment: both the usual kind and also assignment that results from SQL queries • Cursors: allow the rows of a query to be handled one at a time • Exception handling • Triggers

  9. To find out more • The PostgreSQL reference manual: http://www.postgresql.org/docs/9.1/static/index.htmlSee section V, Server Programming • Oracle PL/SQL: http://www.oracle.com/technetwork/database/features/plsql/index.html • Connolly and Begg, Database Systems, fifth ed., Chapter 8: Advanced SQL