SQL
SQL
DESC my_contacts;
DROP TABLE my_contacts;
INSERT INTO my_contacts ( last_name,first_name,email ) VALUES ( ‘Jill’,
‘Anderson’, ‘[email protected]’);
'Grover\'s Mill’;
SELECT drink_name FROM drink_info WHERE drink_name >= ' I ' AND drink_name
< ‘M’;
UPDATE (table)
SET column_name=“ blah”
WHERE some_column=“ blah”;
UPDATE (table)
SET cost=cost+1
WHERE some_column=“blah”;
SHOW CREATE TABLE my_contacts:: For getting a code like this so that we dont
have to write the code for full table again.
:::
CREATE TABLE `my_contacts` (
`last_name` varchar(30) DEFAULT NULL,
`first_name` varchar(20) DEFAULT NULL,
`email` varchar(50) DEFAULT NULL,
`birthday` date DEFAULT NULL,
`profession` varchar(50) DEFAULT NULL
contact_id INT NOT NULL AUTO_INCREMENT :- it starts the value from 1 and
keeps increasing by 1