Chapter4-Introduction To SQL
Chapter4-Introduction To SQL
Implementation, and
Management
Eighth Edition
• Authentication
– DBMS verifies that only registered users are
able to access database
– Log on to RDBMS using user ID and password
created by database administrator
• Schema
– Group of database objects that are related to
each other
• INSERT
• SELECT
• COMMIT
• UPDATE
• ROLLBACK
• DELETE
• INSERT
– Used to enter data into table
– Syntax:
• INSERT INTO columnname
VALUES (value1, value2, … , valueN);
• SELECT
– Used to list contents of table
– Syntax:
• SELECT columnlist
• FROM tablename;
• Columnlist represents one or more attributes,
separated by commas
• Asterisk can be used as wildcard character to
list all attributes
• UPDATE
– Modify data in a table
– Syntax:
UPDATE tablename
SET columnname = expression [, columnname =
expression]
[WHERE conditionlist];
• If more than one attribute is to be updated in
row, separate corrections with commas
• ROLLBACK
– Undoes changes since last COMMIT
– Brings data back to pre-change values
• Syntax:
– ROLLBACK;
• COMMIT and ROLLBACK only work with
commands to add, modify, or delete table rows
• DELETE
– Deletes a table row
– Syntax:
DELETE FROM tablename
[WHERE conditionlist ];
• WHERE condition is optional
• If WHERE condition is not specified, all rows
from specified table will be deleted
• DROP
– Deletes table from database
– Syntax:
DROP TABLE tablename;
• Can drop a table only if it is not the “one” side
of any relationship
– Otherwise RDBMS generates an error message
– Foreign key integrity violation