Shared Flashcard Set

Details

Built-in Data Types lesson 4 continued
These are the built-in data types as opposed to alias user defined data type-Microsoft SQL Server 2008 Exam 70-432
37
Computer Science
Undergraduate 4
09/21/2013

Additional Computer Science Flashcards

 


 

Cards

Term
Data types have a certain order, or precedence
Definition
This means when combining data types, implicit data conversion occurs, and the data type with the highest rank will be given priority.
Term

biging

Definition
8 bytes extremely large whole numbers
Term

binary

Definition
max 8000 bytes good for storing hex and binary shorthand, security identifiers, or photo
Term

varbinary

Definition
8000 Bytes max
Term

varbinary(max)

Definition
good for storing binary of JPEG or Microsoft Word docs
Term

bit 

 

 

Definition
stores no less than a byte first bit consumes BYTE, second bit fits in said BYTE the ninth bit requires the addition of a new byte (makes sense)
Term

char

Definition

a number can be stored as integer or character here

the numbers are seen as characters not numerics by SQL

            char (5) uses 5 BYTES of space

even if less is used

non-Unicode

Term

varchar 

Definition
8000 max characters non-Unicode
Term

date

Definition
3 bytes YYYY MM DD from 0001 year thru 9999 year
Term

datetime

Definition
8 bytes  Jan 1 1753 through Dec 31 9999 rounded .xxx increments of seconds
Term

datetime2

Definition
6-8 bytes   YYYY MM DD hh mmm ss ns ns ns ns ns ns
Term

datetimeoffset

Definition
8-10 bytes
Term

smalldatetime

Definition

4 bytes

 

Jan 1 1900 through June 6 2079

Term

time

 

 

Definition

no time zone

 

Term
timestamp
Definition
8 bytes
Term
Date and Time
Definition

date 3 bytes YYYY MM DD from 0001 year thru 9999 year

 

datetime 8 bytes  Jan 1 1753 through Dec 31 9999 rounded .xxx increments of seconds

 

datetime2 6-8 bytes   YYYY MM DD hh mmm ss ns ns ns ns ns ns

 

 

datetimeoffset 8-10 bytes

Term

decimal

Definition

aka numeric

precision and scales

 

precision of 5 and scale of 2

111.22

5 digits and 2 digits to the right of decimal

 

 

Term

vardecimal

Definition

only available on Enterprise edition

 

used for use of 5 to 22 bytes

Term

float

Definition
pi is an example
Term

geography

Definition

.NET common language runtime CLR data type

 

round earth coordinate system

 

            

    stores ellipsoidal (round-earth) data

 

like GPS latitude and longitude coordinates

Term

geometry

Definition
Euclidean flat coordinate system
Term

hierarchyid

Definition
organizational chart file system & graph of links between web pages
Term

int

Definition
4 bytes whole numbers
Term

smallint

Definition
2 bytes
Term

money

Definition
8 bytes
Term

smallmoney

Definition
4 bytes
Term

nchar

Definition

fixed length Unicode

 

used for Japanese Katakana and

 

German for example

Term

numeric

Definition
decimal
Term

nvarchar


nvarchar(max)

 


real

Definition

nvarchar

has

variable length Unicode max 4000 characters

Term

sql_variant

 

Definition

lets you store values of different data types

but not variable like

char(max),

nchar(max),

text,

image,

sql_variant itself,

varbinary(max)

xml

ntext

timestamp

user defined data types

 
Term

uniqueidentifier

Definition

16 bytes

 

NEWID() function

will create a globally unique identifier in hex

Term

Special Case Data Types

Definition

 

Filestream

  

Identity

 

Sysname

 

Term

Filestream

Definition

For binary (big documents images etc)

unstructured data

 

To bring in externally stored data (like documents and pictures)

 

In the OS’s NTFS file system

 

DB and that file’s location is maintained by

24 byte pointer

 

This needs at server level usage, be enabled as follows:

EXEC sp_configure filestream_access_level, 2

 

 

Term

Identity

Definition
Term

Sysname

Definition

 

Used by programmers for

TABLE COLUMNS,

VARIABLES,

STORED PROCEDURE PARAMETERS

They store object names

 

It’s like nvarchar(128)

 

However it is NOT NULL

Term

Cursor

Definition

      Return a complete set of rows for app to use

 

You can return a cursor from a stored procedure

 

You can store a cursor in a variable


You CANNOT stored it in a table

 

THIS IS A VARIABLE

 

IT IS NOT A DATA TYPE

Term

Table

Definition

THIS IS A VARIABLE

 

THIS IS NOT A DATA TYPE

 

Returns datasets (ROWS & COLUMNS)

from stored procedures

                

Returns datasets (ROWS & COLUMNS)

from functions

 

 

It can also store tables in variables


You CANNOT store a table

in another table's column

Supporting users have an ad free experience!