Changes

Jump to: navigation, search

SRA840 Lab7

266 bytes added, 19:48, 11 April 2009
no edit summary
REVOKE ALL FROM 'user'@'localhost';
* Create a table:
CREATE DATABASE vyas;
USE vyas;
CREATE TABLE tmp (name VARCHAR(20), sex CHAR(1), bday DATE);
INSERT INTO tmp VALUES ('Abc','M','1900-01-02');
INSERT INTO tmp VALUES ('Xyz','M','NULL');
* Select some of the records in the table you created:
SELECT * FROM tmp;
SELECT name,sex FROM tmp WHERE name = 'Abc';
SELECT name,bday FROM tmp WHERE bday > '1900-01-01';
* Change some of the records into the table you created:
UPDATE tmp SET bday = '1980-01-11' WHERE name = 'Xyz';
 
1
edit

Navigation menu