SQL Flashcards
How should you differentiate text, number and date values in a query?
Text should use quotation marks (“ … “)
Number must not use quotation marks ( 92 )
Data must use hashtags (#6/14/2004#)
What are and how would you use wildcard operators in SELECT queries?
Asterisk () can be used to represent any number of characters. I.e. any number starting with 519 is [ LIKE “519”
Question marks (?) are like asterisks but represent single value placeholders. I.e. 4 numbers in between 1 and 9 would is [ LIKE “1????9”]
How would you order a query by say, first name?
end statement with ORDER BY Firstname;
What are 5 built-in functions with SELECT queries?
- Max
- Min
- Avg
- Count
- Sum
When are semi-colons needed at the end of an SQL statement?
In MS-Access SQL: OPTIONAL
In MS SQL Server: MANDATORY
What are the four types of SQL Action queries?
- INSERT INTO
- DELETE
- UPDATE
- CREATE TABLE
Write the syntax for UPDATE actions.
UPDATE
SET =
WHERE
;
Write the syntax for INSERT actions.
INSERT INTO
(, )
VALUES
(, );
Write syntax for DELETE actions.
DELETE *
FROM
WHERE
Write syntax for CREATE TABLE actions.
CREATE TABLE
( , etc.)