Computer Science > QUESTIONS & ANSWERS > SQL COMMANDS LATEST STUDY GUIDE (All)
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 ta... ble_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]
Last updated: 1 year ago
Preview 1 out of 7 pages
Connected school, study & course
About the document
Uploaded On
May 23, 2022
Number of pages
7
Written in
This document has been written for:
Uploaded
May 23, 2022
Downloads
0
Views
53
In Browsegrades, a student can earn by offering help to other student. Students can help other students with materials by upploading their notes and earn money.
We're available through e-mail, Twitter, Facebook, and live chat.
FAQ
Questions? Leave a message!
Copyright © Browsegrades · High quality services·