QP School

Full Version: SELECT statement with MS Access SQL
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Example:

SELECT employee_id, first_name, job_title
FROM employees
WHERE job_title = 'Manager';

Let's break down the SQL code:

SELECT: This keyword indicates that we want to retrieve data from the table.
employee_id, first_name, job_title: These are the columns we want to retrieve data from. 
We specified three columns: "employee_id," "first_name," and "job_title."
FROM: This keyword indicates the table from which we want to retrieve data. 
In this case, we want data from the "employees" table.
WHERE: This optional keyword is used for filtering the rows. 
We can specify a condition to retrieve only those rows that satisfy the given condition.
job_title = 'Manager': This is the condition specified in the WHERE clause. 
It means we only want to retrieve rows where the "job_title" column has the value "Manager."

When you run this SQL code as a query in Microsoft Access, it will return a result set containing the "employee_id," "first_name," and "job_title" columns for all employees who have the job title "Manager." The result will be displayed in the Datasheet View, showing only the relevant information based on the specified condition.