Difference between revisions of "Oracle - Introduction"
Line 11: | Line 11: | ||
<p>A relational database is a named collection of tables and other associated database objects (e.g., indexes, screens, menus, etc.). Typically a database management system (DBMS) can support more than one database simultaneously (or in ANSI-1989 terms, more than one environment). This allows the user to organise their tables into different databases if required. For example, you could have a different database for each module.</p> | <p>A relational database is a named collection of tables and other associated database objects (e.g., indexes, screens, menus, etc.). Typically a database management system (DBMS) can support more than one database simultaneously (or in ANSI-1989 terms, more than one environment). This allows the user to organise their tables into different databases if required. For example, you could have a different database for each module.</p> | ||
<p>The following tables are used for illustrative purposes throughout the handout:</p> | <p>The following tables are used for illustrative purposes throughout the handout:</p> | ||
− | < | + | <font face="verdana" color="red"> |
− | EMP(<u>EMPNO</u>, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) | + | <table> |
− | DEPT(<u>DEPTNO</u>, DNAME, LOC) | + | <tr><td>EMP(<u>EMPNO</u>, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO)</td></tr> |
− | SALGRADE(<u>GRADE</u>, LOSAL, HISAL) | + | <tr><td>DEPT(<u>DEPTNO</u>, DNAME, LOC)</td></tr> |
− | CUSTOMER(CNO, ORDERDATE, NAME, CITY, COUNTRY, PNO, DESCRIPTION, QTY) | + | <tr><td>SALGRADE(<u>GRADE</u>, LOSAL, HISAL)</td></tr> |
− | </ | + | <tr><td>CUSTOMER(CNO, ORDERDATE, NAME, CITY, COUNTRY, PNO, DESCRIPTION, QTY)</td></tr> |
+ | </table> | ||
+ | </font> | ||
<p>Where: | <p>Where: | ||
<ul> | <ul> |
Revision as of 11:26, 9 January 2016
Introduction
The purpose of this module is to teach you about databases, in particular databases based on the relational model. The relational model is widely used in industry and many vendors provide relational products. Oracle, Microsoft Access and Visual FoxPro are three such products. SQL (Structure Query Language) is regarded as being the de facto query language for relational databases and this module uses Oracle as a vehicle for teaching SQL.
SQL is subject to a number of standards: ANSI X3.135 - 1989; SQL2 (or SQL92) and SQL3 (SQL99) and recently SQL4 (2003). The current version of Oracle (version 12c) supports most of the SQL92 standard. It does also offer some support for objects, which is in the SQL99
As you get more familiar with the product, you will come to realise that a lot of the commands detailed in this booklet could have been more easily entered/executed using the power tools. The purpose of the module is to teach you SQL which is standard across many relational products, e.g., Sysbase, Ingres, DB2. The Oracle Developer tools however are proprietary and every product has different tools. The commands in this booklet however can be executed on most relational platforms with little amendment; this would not be true if the toolset were used.
The Sample Relational Database
A relational database is a named collection of tables and other associated database objects (e.g., indexes, screens, menus, etc.). Typically a database management system (DBMS) can support more than one database simultaneously (or in ANSI-1989 terms, more than one environment). This allows the user to organise their tables into different databases if required. For example, you could have a different database for each module.
The following tables are used for illustrative purposes throughout the handout:
EMP(EMPNO, ENAME, JOB, MGR, HIREDATE, SAL, COMM, DEPTNO) |
DEPT(DEPTNO, DNAME, LOC) |
SALGRADE(GRADE, LOSAL, HISAL) |
CUSTOMER(CNO, ORDERDATE, NAME, CITY, COUNTRY, PNO, DESCRIPTION, QTY) |
Where:
- EMP contains information about the employees of a sample company
- DEPT contains information about the departments in the company
- SALGRADE groups salary ranges into grades
- CUSTOMER details information about the company's customers