Laboratory Activity: Data Types

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 2

Laboratory Activity: Data Types

In computer science and computer programming, a data type or simply type is a classification identifying
one of various types of data, such as real, integer or Boolean, that determines the possible values for that
type; the operations that can be done on values of that type; the meaning of the data; and the way values
of that type can be stored.

Research about the different common data types given below and give a brief definition of each data type.

DATA TYPE DEFINITION/USAGE SAMPLE ATTRIBUTES/OBJECTS


THAT CAN BE STORED (2 EACH)
1. tinyint Tinyint is an integer data type that has 1 Byte -Age of a person
storage space with range from -128 to 127 value. -Student Grades
2. integer basically, represents whole numbers (no -GPA
fractional parts). -calculate how many students needs
to graduate
3. bit an integer data type that can take a value of 0, 1, -gender
or NULL -true or false
4. real is numerical data which contains decimal -Weight in Kg
numbers. It would be used when extra detail is -Room measurement in meters
required and a whole number would not provide
enough information.
5. double a fundamental data type built into the compiler -Programming
and used to define numeric variables holding
numbers with decimal points
6. float a data type composed of a number that is not an -time
integer, because it includes a fraction -currency
represented in decimal format.
7. decimal an exact numeric data type defined by its
precision (total number of digits) and scale
(number of digits to the right of the decimal
point).
8. numeric are numbers stored in database columns. -height
-weight
-age
-IQ
9. char stores character data in a fixed-length field. -name
-sentences
10. varchar character data that is varying. Also known as -Name
Variable Character, it is an indeterminate length -Gender
string data type. -Age
11. date stores the calendar date. DATE data types require -3-letter month
four bytes. -2-digit year
12. time a time in hour, minutes, seconds, optional -8:26:33 a.m.
fractions of a second, and optional time zone. -2:26 p.m.
13. year a 1-byte type used to represent year values. -2021
-21
14. datetime used for values that contain both date and time -year-month-day
parts. -day of the week
15. blob a varying-length binary string that can be up to -photo album
2,147,483,647 characters long. -store objects such as audio files,
and video clips
16. text stores any kind of text data. It can contain both -ZIP Codes
single-byte and multibyte characters that the
locale supports.
17. enum a special data type that enables for a variable to -Compass directions
be a set of predefined constants. -the days of the week
18. set an abstract data type that can store unique -colors
values, without any order. It is a computer -employee
implementation of the mathematical concept of a
finite set.
19. binary a statistical data type consisting of categorical -.txt
data that can take exactly two possible values -jpeg
20. varbinary a variable width data type.
21. point a spreadsheet with each cell containing a - Calculate the distance from a point
predefined number of data values. each house
22. linestring a set of points joined sequentially together, -map items such as roads, trails, and
optionally with an SRID. circuit paths.
23. polygon used to represent areas such as the boundary of a - Calculate how much fencing each
city owner must buy to cover their
property
24. geometry Stores data based on a flat (Euclidean) coordinate -rectangle
system. Compound line string
25. multipoint represents one or more locations on the Earth as - Manage trees with a park area as
a WGS84 Latitude and Longitude. separate points but grouped
together

You might also like