USER
USER is a SQL keyword that returns the name of the current user in the database management system. This function doesn't require any parameters. It's useful for permissions, auditing, and other user-specific context within a session.
Example
Output
Explanation
In the provided SQL query, we select all fields from the ‘students’ table where the grade is ‘A’. The output is formatted into markdown to display the data in a table format. It shows that students with ID 1, 3, and 6, called Alice, Emma, and Mike respectively, have a grade ‘A’.
Example
Output
Explanation
In the example above, the query selects ename
(employee name) and job
from the emp
table where the deptno
(department number) is 20. The output table displays the names and jobs of all employees in department 20.
Example
Output
Explanation
In the SQL query, we select all fields (*
) from the Customers
table where the Country equals ‘USA’. The result of this query is outputted in a markdown table format, listing customers from the table ‘Customers’ that reside in ‘USA’.