Lesson objectives | define data types in database (SQL); |
Success criteria | Be able to use SELECT |
A query is a means of selecting the necessary information from the database. The question, formed with respect to the database, is the query.
SQL queries are queries that are compiled (programmers) from a sequence of SQL statements. These instructions specify what to do with the input data set to generate the output set. All Access requests are built on the basis of SQL queries, in order to view them, you must execute the View / SQL command in the active query design window.
SQL
SQL (structured query language) is a formal non-procedural language used to create, modify, and manage data in an arbitrary relational database
Initially, SQL was the main way the user worked with the database and allowed to perform the following set of operations:
creating a new table in the database;
adding new records to the table;
change records;
deletion of records;
selection of records from one or several tables (according to the specified condition);
change tables structures.
The language of data manipulation DML
DML - Data Manipulation Language. The language of data manipulation. Used to work with information stored in the database.
The main teams of this group are:
Select - readout of information.
Insert - adding information.
Update - information update.
Delete - delete information.
Data collection
SELECT * FROM Sumproduct
What will be the result?
SELECT Product FROM Sumproduct
SELECT Product, Quantity FROM Sumproduct
Sorting data
SELECT * FROM Sumproduct ORDER BY Amount
Filtering data
Advanced filtering (AND, OR)
SELECT * FROM Sumproduct WHERE Amount > 40000 AND City = 'Toronto'
What will be the result?
SELECT * FROM Sumproduct WHERE Month= 'April' OR Month= 'March'
Advanced filtering (operator IN)
SELECT * FROM Sumproduct WHERE ID IN (4, 12, 58, 67)
What will be the result?
SELECT * FROM Sumproduct WHERE NOT City IN ('Toronto', 'Montreal')
Материалы на данной страницы взяты из открытых источников либо размещены пользователем в соответствии с договором-офертой сайта. Вы можете сообщить о нарушении.