Oracle Tutorial
|
|
|
|
| Articles Reviews Oracle | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Written by Bogdan V | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Friday, 01 September 2006 | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Page 1 of 15
The Oracle9i database provides many useful and powerful features. Many of the features are incorporated at the SQL level. SQL (pronounced “sequel”) has been adopted by most relational database management systems (RDBMS). The American National Standards Institute (ANSI) has been refining standards for the SQL language for the past 20 years. Nowadays there are many online web hosting providers which are fulfilling customerís requirements according to their need such as by domain registration, providing high speed, giving storage space and so on. These web host providers also give web design services and once the web site is ready it uploads it with the help of FTP. It provides complete seo solutions for your business. It uses different affiliate marketing tools in order to increase the web page traffic, improve page ranking and to do internet marketing. In order to running more speedily in the occasion of a disaster the servers should have a computer backup solution in which they are frequently take back ups on computer back up devices with the help of backup software.
Oracle, like many other companies, has taken the ANSI standard of SQL and extended it to include much additional functionality. SQL is the basic language used to manipulate and retrieve data from the Oracle9i database. SQL is a nonprocedural language—it does not have programmatic constructs such as loop structures. PL/SQL is Oracle’s procedural extension of SQL, and SQLJ allows embedded SQL operations in Java code. Tables In relational database systems (DBS) data are represented using tables (relations). A query issued against the DBS also results in a table. A table has the following structure: Column 1 Column 2 : : : Column n~ Tuple (or Record) A table is uniquely identi~ed by its name and consists of rows that contain the stored information, each row containing exactly one tuple (or record). A table can have one or more columns. A column is made up of a column name and a data type, and it describes an attribute of the tuples. The structure of a table, also called relation schema, thus is de~ned by its attributes. The type of information to be stored in a table is de~ned by the data types of the attributes at table creation time. SQL uses the terms table, row, and column for relation, tuple, and attribute, respectively. In this tutorial we will use the terms interchangeably. A table can have up to 254 columns which may have di~erent or same data types and sets of values (domains), respectively. Possible domains are alphanumeric data (strings), numbers and date formats. Oracle o~ers the following basic data types:~ char(n): Fixed-length character data (string), n characters long. The maximum size for n is 255 bytes (2000 in Oracle8). Note that a string of type char is always padded on right with blanks to full length of n. (+ can be memory consuming). Example: char(40) ~ varchar2(n): Variable-length character string. The maximum size for n is 2000 (4000 in Oracle8). Only the bytes used for a string require storage. Example: varchar2(80) ~ number(o; d): Numeric data type for integers and reals. o = overall number of digits, d = number of digits to the right of the decimal point. Maximum values: o =38, d= ~84 to +127. Examples: number(8), number(5,2) Note that, e.g., number(5,2) cannot contain anything larger than 999.99 without resulting in an error. Data types derived from number are int[eger], dec[imal], smallint and real. ~ date: Date data type for storing date and time. The default format for a date is: DD-MMM-YY. Examples:13-OCT-94, 07-JAN-98 long: Character data up to a length of 2GB. Only one long column is allowed per table. Note: In Oracle-SQL there is no data type boolean. It can, however, be simulated by using either char(1) or number(1).As long as no constraint restricts the possible values of an attribute, it may have the special value null (for unknown). This value is di~erent from the number 0, and it is also di~erent from the empty string. Further properties of tables are: the order in which tuples appear in a table is not relevant (unless a query requires an explicit sorting). a table has no duplicate tuples (depending on the query, however, duplicate tuples can appear in the query result). A database schema is a set of relation schemas. The extension of a database schema at database run-time is called a database instance or database, for short. <Example Database In the following discussions and examples we use an example database to manage information about employees, departments and salary scales. The corresponding tables can be created under the UNIX shell using the command demobld. The tables can be dropped by issuing the command demodrop under the UNIX shell. The table EMP is used to store information about employees:
........................................................... For the attributes, the following data types are de~ned: EMPNO:number(4), ENAME:varchar2(30), JOB:char(10), MGR:number(4), HIREDATE:date, SAL:number(7,2), DEPTNO:number(2)Each row (tuple) from the table is interpreted as follows: an employee has a number, a name, a job title and a salary. Furthermore, for each employee the number of his/her manager, the date he/she was hired, and the number of the department where he/she is working are stored. The table DEPT stores information about departments (number, name, and location):
Finally, the table SALGRADE contains all information about the salary scales, more precisely, the maximum and minimum salary of each scale.
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Last Updated ( Friday, 11 January 2008 ) | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| < Prev |
|---|







