0% found this document useful (0 votes)
793 views

Dol and DCL Commands in SQL

This document discusses SQL commands for viewing, filtering, and sorting data in database tables, as well as granting and revoking user privileges. It provides the syntax for selecting all or some columns and rows from a table, selecting rows or columns that meet certain conditions, and sorting data. It also outlines using GRANT statements to provide user privileges and REVOKE statements to remove privileges.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
793 views

Dol and DCL Commands in SQL

This document discusses SQL commands for viewing, filtering, and sorting data in database tables, as well as granting and revoking user privileges. It provides the syntax for selecting all or some columns and rows from a table, selecting rows or columns that meet certain conditions, and sorting data. It also outlines using GRANT statements to provide user privileges and REVOKE statements to remove privileges.
Copyright
© © All Rights Reserved
Available Formats
Download as TXT, PDF, TXT or read online on Scribd
You are on page 1/ 1

DQL Commands:

12. Viewing data in the tables: - once data has been inserted into a table, the
next most logical operation would be to view what has been inserted.
a) all rows and all columns
Syntax:
Select <col> to <col n> from tablename;
Select * from tablename;
13. Filtering table data: - while viewing data from a table, it is rare that all
the data from table will be required each time. Hence, sql must give us a metho
d of filtering out data that is not required data.
a) Selected columns and all rows:
Syntax:
select <col1>,<col2> from <tablename>;
b) selected rows and all columns:
Syntax:
select * from <tablename> where <condition>;
c) selected columns and selected rows
Syntax:
select <col1>,<col2> from <tablename> where<condition>;
14. Sorting data in a table.
Syntax:
Select * from <tablename> order by <col1>,<col2> <[sortorder]>;
DCL commands:
Oracle provides extensive feature in order to safeguard information stored in it
s tables from unauthoraised viewing and damage.The rights that allow the user of
some or all oracle resources on the server are called privileges.
a) Grant privileges using the GRANT statement
The grant statement provides various types of access to database objects such as
tables,views and sequences and so on.
Syntax:
GRANT <object privileges>
ON <objectname>
TO<username>
[WITH GRANT OPTION];
b) Reoke permissions using the REVOKE statement:
The REVOKE statement is used to deny the Grant given on an object.
Syntax:
REVOKE<object privilege>
ON
FROM<user name>;

You might also like