The SELECT statement is used to select data from a database.
The result is stored in a result table, called the result-set. ans: SELECT column_name,column_name
FROM table_name;
SELECT * FROM table_name;
The SEL
...
The SELECT statement is used to select data from a database.
The result is stored in a result table, called the result-set. ans: SELECT column_name,column_name
FROM table_name;
SELECT * FROM table_name;
The SELECT DISTINCT statement is used to return only distinct (different) values ans: SELECT DISTINCT column_name,column_name
FROM table_name;
The WHERE clause is used to extract only those records that fulfill a specified criterion. ans: SELECT column_name,column_name
FROM table_name
WHERE column_name operator value;
he AND operator displays a record if both the first condition AND the second condition are true.
The OR operator displays a record if either the first condition OR the second condition is true. ans: SELECT * FROM Customers
WHERE Country='Germany'
AND City='Berlin';
The ORDER BY keyword is used to sort the result-set. ans: SELECT column_name, column_name
FROM table_name
ORDER BY column_name ASC|DESC, column_name ASC|DESC;
The INSERT INTO statement is used to insert new records in a table. ans: INSERT INTO table_name (column1,column2,column3,...)
VALUES (value1,value2,value3,...);
The UPDATE statement is used to update records in a table. ans: UPDATE table_name
SET column1=value1,column2=value2,...
WHERE some_column=some_value;
The DELETE statement is used to delete records in a table. ans: DELETE FROM table_name
WHERE some_column=some_value;
SQL injection is a technique where malicious users can inject SQL commands into an SQL statement, via web page input.
Injected SQL commands can alter SQL statement and compromise the security of a web application. ans: txtUserId = getRequestString("UserId");
txtSQL = "SELECT * FROM Users WHERE UserId = " + txtUserId;
[Show More]