Explore BrainMass

Explore BrainMass

    features and uses of SQL

    This content was COPIED from BrainMass.com - View the original, and get the already-completed solution here!

    Outline the specific features and uses of SQL. Put in examples of each point or feature that you explain.

    © BrainMass Inc. brainmass.com October 9, 2019, 5:23 pm ad1c9bdddf

    Solution Preview

    Please see the attached file.


    (Structured Query Language) Pronounced "S-Q-L" a language used to interrogate and process data in a relational database. Originally developed by IBM for its mainframes, all database systems designed for client/server environments support SQL. SQL commands can be used to interactively work with a database or can be embedded within a programming language to interface to a database. Programming extensions to SQL have turned it into a full-blown database programming language, and all major database management systems (DBMSs) support the language.

    When SQL was not developed File-processing System was very popular for processing and storing the data. But some of the major disadvantages of File-processing System like Data redundancy and inconsistency, difficulty in accessing data, data isolation, concurrent access anomalies lead to the development of SQL.

    SQL is a non-procedural language and a language that all commercial RDBMS implementations understand.

    The following SQL query selects customers with credit limits of at least $5,000 and puts them into sequence from highest credit limit to lowest. The bold words are SQL verbs.

    select name, city, state, zipcode
    from customer
    where creditlimit > 4999
    order by creditlimit desc

    Data Types:
    There are various data types that SQL supports like:

    Decimal numbers

    Floating point numbers---- FLOAT

    Fixed length character strings---- CHAR (len)
    Fixed length character data of length len bytes. This should be used for fixed length data.

    Variable length character strings --- Varchar2(len)
    Variable length character string having maximum length len bytes. We must pecify the size

    SQL has three flavors of statements. The DDL, DML and DCL.

    DDL is Data Definition Language statements. Some examples:
    CREATE - to create objects in the database
    ALTER - alters the structure of the database
    DROP - delete objects from the database
    TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed
    COMMENT - add comments to the data dictionary
    GRANT - gives user's access privileges to database
    REVOKE - withdraw access privileges given with the GRANT command

    DML is Data Manipulation Language statements. Some examples:
    SELECT - retrieve data from the a database
    INSERT - insert data into a table
    UPDATE - updates existing data within a table
    DELETE - deletes all records from a table, the space for the records remain
    CALL - call a PL/SQL or Java subprogram
    EXPLAIN PLAN - explain access path to data
    LOCK TABLE - control concurrency

    DCL is Data Control Language statements. Some examples:
    COMMIT - save work done
    SAVEPOINT - identify a point in a transaction to which you can later roll back
    ROLLBACK - restore database to original since the last COMMIT
    SET TRANSACTION - Change transaction options like what rollback segment to use

    Set Operational Features:

    The SQL operations union, intersect ...

    Solution Summary

    This job examines features and uses of SQL.