SQL query statements for retrieving data from a table

3/10/2024
All Articles

#SQL query statements for retrieving data from a table

SQL query statements for retrieving data from a table

SQL query statements for retrieving data from a table

Using tables, columns, rows, and fields, users can change data on client computers through programmes. Client apps send SQL statements to the server in order to accomplish this. Following processing of these statements, the server provides the client programme with result sets.
 

SELECT column1, column2 FROM table1, table2 WHERE column2='value';
SELECT * FROM student WHERE first_name='Smith';

Some point to be consider :

  • The SELECT retrive specifies one or more columns to be retrieved; to specify multiple columns, use a comma and a space between column names. To retrieve all columns, use the wild card * (an asterisk).
  •     The FROM retrive specifies one or more tables to be queried. Use a comma and space between table names when specifying multiple tables.
  •     The WHERE retrive selects only the rows in which the specified column contains the specified value. The value is enclosed in single quotes.
  • Semicolon (;) consider as end so it is the statement terminator.

Learning more about interview question and answer of  SQL query.


To learn more about SQL programming and interview question , Indiana University students, faculty, and staff can download materials for self-study from IT Training.

 

Article