Data Flashcards

1
Q

SELECT statement example

A
  • SELECT [columms]
  • FROM [tables]
  • WHERE [search_condition]
  • ORDER BY [order_expresssion ASC | DESC]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

WHERE with text values

A
  • Requires apostrophes around the value
  • Example:
    • ‘XX’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

WHERE additional operators

A
  • AND
  • <
  • >
  • LIKE
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q
  • All strings that start with X
  • All strings that end with X
  • All strings that contain with X
  • All strings that start with X, Y or Z
A
  • LIKE ‘X%’
  • LIKE ‘%X’
  • LIKE ‘%X%’
  • LIKE ‘[XYZ]’
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

SQL aggregate functions

A
  • AVG - Returns the average value
  • COUNT - Returns the number of rows
  • FIRST - Returns the first value
  • LAST - Returns the last value
  • MAX - Returns the largest value
  • MIN - Returns the smallest value
  • SUM - Returns the sum
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

SQL scalar functions

A
  • UCASE - Converts a field to upper case
  • LCASE - Converts a field to lower case
  • MID - Extract characters from a text field
  • LEN - Returns the length of a text field
  • ROUND - Rounds a numeric field to the number of decimals specified
  • NOW - Returns the current system date and time
  • FORMAT - Formats how a field is to be displayed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

UPDATE statement example

A
  • UPDATE [table]
  • SET [update_expression]
  • WHERE [search_condition]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

INSERT statement example

A
  • INSERT INTO [table] ([colum_list])
  • VALUES ([value_list])
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

DELETE statement example

A
  • DELETE FROM [table]
  • WHERE [search_condition]
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

ADO.NET Namespaces for SQL Server Data Access

A
  • System.Data.SqlClient
  • System.Data.SqlTypes
  • System.Data
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How to insert a backslash

(C# assumes that every backslash is the start fo a special character)

A
  • Use two backslash: \
  • Put the @ character before the entire string: @”string
How well did you know this?
1
Not at all
2
3
4
5
Perfectly