EXAM Flashcards
What is an IDENTITY clause?
Tells SQL Server to autogenerate numbers
What is the IDENTITY clause syntax?
IDENTITY(start_num, increment_num) ex IDENTITY(1, 1) starts at 1 and increments by 1
What are 3 ways the UPDATE statement is used?
- Update multiple columns on one row
- Update one column on multiple rows
- Update multiple columns on multiple rows
What are the ACID principles?
Atomicity
Consistency
Isolation
Durability
What is meant by atomicity?
All or nothing
What do you use transactions?
When doing multiple updates to a database
What is T-SQL?
Transact SQL
How do you see open transactions?
@@TRANSCOUNT
What kind of join returns results if there is NULL data?
Outer Join
What is a LEFT OUTER JOIN?
If the first table listed has no corresponding rows on the second table listed, display NULL
What is the syntax for an OUTER join?
LEFT or RIGHT [OUTER] JOIN
[OUTER] is optional
What is the syntax for SUBSTRING?
SUBSTRING(string, start pos, length)
What does CHARINDEX return?
An integer
What is the syntax for CHARINDEX?
CHARINDEX(string to find, string, [start position])
What is the syntax for REPLACE?
REPLACE(string, old string, new string)
What is the LEN function?
Length, returns the length of a String
How do you substitute a NULL in a SELECT statement?
ISNULL(column, ‘replacement string’)
What is the syntax to format currency?
FORMAT(column, ‘C’, ‘en-us)
What is the syntax for formatting dates?
FORMAT(column, ‘MMM-dd-yy’)