SELECT Statement MYSQL

We have a database created, table created, and data records inserted.

Now let’s what are the differect ways we can query the stored data.

The SELECT statement is used to select data from a database table.


Syntax:

SELECT column1, column2, …
FROM table_name;

Query:

Let’s select data with all the columns from the employees table using ‘*’

SELECT * FROM employees


Output
:

SELECT Statement Example

As you see we have fetched tables data with all columns  


Select
Selected Columns

Query:

Let’s fetch with selected columns ( only no and name information)  from the employees table

SELECT emp_no,first_name,last_name FROM employees

Output:

SELECT Statement (selected columns)  Example

Tester Usage Tips:

  • To verify the data visible in UI from one or more database tables.
  • To verify the data saved through the UI is correctly stored in database
  • To verify the records stored in specific database tables