★ wanayoo — archive 1999 http://sqlcourse.com/update.htmlNouvelle recherche | Portail wanayoo
 
Left Curve Internet Advertising Report
To internet.com

internet.com
Internet News
Internet Stocks
Internet Technology
Web Developer
Internet Marketing
ISP
Downloads
Internet Resources
International

Search internet.com
Advertising Info
Corporate Info
Internet Trade Shows

WebReference.com HTML (sample)

Text (sample)
Free HTML Newsletters

internet.commerce
Be an Affiliate
Be a Partner
Software Store
Computer Help
Register a Domain
Be Domain Registrar
e-solutions
Internet Jobs
A/V Network
Map Your Website
Rent E-mail Lists
Bookstore
Press Release dist.
Sell Ad Space
Internet Research
Venture Capital
Web Publishing
Build Your Intranet
Expert Tech Advice
Get e-Biz Intell.
Content for Websites

Update Tables

T he update statement is used to update or change records that match a specified criteria. This is accomplished by carefully constructing a where clause.

update "tablename"
set "columnname" = "newvalue"[,"nextcolumn" = "newvalue2"...]
where "columnname" OPERATOR "value" [and|or "column" OPERATOR "value"];
[] = optional

Examples:

update phone_book
set area_code = 623
where prefix = 979;

update phone_book
set last_name = 'Smith', prefix=555, suffix=9292
where last_name = 'Jones';

update employee
set age = age+1
where first_name='Mary' and last_name='Williams';

Update statement exercises_____
(after each update, issue a select statement to verify your changes).

1 Jonie Weber just got married to Bob Williams. She has requested that her last name be updated to Weber-Williams.
2 Dirk Smith's birthday is today, add 1 to his age.
3 All secretaries are now called "Administrative Assistant". Update all titles accordingly.
4 Everyone that's making under 30000 are to receive a 3500 a year raise.
5 Everyone that's making over 33500 are to receive a 4500 a year raise.
6 All "Programmer II" titles are now promoted to "Programmer III".
7 All "Programmer" titles are now promoted to "Programmer II".


Create at least 5 of your own update statements and submit them.

Answers to exercises


SQL Interpreter:

Home
1 What is SQL?
2 Table basics
3 Selecting data
4 Creating tables
5 Inserting into a table
6 Updating records
7 Deleting records
8 Drop a table
9 Standalone SQL Interpreter
10 Advertise on SQLCourse.com
11 Other Tutorial Links

Free Web Developer Info! Internet Trade Show List

Please send questions or comments to: comments@sqlcourse.com

© Copyright 1999, internet.com Corp. All Rights Reserved. Legal Notices.
http://www.internet.com