USAGE
USAGE in SQL is a privilege type that specifies a user's ability to interact with a database object, such as a sequence or domain. Granting USAGE allows the user to use the specified object in SQL statements.
Example
Output
Explanation
The CREATE TABLE
command is used to create a new table in the database. Three fields are specified: customer_id
, customer_name
, and customer_city
.
The INSERT INTO
command is then used to populate the table customers
with data.
Finally, the SELECT
command is used to retrieve all data from the customers
table. It outputs the rows of the table, where each row represents a unique customer with their associated ID, name, and city.
Example
Output
Explanation
The above SQL statement is extracting the column ‘FIRST_NAME’ and ‘LAST_NAME’ from the ‘EMPLOYEES’ table where the ‘SALARY’ is greater than 5000. The output table displays the result of the SQL statement.