The SELECT TOP Clause Is Used To Specify The Number of Records To Return
The SELECT TOP Clause Is Used To Specify The Number of Records To Return
SELECT * FROM table_name;
3)AND & OR:- The AND & OR operators are used to filter records based on
more than one condition.
5)INSERT INTO:- The INSERT INTO statement is used to insert new records in a
table.
INSERT INTO table_name (column1,column2,column3,...)
VALUES (value1,value2,value3,...);
INSERT INTO table_name
VALUES (value1,value2,value3,...);
8)SELECT TOP:- The SELECT TOP clause is used to specify the number of records
to return.
9)LIKE:- The LIKE operator is used to search for a specified pattern in acolumn.
SELECT * FROM Customers WHERE City LIKE 's%';
SELECT * FROM Customers WHERE City LIKE '[bsp]%'; (starts with b,s,p)
11)IN: The IN operator allows you to specify multiple values in a WHERE clause.
SELECT * FROM Customers WHERE City IN ('Paris','London');
SELECT column_name AS alias_name FROM table_name;
INNER JOIN: Returns all rows when there is at least one match in BOTH
tables
LEFT JOIN: Return all rows from the left table, and the matched rows
from the right table
RIGHT JOIN: Return all rows from the right table, and the matched rows
from the left table
FULL JOIN: Return all rows when there is a match in ONE of the tables
2)The LEFT JOIN keyword returns all rows from the left table (table1), with
the matching rows in the right table (table2). The result is NULL in the right side
when there is no match.
SELECT column_name(s)
FROM table1
LEFT JOIN table2
ON table1.column_name=table2.column_name;
3) The RIGHT JOIN keyword returns all rows from the right table (table2),
with the matching rows in the left table (table1). The result is NULL in the left
side when there is no match.
SELECT column_name(s)
FROM table1
RIGHT JOIN table2
ON table1.column_name=table2.column_name;
4)The FULL OUTER JOIN keyword returns all rows from the left table (table1)
and from the right table (table2).
SELECT column_name(s)
FROM table1
FULL OUTER JOIN table2
ON table1.column_name=table2.column_name;
1)UNION:-The SQL UNION operator combines the result of two or more SELECT
statements.
each SELECT statement within the UNION must have the same number of
columns. The columns must also have similar data types. Also, the columns in
each SELECT statement must be in the same order
SELECT column_name(s) FROM table1 UNION SELECT column_name(s) FROM table2;
2)SELECT INTO:- The SELECT INTO statement selects data from one table and
inserts it into a new table.
SELECT *
INTO newtable [IN externaldb]
FROM table1;
SELECT column_name(s)
INTO newtable [IN externaldb]
FROM table1;
3)INSERT INTO SELECT:- The INSERT INTO SELECT statement selects data from
one table and inserts it into an existing table
INSERT INTO table2
SELECT * FROM table1;
INSERT INTO table2
(column_name(s))
SELECT column_name(s)
FROM table1;
5)DROP:-
if we only want to delete the data inside the table, and not the table itself
TRUNCATE TABLE table_name
6)ALTER :-