SQL Programming

SQL ProgrammingShort Description
SQL Programming. Example schema:. CREATE TABLE Student (SID INTEGER PRIMARY KEY, … Use SQL together with a general-purpose programming language: …

Website: infolab.stanford.edu | Filesize: 96kb

Content
CS145 Lecture Notes #10
SQL Programming
Example schema:
CREATE TABLE Student (SID INTEGER PRIMARY KEY,
name CHAR(30),
age INTEGER,
GPA FLOAT);
CREATE TABLE Take (SID INTEGER,
CID CHAR(10),
PRIMARY KEY(SID, CID));
CREATE TABLE Course (CID CHAR(10) PRIMARY KEY,
title VARCHAR(100) UNIQUE);
Motivation
Pros and cons of SQL:
Very high-level, possible to optimize
Not tuned to support general-purpose computation
Oracle as a calculator? SELECT 142857*3 FROM DUAL;
Strictly less expressive than general-purpose languages
SQL2 has no recursion and cannot even compute factorial!
Solutions:
Augment SQL: Oracle’s PL/SQL
Use SQL together with a general-purpose programming language:
embedded SQL, dynamic SQL
Oracle PL/SQL
Basics
Rough form of a PL/SQL program:
DECLARE
BEGIN
END;
.
RUN;
DECLARE section is optional
. and RUN end the program and execute it
Jun Yang 1 CS145 Spring 1999…

Get the file Download here

AddThis Social Bookmark Button
Related Books:
  • Programming in oXML
  • Language Oriented Programming The Next Programming Paradigm
  • TinyOS Programming
  • TinyOS Programming
  • An Overview of the C Programming Language
  • Programming in Linux Prerequisites - Basic Operating Systems …
  • Java Programming Language SL-275
  • AVR910 In-System Programming

  • Related Searches:



    Comments

    Leave a Reply