Lab Assignment 1: Types of SQL Commands
Lab Assignment 1: Types of SQL Commands
Lab Assignment 1: Types of SQL Commands
The standard SQL commands to interact with relational databases are CREATE, SELECT, INSERT, UPDATE,
DELETE and DROP. These commands can be classified into groups based on their nature:
Command Description
CREATE Create new database/table
ALTER Modifies the structure of database/table.
DROP Deletes a database/table.
TRUNCATE Remove all table records including allocated table spaces.
RENAME Rename the database/table.
Data Manipulation Language (DML) :
Data Manipulation Language, DML, is the part of SQL used to manipulate data within objects of a
relational database.
Command Description
SELECT Retrieve data from the table.
INSERT Insert data into a table.
UPDATE Updates existing data with new data within a table.
DELETE Deletes the records rows from the table
MERGE MERGE (also called UPSERT) commands to INSERT new
records or UPDATE existing records depending on
condition matches or not.
LOCK TABLE LOCK TABLE commands to lock one or more tables in a
specified mode. Table access denied to a other users for
the duration of your table operation.
Command Description
SELECT Retrieves certain records from one or more tables
Command Description
GRANT Gives privileges to user for accessing database data.
REVOKE. Take back for given privileges
ANALYZE ANALYZE statement to collect statistics information
about index, cluster, table.
AUDIT To track the occurrence of a specific SQL statement or
all SQL statements during the user sessions.
COMMENT Write comment to the data table.
Data Administration Commands (DAC):
Data administration commands allow the user to perform audits and perform analyses on operations
within the database. They can also be used to help analyze system performance. Two general data
administration commands are as follows:
Command
START AUDIT
STOP AUDIT
Command Description
COMMIT Permanent work save into database.
ROLLBACK Restore database to original form since the last
COMMIT
SAVEPOINT Create SAVEPOINT for later use ROLLBACK the new
changes.
SET TRANSACTION SET TRANSACTION command set the transaction
properties such as read-write/read only access.