CREATE TABLE `members` (
`id` int(4) NOT NULL auto_increment,
`username` varchar(65) NOT NULL default '',
`password` varchar(65) NOT NULL default '',
PRIMARY KEY (`id`)
) TYPE=MyISAM AUTO_INCREMENT=2 ;
--
-- Dumping data for table `members`
--
INSERT INTO `members` VALUES (1, 'john', '1234');
heonyee's database
Tuesday, 10 January 2012
Tuesday, 22 November 2011
drop constratinalter
drop constratinalter
alter table my_employee drop primary key
using savepoint
savepoint one <-- save
savepoint to one <- go to savepoint
alter table my_employee drop primary key
using savepoint
savepoint one <-- save
savepoint to one <- go to savepoint
what is commit in sql
A
COMMIT statement in SQL ends a transaction within a relational database management system (RDBMS) and makes all changes visible to other users. The general format is to issue a BEGIN WORK statement, one or more SQL statements, and then the COMMIT statement. Alternatively, a ROLLBACK statement can be issued, which undoes all the work performed since BEGIN WORK was issued. A COMMIT statement will also release any existing savepoints that may be in use. In terms of transactions, the opposite of commit is to discard the tentative changes of a transaction, a rollback.
sql insert and drop table
SQL DELETE Example
The "Persons" table:| P_Id | LastName | FirstName | Address | City |
|---|
| 1 | Hansen | Ola | Timoteivn 10 | Sandnes | |||||
| 2 | Svendson | Tove | Borgvn 23 | Sandnes | |||||
| 3 | Pettersen | Kari | Storgt 20 | Stavanger | |||||
| 4 | Nilsen | Johan | Bakken 2 | Stavanger | |||||
| 5 | Tjessem | Jakob | Nissestien 67 | Sandnes |
Now we want to delete the person "Tjessem, Jakob" in the "Persons" table.
We use the following SQL statement:
DELETE FROM Persons
WHERE LastName='Tjessem' AND FirstName='Jakob'
WHERE LastName='Tjessem' AND FirstName='Jakob'
Subscribe to:
Comments (Atom)