Difference between revisions of "Select Queries"

From TRCCompSci - AQA Computer Science
Jump to: navigation, search
Line 3: Line 3:
 
* Allows selection from multiple tables but not multiple databases.
 
* Allows selection from multiple tables but not multiple databases.
  
 
+
==The Basic Construct==
 
  <syntaxhighlight lang=sql>
 
  <syntaxhighlight lang=sql>
 
   SELECT `data` FROM `TABLE`
 
   SELECT `data` FROM `TABLE`

Revision as of 16:45, 15 December 2016

  • Used for fetching information from an SQL database.
  • 'Outputs' the data once successfully selected
  • Allows selection from multiple tables but not multiple databases.

The Basic Construct

  SELECT `data` FROM `TABLE`
  WHERE `Condtion`
  ORDER BY `TABLE` ASC / DESC ;