Set - 2

Question 11 :

Operators used in SELECT statements.

Answer :

= Equal
<> or != Not equal
> Greater than
< Less than
>= Greater than or equal
<= Less than or equal
BETWEEN an inclusive range
LIKE Search for a pattern


Question 12 :

SELECT statements:

Answer :

SELECT column_name(s) FROM table_name
SELECT DISTINCT column_name(s) FROM table_name
SELECT column FROM table WHERE column operator value
SELECT column FROM table WHERE column LIKE pattern
SELECT column,SUM(column) FROM table GROUP BY column
SELECT column,SUM(column) FROM table GROUP BY column HAVING SUM(column) condition value
Note that single quotes around text values and numeric values should not be enclosed in quotes. Double quotes may be acceptable in some databases.


Question 13 :

The SELECT INTO Statement is most often used to create backup copies of tables or for archiving records?

Answer :

SELECT column_name(s) INTO newtable [IN externaldatabase] FROM source
SELECT column_name(s) INTO newtable [IN externaldatabase] FROM source WHERE column_name operator value


Question 14 :

The INSERT INTO Statements:

Answer :

INSERT INTO table_name VALUES (value1, value2,....)
INSERT INTO table_name (column1, column2,...) VALUES (value1, value2,....)


Question 15 :

The Update Statement:

Answer :

UPDATE table_name SET column_name = new_value WHERE column_name = some_value