Written by students who passed Immediately available after payment Read online or as PDF Wrong document? Swap it for free 4.6 TrustPilot
logo-home
Exam (elaborations)

SQL COMMANDS LATEST STUDY GUIDE

Rating
-
Sold
-
Pages
7
Grade
A+
Uploaded on
23-05-2022
Written in
2021/2022

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 Read less
Institution
Course

Content preview

SQL COMMANDS LATEST STUDY GUIDE
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;

, The SELECT TOP clause is used to specify the number of records to return.

The SELECT TOP clause can be very useful on large tables with thousands of records. Returning a large
number of records can impact on performance. ans: SELECT TOP number|percent column_name(s)
FROM table_name;

The LIKE operator is used in a WHERE clause to search for a specified pattern in a column. ans: SELECT
column_name(s)
FROM table_name
WHERE column_name LIKE pattern;

% A substitute for zero or more characters
_ A substitute for a single character
[charlist] Sets and ranges of characters to match
[^charlist]
or
[!charlist] Matches only a character NOT specified within the brackets ans: SQL wildcards

The IN operator allows you to specify multiple values in a WHERE clause. ans: SELECT column_name(s)
FROM table_name
WHERE column_name IN (value1,value2,...);

The BETWEEN operator selects values within a range. The values can be numbers, text, or dates. ans:
SELECT column_name(s)
FROM table_name
WHERE column_name BETWEEN value1 AND value2;

SQL aliases are used to give a database table, or a column in a table, a temporary name.

Basically aliases are created to make column names more readable ans: SELECT column_name AS
alias_name
FROM table_name;

The INNER JOIN keyword selects all rows from both tables as long as there is a match between the
columns in both tables. ans: SELECT column_name(s)
FROM table1
INNER JOIN table2
ON table1.column_name=table2.column_name;

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. ans: SELECT column_name(s)
FROM table1
LEFT JOIN table2
ON table1.column_name=table2.column_name;

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. ans: SELECT column_name(s)
FROM table1

Written for

Course

Document information

Uploaded on
May 23, 2022
Number of pages
7
Written in
2021/2022
Type
Exam (elaborations)
Contains
Questions & answers

Subjects

$7.99
Get access to the full document:

Wrong document? Swap it for free Within 14 days of purchase and before downloading, you can choose a different document. You can simply spend the amount again.
Written by students who passed
Immediately available after payment
Read online or as PDF

Get to know the seller

Seller avatar
Reputation scores are based on the amount of documents a seller has sold for a fee and the reviews they have received for those documents. There are three levels: Bronze, Silver and Gold. The better the reputation, the more your can rely on the quality of the sellers work.
Classroom NURSING
Follow You need to be logged in order to follow users or courses
Sold
4874
Member since
4 year
Number of followers
3232
Documents
55394
Last sold
1 day ago
NURSING

Assignments, Case Studies, Research, Essay writing service, Questions and Answers, Discussions etc. for students who want to see results twice as fast. I have done papers of various topics and complexities. I am punctual and always submit work on-deadline. I write engaging and informative content on all subjects. Send me your research papers, case studies, psychology papers, etc, and I’ll do them to the best of my abilities. Writing is my passion when it comes to academic work. I’ve got a good sense of structure and enjoy finding interesting ways to deliver information in any given paper. I love impressing clients with my work, and I am very punctual about deadlines. Send me your assignment and I’ll take it to the next level. I strive for my content to be of the highest quality. Your wishes come first— send me your requirements and I’ll make a piece of work with fresh ideas, consistent structure, and following the academic formatting rules. For every student you refer to me with an order that is completed and paid transparently, I will do one assignment for you, free of charge!!!!!!!!!!!!

Read more Read less
4.0

1185 reviews

5
624
4
216
3
196
2
40
1
109

Why students choose Stuvia

Created by fellow students, verified by reviews

Quality you can trust: written by students who passed their tests and reviewed by others who've used these notes.

Didn't get what you expected? Choose another document

No worries! You can instantly pick a different document that better fits what you're looking for.

Pay as you like, start learning right away

No subscription, no commitments. Pay the way you're used to via credit card and download your PDF document instantly.

Student with book image

“Bought, downloaded, and aced it. It really can be that simple.”

Alisha Student

Working on your references?

Create accurate citations in APA, MLA and Harvard with our free citation generator.

Working on your references?

Frequently asked questions