Professional Documents
Culture Documents
Chapter 5
Chapter 5
Example:
5.2 UPDATE
The UPDATE statement is used to update existing records in a table.
The syntax is as follows:
Note! Notice the WHERE clause in the UPDATE syntax. The WHERE clause specifies which
record or records that should be updated. If you omit the WHERE clause, all records will be
updated!
Example:
5.3 DELETE
The DELETE statement is used to delete rows in a table.
Syntax:
Note! Notice the WHERE clause in the DELETE syntax. The WHERE clause specifies which
record or records that should be deleted. If you omit the WHERE clause, all records will be
deleted!
Example:
Question 1:
Consider the following UNIVERSITY schema, where the primary keys are
underlined,
a. create a database using SQL Server DBMS:
solution:
create table classroom
(building varchar (15),
room number varchar (7),
capacity numeric (4,0),
primary key (building, room number));