Difference between revisions of "Scratch"

From WhyAskWhy.org Wiki
Jump to: navigation, search
m (Testing highlighting for SQL)
m (Change lang from sql to mysql)
Line 1: Line 1:
<syntaxhighlight lang="sql">
+
<syntaxhighlight lang="mysql">
 
# use the "my_database" database
 
# use the "my_database" database
 
USE my_database;
 
USE my_database;

Revision as of 06:29, 3 August 2012

# use the "my_database" database
USE my_database;

# show all "bath_towels" data
SELECT * FROM bath_towels;

# update specific fields in the "color" column
UPDATE bath_towels SET color = "Beige"
WHERE name = "Harvest";

UPDATE bath_towels SET color = "Blue"
WHERE name = "Dolphin";

UPDATE bath_towels SET color = "Lilac"
WHERE name = "Daisy";

UPDATE bath_towels SET name = "Tempest", color = "Maroon"
WHERE code = "821/9628";

# show all "bath_towels" data
SELECT * FROM bath_towels;