Académique Documents
Professionnel Documents
Culture Documents
SQL
SQL, pronounced Sequel or simply S-Q-L, is a computer programming language that was developed especially for querying relational databases using a non-procedural approach.
The term non-procedural means that you can extract information by simply telling the system what information is needed without telling how to perform the data retrieval. The RDBMS parses (converts) the SQL commands and completes the task.
Bordoloi and Bock
SQL
Extracting information from the database by using SQL is termed querying the database. SQL is a language that is fairly simple to learn, in terms of writing queries but it has considerable complexity because it is a very powerful language.
Information is derived from raw facts known as data. Data has little meaning or usefulness to managers unless it is organized in some logical manner. One of the most efficient ways to organize and manage data is through the use of database management system (DBMS).
DATA
Two types of data are stored within a database User data : Data that must de stored by an organization. System data: Data the database needs to manage user data to manage itself. This is also termed metadata, or the data about data.
SQL
Data is manipulated by RDBMS users through the use of special data manipulation language. Database structures can also be defined by the use of data definition language. SQL is the most popular database language and has commands that enable it to be used for both manipulation and definition of databases.
SQL
SQL is used by Oracle for all interaction with the database. SQL statements fall into the two major categories
1. Data Definition Language(DDL) : Set of SQL commands that create and define objects in a database 2. Data Manipulation Language(DML) : Set of SQL commands that allow users to manipulate the data in a database.
Bordoloi and Bock
SQL
SQL is basically a free format language. This means that there are no particular spacing rules that must be followed when typing SQL commands. In Oracle, you must end each individual SQL statement (irrespective of whether it is composed as a single or multiple lines of code) with a semi-colon (;). It is the ; which ends an SQL statement and tellls Oracle to Execute it.
Bordoloi and Bock
RELATIONAL OPERATIONS
SQL operations for creating new tables, inserting table rows , updating table rows, deleting table rows, and querying databases are the primary means of interfacing with relational databases. The SELECT statement is used primarily to write queries that extract information from the database which is a collection of related tables.
Log On Screen
Exiting SQL*PLUS
The SQL*PLUS session can be ended by typing a command at the SQL prompt to terminate the session. Two commands are available: exit or quit. Either one of these can be used to terminate a SQL*PLUS session.
Syntax Conventions
Each select statement must follow precise syntactical and structural rules. The following is the minimum structure and syntax required for an SQL SELECT statement.
SELECT [DISTINCT | ALL] {* | select_list} FROM {table_name [alias] | view_name}
SQL Keywords
Keywords are words that have a predefined meaning in SQL. In practice, keywords may be entered in upper or lower case letters.
SELECT * FROM employee;
SQL Keywords
In some cases keywords can be abbreviated. The allowed abbreviation is shown in upper case letters with the remainder shown in lower case, which means either the full word or only the upper case part can be used. DESCribe: can be entered as either DESC or DESCRIBE.