Thursday, December 4, 2008

śmierć Przez Uduszenie

DEPTH SQL: SELECT clause, WHERE, ORDER BY, TO INSERT, UPDATE, DELETE, COUNT

SQL è un acronimo si Structured Query Language , è il linguaggio di riferimento per le basi di dati relazionali. Non è solo un linguaggio di interrogazione, infatti contiene al suo interno sia le funzionalità a Data Definition Language , DDL (with a set of commands to define the schema of a relational database), whether a Data Manipulation Language, DML (with a set of commands for editing and 'Question of the instance of a database) and those of Data Control Language, DCL (with a set of commands for user management).
SQL allows you to create tables and change their structure or act on the tables, creating queries, adding data, modifying and / or deleting data. Specifically, the DML provides commands to insert, edit, delete or read data into tables in a database. The structure these data must already be defined by DDL. In addition, permission to access that data must be assigned to the user through the DCL.
The syntax for creating a table is: CREATE TABLE

table_name (field_name datatype required ?)

Select

Select The command is the only command Question ( query) SQL, but its expressive power is that you can achieve in a few lines that questions in other languages \u200b\u200bwould require many pages of code. The result is a table of command.

The syntax in its simplest form is:
  SELECT_  list attributi_    
FROM_ list tabelle_
WHERE _condizione_
The list of attributes after the SELECT is that of table columns in output.
The list of tables after FROM table is necessary (in simple cases only one table) to produce the output table.
La condizione dopo WHERE è quella che selezionerà le tuple o righe da inserire nella tabella di uscita.

Insert


Il comando Insert serve ad inserire una o più nuove tuple nella tabella indicata .

La sintassi è:
 INSERT INTO_Tabella_     
[ _lista attributi_]
VALUES ( _lista valori_)

dove è facoltativa; se non è presente si intende che devono essere specified all the fields, but if there is a list, then only the fields must be specified in the order listed.

Update

Update The command used to update data in a table. The

syntax is:
 UPDATE_Tabella_   
SET_nome Field_A = _Name valore_
[WHERE-condizione_ ]
fields listed in the SET clause are updated for all records that satisfy the WHERE clause. The latter may be omitted but in this case all the rows are updated table.



Delete The Delete command serves to delete one or more rows of a data-base. The

syntax is: DELETE

 FROM_Tabella_   
WHERE_condizione_

deletes all tuples that satisfy the condition specified in WHERE, so you can eliminate a large number of data with a single command.

0 comments:

Post a Comment