THE RELATIONAL DATA BASE (RDB) AND STRUCTURED QUERY LANGUAGE (SQL) Based on relational theory Relational model first introduced by Dr. E.F Codd in early 70s First prototype system developed by IBM in the mid 70s First commercial version from ORACLE in 1979 History:
THE RELATIONAL DATA BASE (RDB) AND STRUCTURED QUERY LANGUAGE (SQL) RDBs are now the standard for data storage SQL is the standard for accessing and manipulating RDBs SQL is an ANSI standard in the public domain SQL is implemented by many vendors including all major data base systems Current status:
Description of an RDB: Data stored in related tables Tables made up of rows and columns Rows in are uniquely identified by a primary key Rows in different tables are related by a foreign key
Non-procedural Works on an entire set of data at a time Has English like syntax Very concise and powerful Combines functionality of the data step and several procedures into a single statement Description of SQL:
DNAMELOCDEPTNO ACCOUNTINGNEW YORK10 RESEARCHDALLAS20 SALESCHICAGO30 OPERATIONSBOSTON40 EMPNOENAMEJOBMGRHIREDATESALDEPTNOCOMM 7369SMITHCLERK790217DEC80$ ALLENSALESMAN769820FEB81$1,60030$ WARDSALESMAN769822FEB81$1,25030$ JONESMANAGER783902APR81$2, MARTINSALESMAN769828SEP81$1,25030$1, BLAKEMANAGER783901MAY81$2, CLARKMANAGER783909JUN81$2, SCOTTANALYST756619APR87$3, KINGPRESIDENT.17NOV81$5, TURNERSALESMAN769808SEP81$1,50030$0 7876ADAMSCLERK778823MAY87$1, JAMESCLERK769803DEC81$ FORDANALYST756603DEC81$3, MILLERCLERK778223JAN82$1, EMP Table (Detail table) DEPT Table (Mater table) 1 * A ONE-TO-MANY RELATIONSHIP PK FK
SELECT variable list FROM table list; STRUCTURE OF SQL SELECT STATEMENT SYNTAX SELECT variable list FROM table list WHERE condition; SELECT variable list FROM table list WHERE condition ORDER BY variable list; SELECT variable list FROM table list WHERE condition GROUP BY variable list HAVING condition ORDER BY variable list;