2. Retrieve

To get, or select, information from the database you will need the SELECT statement. It will return all the rows it finds and the columns you tell it to.

SELECT columna, columna2, ... FROM mi_tabla;

An example in action.

SELECT name FROM Artist;
...
Mela Tenenbaum, Pro Musica Prague & Richard Kapp
Emerson String Quartet
C. Monteverdi, Nigel Rogers - Chiaroscuro; London Baroque; London Cornett & Sackbu
Nash Ensemble
Philip Glass Ensemble
...

If I wanted all the columns of my table, I only have to add an asterisk instead of the columns.

SELECT * FROM mi_tabla;
SELECT * FROM Artist;

It returns both the id column and the name one.

1|AC/DC
2|Accept
3|Aerosmith
4|Alanis Morissette
5|Alice In Chains
6|Antônio Carlos Jobim
7|Apocalyptica
8|Audioslave
Activity 1

Work with the Customer table.

  1. Show the Email column.
  2. Show the FirstName column.
  3. Show the FirstName and LastName columns.
  4. Show the Address, Phone and Fax columns.
  5. Show all the columns.

Solutions

This work is under a Attribution-NonCommercial-NoDerivatives 4.0 International license.

Desafíos de programación atemporales y multiparadigmáticos

Desafíos de programación atemporales y multiparadigmáticos

Te encuentras ante un librillo de actividades, divididas en 2 niveles de dificultad. Te enfrentarás a los casos más comunes que te puedes encontrar en pruebas técnicas o aprender conceptos elementales de programación.

Buy the book

Will you buy me a coffee?

This is how I keep writing without ads or paywalls.

Comments

There are no comments yet.