With SQL, how do you select all the records from a table named "Persons" where the "FirstName" is "Peter" and the "LastName" is "Jackson"?
The SQL WHERE Clause
The WHERE clause is used to filter records from a database table , the WHERE clause is used to extract only those records that fulfill a specified condition.
WHERE Syntax is as follows:
SELECT column1, column2, column3, ...FROM table_name WHERE condition;
WHERE Clause Example
The following SQL statement selects all the SlightBook Customers from the country "India", in the "CustomersBook" table:
An example is given below:
SELECT * FROM CustomersBook WHERE Country='India';
The OR operator displays a record if ANY conditions listed are true. The AND operator displays a record if ALL of the conditions listed are true
With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" starts with an "a"?
With SQL, how do you select all the records from a table named "Persons" where the value of the column "FirstName" is "Peter"?
With SQL, how do you select all the columns from a table named "Persons"?
With SQL, how do you select a column named "FirstName" from a table named "Persons"?