Cert - DA - SQL
Cert - DA - SQL
2 BIG DATA AND DATA ANALYTICS 6 MAINSTREAM TOOLS AND KEY APPLICATIONS
What is SQL?
SQL stands for Structured Query Language
SQL lets you access and manipulate databases
SQL became a standard of the American National Standards Institute (ANSI) in
1986, and of the International Organization for Standardization (ISO) in 1987
The WHERE clause is not only used in SELECT statements, it is also used in UPDATE, DELETE, etc.!
The ORDER BY keyword sorts the records in ascending order by default. To sort the
records in descending order, use the DESC keyword.
SELECT MAX(column_name)
SELECT MAX(Price) AS LargestPrice
FROM table_name
FROM Products;
WHERE condition;
The SQL COUNT(), AVG() and SUM() Functions
The COUNT() function returns the number of rows that matches a specified criterion.
SELECT COUNT(column_name)
SELECT COUNT(ProductID)
FROM table_name
FROM Products;
WHERE condition;
SELECT SUM(column_name)
FROM table_name SELECT SUM(Quantity)
WHERE condition; FROM OrderDetails;
SELECT column_name(s)
FROM table_name
WHERE column_name IN (SELECT STATEMENT);
UPDATE table_name
SET column1 = value1, column2 = value2, ...
WHERE condition;
UPDATE Customers
SET ContactName = 'Alfred Schmidt', City= 'Frankfurt'
WHERE CustomerID = 1;
Be careful when updating records. If you omit the WHERE clause, ALL records will
be updated!
The SQL DELETE Statement
The DELETE statement is used to delete existing records in a table.
https://www.w3schools.com/sql/default.asp