It shows that you are unregistered. Please register with us by clicking Here
![]() |
|
![]() |
![]() | Register - FAQ - Today's Posts - New Posts - Support - Search | ![]() |
|
|
#1 (permalink) |
|
Junior Member
|
Table creation
Code:
CREATE TABLE table_name (name type [, name type [, ...]]); CHARACTER(n)String size n n from 1 up to 15000 DATEDate in mm/gg/aa format TIMEHour in hh:mm format INTEGER(p)Integer number with p precision p from 1 up to 45 p da 1 a 45 SMALLINTInteger number with precision 5 from -32768 up to 32767 INTEGERInteger number with precision 10 from -2.147.483.648 up to 2.147.483.647 DECIMAL(p,s)Decimal number with precision p and s cifre p from 1 up to 45 and s from 0 up to p REALReal number Numero reale con mantissa di precisione 7valore 0 oppure valore assoluto da 1E-38 a 1E+38 FLOATNumero reale con mantissa di precisione 15valore 0 oppure valore assoluto da 1E-38 a 1E+38 FLOAT(p)Numero reale con mantissa di precisione pp da 1 a 45 For example, to create a table with the data of dependents of a company we have to use this command: Code:
CREATE TABLE tblDependents( Id char(5), Surname char(30), Name char(20), FiscalCode char(16) not null, Engaged date, Branch smallint, Function char(15), Level smallint, Salary integer, Address char(25), Cap char(5), City char(20), ); Data manipulation To insert a new row we use INSERT command: Code:
INSERT INTO table_name(name) VALUES(value); Code:
UPDATE table_name SET name = value [, name = value [, ...]] WHERE name = value [, name = value [, ...]] Code:
DELETE FROM table_name WHERE name = value [, name = value [, ...]] Code:
INSERT INTO tblDependents
(Id, Surname, Name, FiscalCode, Engaged, Branch, Function, Level,
Salary, Address, Cap, City)
VALUES ('AB541', 'Rossi', 'Paolo', 'RSSPLA65M20R341E', '09/15/1997', 3, 'Impiegato', 5,
890, 'via roma 34', '20100', 'Milano');
Code:
UPDATE tblPersonale SET Livello = 6 WHERE Id = 'AA345'; Code:
DELETE FROM tblPersonale WHERE Id = 'AQ123'; The general structure is the following: Code:
SELECT name [, name [, ...]] FROM table_name [, table_name [, ...]] WHERE name = value [AND name = value] Code:
SELECT Surname, Name, FiscalCode FROM tblDependent WHERE Function = 'Impiegato'; Code:
SELECT * FROM tblDependent WHERE City = 'Milano' If you'd like to have more information, you can visit [http://www.alangiacomin.net/forum/index.php?board=21.0]here[/url] |
|
|
|
|
|
![]() |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Got the Search Engine Optimization basics covered, what's next? | alexa | Search Engine Optimization | 1 | 07-12-2006 07:26 AM |
| Php Basics | Gaia | Graphics & Multimedia | 12 | 12-29-2005 09:01 PM |
| The Basics Of Brush Making | Sanjiun | Graphics & Multimedia | 1 | 08-18-2005 06:32 AM |