SQL What is SQL?

  

SQL stands for Structured Query Language SQL lets you access and manipulate databases SQL is an ANSI (American National Standards Institute) standard

What Can SQL do?
         

SQL can execute queries against a database SQL can retrieve data from a database SQL can insert records in a database SQL can update records in a database SQL can delete records from a database SQL can create new databases SQL can create new tables in a database SQL can create stored procedures in a database SQL can create views in a database SQL can set permissions on tables, procedures, and views

SQL is a Standard - BUT.... Although SQL is an ANSI (American National Standards Institute) standard, there are many different versions of the SQL language. However, to be compliant with the ANSI standard, they all support at least the major commands (such as SELECT, UPDATE, DELETE, INSERT, WHERE) in a similar manner. Note: Most of the SQL database programs also have their own proprietary extensions in addition to the SQL standard! DBMS A database management system (DBMS) is a software package with computer programs that control the creation, maintenance, and the use of a database. It allows organizations to conveniently develop databases for various applications by database administrators (DBAs) and other specialists. A database is an integrated collection of data records, files, and other database objects. A DBMS allows different user application programs to concurrently access the same database. DBMSs may use a variety of database models, such as the relational model or object model, to conveniently describe and support applications. It typically supports query languages, which are in fact high-level programming languages, dedicated database languages that considerably simplify writing database application programs. Database languages also simplify the database organization as well as retrieving and presenting information from it. A DBMS provides facilities for controlling data access, enforcing data integrity, managing concurrency control, recovering the database after failures and restoring it from backup files, as well as maintaining database security.

the name of the containing column and the primary key value of the containing row. designed to define what is required from a database management system in order for it to be considered relational.Set of programs to access the data ..Database Management System (DBMS) . Codd produced these rules as part of a personal campaign to prevent his vision of the relational database being diluted. Specifically. products.Collection of interrelated data . a pioneer of the relational model for databases. It says that every individual scalar value in the database must be logically addressable by specifying the name of the containing table. Rule 12 was particularly designed to counter such a positioning.Sales: customers. as database vendors scrambled in the early 1980s to repackage existing products with a relational veneer. inventory. schedules . a relational database management system (RDBMS).Universities: registration.Manufacturing: production.[1][2] They are sometimes jokingly referred to as "Codd's Twelve Commandments". i.Database Applications . namely by values in column positions within rows of tables. in the case of numeric values). . grades .DBMS provides an environment that is both convenient and efficient to use. purchases . distinct from all regular values (for example. supply chain CODDs Rules Codd's twelve rules are a set of thirteen rules (numbered zero to twelve) proposed by Edgar F. This rule is essentially a restatement of the fundamental requirement for primary keys. and as a management system. that system must use its relationalfacilities (exclusively) to manage the database.e. Codd. orders. For a system to qualify as a relational database management system (RDBMS). and independent of data type. Rule 2: The guaranteed access rule: All data must be accessible. as a database. it must support a representation of "missing information and inapplicable information" that is systematic. Rule 1: The information rule: All information in the database is to be represented in only one way. "distinct from zero or any other number". The rules Rule (0): The system must qualify as relational.Banking: all transactions . Rule 3: Systematic treatment of null values: The DBMS must allow each field to remain null (or empty).DBMS contains information about a particular enterprise .Airlines: reservations. It is also .

This rule states that insert. update. relational catalog that is accessible to authorized users by means of their regular query language. Logical data independence is more difficult to achieve than physical data independence. Rule 9: Logical data independence: Changes to the logical level (tables. Has a linear syntax 2. columns. Rule 7: High-level insert. Can be used both interactively and within application programs. Rule 8: Physical data independence: Changes to the physical level (how the data is stored. whether in arrays or linked lists etc. Existing applications should continue to operate successfully : . data manipulation operations (update as well as retrieval). and delete: The system must support set-at-a-time insert.) must not require a change to an application based on the structure. update. users must be able to access the database's structure (catalog) using the same query language that they use to access the database's data.implied that such representations must be manipulated by the DBMS in a systematic way. Rule 4: Active online catalog based on the relational model: The system must support an online. and delete operations should be supported for any retrievable set rather than just for a single row in a single table. and rollback). and delete operators. and transaction management operations (begin. Rule 5: The comprehensive data sublanguage rule: The system must support at least one relational language that 1. Supports data definition operations (including view definitions). rows. Rule 6: The view updating rule: All views that are theoretically updatable must be updatable by the system. inline. commit. It must be possible to change such constraints as and when appropriate without unnecessarily affecting existing applications. 3. and so on) must not require a change to an application based on the structure. update. security and integrity constraints. Rule 11: Distribution independence: The distribution of portions of the database to various locations should be invisible to users of the database. Rule 10: Integrity independence: Integrity constraints must be specified separately from application programs and stored in the catalog. This means that data can be retrieved from a relational database in sets constructed of data from multiple rows and/or multiple tables. That is.

and impose constraints between tables.updates data in a database DELETE . Rule 12: The nonsubversion rule: If the system provides a low-level (record-at-a-time) interface. It also define indexes (keys). The most important DDL statements in SQL are:      CREATE DATABASE . then that interface cannot be used to subvert the system. SQL DML and DDL SQL can be divided into two parts: The Data Manipulation Language (DML) and the Data Definition Language (DDL).creates a new table ALTER TABLE .1. when a distributed version of the DBMS is first introduced. and 2. for example.modifies a table DROP TABLE . The query and update commands form the DML part of SQL:     SELECT .deletes data from a database INSERT INTO .modifies a database CREATE TABLE . bypassing a relational security or integrity constraint. when existing distributed data are redistributed around the system.creates a new database ALTER DATABASE .inserts new data into a database The DDL part of SQL permits database tables to be created or deleted.extracts data from a database UPDATE .deletes a table . specify links between tables.

908.3/90.250 -5.98/.-.80 #%% .-0  .-.3.-.0 ./.9.078434190$817893974/:./0/394945.3/   030893/897-:90//.74:3/9088902  #:0%03438:-.9..883.078437:0 19088902574./.-0894-0.3/25480..9.1742..90203983$".-.43897.-08 %02489 25479.908/.9.138-090039.939071.398-090039./897-:90/.943.0/.84/01303/008 08 850.4 0.43897.30/.70 O O O O O #%%$ .3/81472905.9.80 &!% :5/.80.1742./.394.-08 .80 $#%%  38079830/.9.0799088902 1470.-0 # !% /00908./.80 % /00908/..3:.9.3989..0  .9.7941$"507298/.47/ .-.9.90.9 . 920 39071.798%0.70.90/47/0090/ 9.:7947 39079.9.80 %05.70.3349-0:80/948:-.9.80 %#%$ 24/108..-..9.0   %06:07.-0 %#% 24/108.3/ $".9.809.7941$" O O O O $% 097.35:. 013943./08./.0 70.3/:5/.9.309.9.  03.7070/897-:90/.3:.422.70.943.0 9039.9.-.3-0/.39   $".70.908.

Sign up to vote on this title
UsefulNot useful