quinta-feira, 5 de abril de 2018

sql select

abril 05, 2018 Posted by Unknown No comments
sql select
Querying Data with SQL (SELECT Command)
Database Blog Development
Facebook Twitter Google+ Share
Querying Data with SQL (SELECT Command)
This post is aimed at those who are starting in the relational database world, as well as in the SQL language. So the focus is on teaching you a bit of the basics: using the SELECT command, what it is for and how to do it.
SELECT command
To extract data from a database you will need to use SQL (structured query language) commands, SELECT, just as you may need to restrict which columns are displayed. In this text, you will know all the SQL commands required to perform these actions, as well as the use of plsql commands to execute SQL commands.

The basic syntax of the query statement in SQL is:


SELECT coluna1, coluna2,....colunaN
FROM tabela;
1
2
SELECT coluna1, coluna2,....colunaN
FROM tabela;
 The query looks for data from certain tables, such as those exemplified below:


Now, see an example query statement in SQL (basic model)

MySQL

SELECT id_aluno, nome, email, dtcadastro
FROM aluno;
1
2
SELECT id_aluno, nome, email, dtcadastro
FROM aluno;
Basic command:

MySQL

SELECT columns
FROM table;
1
2
SELECT columns
FROM table;
In its simplest form, a SELECT statement must include the following:

A SELECT clause that specifies which columns to display.
A FROM clause that specifies the tables that have the columns listed in the SELECT clause.
In the syntax:
SELECT: is a list of one or more columns.
Column: selects the named column.
FROM table: Specifies the table that contains the columns.

0 comentários:

Postar um comentário