Thursday, 12 May 2011

SQL Alias


SQL Aliases are defined for columns and tables. Basically aliases is created to make the column selected more readable.
For Example: To select the first name of all the students, the query would be like:
Aliases for columns:
SELECT first_name AS Name FROM student_details;
or
SELECT first_name Name FROM student_details;

In the above query, the column first_name is given a alias as 'name'. So when the result is displayed the column name appears as 'Name' instead of 'first_name'.

Wednesday, 11 May 2011

Learning SQL

Click below links.

  • SQL Commands

  • SQL SELECT

  • SQL Alias

  • SQL WHERE

  • SQL Operators

  • SQL Logical Operators

  • SQL LIKE, IN

  • SQL ORDER BY

  • SQL Group Functions

  • SQL GROUP BY

  • SQL HAVING

  • SQL INSERT

  • SQL UPDATE

  • SQL DELETE

  • SQL CREATE TABLE

  • SQL ALTER TABLE

  • SQL Integrity Constrain

  • SQL JOINS

  • SQL VIEWS

  • SQL Subquery

  • SQL Indexes

  • SQL GRANT, REVOKE

  • Oracle Functions

  • SQL SELECT


     

    The most commonly used SQL command is SELECT statement. The SQL SELECT statement is used to query or retrieve data from a table in the database. A query may retrieve information from specified columns or from all of the columns in the table. To create a simple SQL SELECT Statement, you must specify the column(s) name and the table name. The whole query is called SQL SELECT Statement.
    Syntax of SQL SELECT Statement:
    SELECT column_list FROM table-name
    [WHERE Clause]
    [GROUP BY clause]
    [HAVING clause]
    [ORDER BY clause];

    • table-name is the name of the table from which the information is retrieved.
    • column_list includes one or more columns from which data is retrieved.
    • The code within the brackets is optional.

    SQL Commands

     

    SQL commands are instructions used to communicate with the database to perform specific task that work with data. SQL commands can be used not only for searching the database but also to perform various other functions like, for example, you can create tables, add data to tables, or modify data, drop the table, set permissions for users. SQL commands are grouped into four major categories depending on their functionality:

    • Data Definition Language (DDL) - These SQL commands are used for creating, modifying, and dropping the structure of database objects. The commands are CREATE, ALTER, DROP, RENAME, and TRUNCATE.
    • Data Manipulation Language (DML) - These SQL commands are used for storing, retrieving, modifying, and deleting data. These commands are SELECT, INSERT, UPDATE, and DELETE.
    • Transaction Control Language (TCL) - These SQL commands are used for managing changes affecting the data. These commands are COMMIT, ROLLBACK, and SAVEPOINT.
    • Data Control Language (DCL) - These SQL commands are used for providing security to database objects. These commands are GRANT and REVOKE.

    Responsibilities of Database Administrators

     

    Each database requires at least one database administrator (DBA). An Oracle Database system can be large and can have many users. Therefore, database administration is sometimes not a one-person job, but a job for a group of DBAs who share responsibility.

    A database administrator's responsibilities can include the following tasks:

    • Installing and upgrading the Oracle Database server and application tools
    • Allocating system storage and planning future storage requirements for the database system
    • Creating primary database storage structures (tablespaces) after application developers have designed an application
    • Creating primary objects (tables, views, indexes) once application developers have designed an application
    • Modifying the database structure, as necessary, from information given by application developers
    • Enrolling users and maintaining system security
    • Ensuring compliance with Oracle license agreements
    • Controlling and monitoring user access to the database
    • Monitoring and optimizing the performance of the database
    • Planning for backup and recovery of database information
    • Maintaining archived data on tape
    • Backing up and restoring the database
    • Contacting Oracle for technical support

    Writing SQL Statements

     

    • SQL statements are not case sensitive.
    • SQL statements can be on one or more lines.
    • Keywords cannot be abbreviated or split across lines.
    • Clauses are usually placed on separate lines.
    • Indents are used to enhance readability.

    Tuesday, 10 May 2011

    Oracle Database Firewall Now Available

     

    Cost Effective Protection for Oracle and non-Oracle Databases

    Oracle Database Firewall, part of Oracle's comprehensive portfolio of database security solutions, is the first line of defense for both Oracle and non-Oracle databases. It monitors database activity on the network to help prevent unauthorized access, SQL injections, privilege or role escalation, and other external and internal attacks - all in real time. Based on innovative SQL grammar technology that can reduce millions of SQL statement into a small number of SQL characteristics, Oracle Database Firewall offers unmatched accuracy, scalability, and performance. Enforcement of positive (white lists) and negative (black lists) security models provides protection from threats without time consuming and costly false positives. Oracle Database Firewall also enables organizations to address SOX, PCI, HIPAA/HITECH, and other regulatory requirements without changes to existing applications or databases, and demonstrate compliance with built-in customizable reports.

    Click here for Official Page