0% found this document useful (0 votes)
52 views

Create Table Insert Into Select Update Alter Table Delete From

This document summarizes common SQL commands and functions used for managing and querying data in relational databases. It describes commands for creating, modifying, and deleting tables; inserting, updating, and deleting rows; selecting data with conditions, sorting, and limits; aggregate functions for counting, summing, finding max/min/average values; primary keys for unique row identification; foreign keys for linking tables; and joins for combining data across tables. Keywords like SELECT, WHERE, GROUP BY, ORDER BY, LIMIT, COUNT, SUM, MAX, MIN, AVG, ROUND, INNER JOIN, LEFT OUTER JOIN and AS are explained in the context of SQL queries and data management.

Uploaded by

Danut Jurj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views

Create Table Insert Into Select Update Alter Table Delete From

This document summarizes common SQL commands and functions used for managing and querying data in relational databases. It describes commands for creating, modifying, and deleting tables; inserting, updating, and deleting rows; selecting data with conditions, sorting, and limits; aggregate functions for counting, summing, finding max/min/average values; primary keys for unique row identification; foreign keys for linking tables; and joins for combining data across tables. Keywords like SELECT, WHERE, GROUP BY, ORDER BY, LIMIT, COUNT, SUM, MAX, MIN, AVG, ROUND, INNER JOIN, LEFT OUTER JOIN and AS are explained in the context of SQL queries and data management.

Uploaded by

Danut Jurj
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

CREATE TABLE

INSERT INTO

SELECT

queries data from a table.

UPDATE

edits a row in a table.

ALTER TABLE

DELETE FROM

creates a new table.

adds a new row to a table.

changes an existing table.


deletes rows from a table.

is the clause you use every time you want to query


information from a database.

is a popular command that lets you filter the results of the


query based on conditions that you specify.

and BETWEEN are special operators that can be used in


a WHEREclause

and OR are special operators that you can use with WHERE to
filter the query on two or more conditions.

lets you sort the results of the query in either ascending or


descending order.

lets you specify the maximum number of rows that the query
will return. This is especially important in large tables that have thousands
or even millions of rows.

SELECT

WHERE

LIKE

AND

ORDER BY

LIMIT

Aggregate functions combine multiple rows together to form a single


value of more meaningful information.

COUNT

takes the name of a column(s) as an argument and counts the


number of rows where the value(s) is not NULL.

GROUP BY

SUM()

MAX()

MIN()

AVG()

ROUND()

is a clause used with aggregate functions to combine data


from one or more columns.
takes the column name as an argument and returns the sum of
all the values in that column.
takes the column name as an argument and returns the largest
value in that column.
takes the column name as an argument and returns the
smallest value in that column.
takes a column name as an argument and returns the average
value for that column.
takes two arguments, a column name and the number of
decimal places to round the values in that column.

Primary Key is a column that serves a unique identifier for row in the
table. Values in this column must be unique and cannot be NULL.

Foreign Key is a column that contains the primary key to another


table in the database. It is used to identify a particular row in the
referenced table.

Joins are used in SQL to combine data from multiple tables.

will combine rows from different tables if the join


conditionis true.

will return every row in the left table, and if the join
condition is not met, NULL values are used to fill in the columns from
theright table.

is a keyword in SQL that allows you to rename a column or table


in the result set using an alias.

INNER JOIN

LEFT OUTER JOIN

AS

You might also like