Sobes.tech
Junior — Middle

How can you select specific records from a table using SQL queries?

sobes.tech AI

Answer from AI

To select specific records from a table in SQL, the SELECT operator with a WHERE condition is used.

Example:

SELECT * FROM employees WHERE department = 'Sales';

This query will select all records from the employees table where the department column value is 'Sales'.

Various comparison operators and logical operators can be used for more precise selection, for example:

SELECT name, salary FROM employees WHERE salary > 50000 AND department = 'IT';

This query will select the names and salaries of employees from the IT department with a salary above 50,000.