A data type in programming

is a classification that specifies which type of value a variable has and what type of mathematical, relational or logical operations can be applied to it without causing an error.

integer
is a data type that is used to classify text and an integer is a data type used to classify whole numbers. 
example : 7, 12, 999
code : result:4*78

string
Alphanumeric characters
example: hello world, Alice, Bob123
code: address = "bandar seri begawan  26"

Decimal 
number with decimal 
code: price:1.50


Boolean
Representing logical values
example:  true, false, yes, no 
code: x=2 , y=12

float 
Number with a decimal point but longer
example:3.15, 9.06, 00.13
code: 

List 
The list data type is an not in ordered collection type that stores unique elements. The number of elements in a list data type can vary, but no nulls are allowed.

code = list1 [1,2,3,'a','b'];
CREATE TABLE employee 
   ( 
      name char(30), 
      address char(40), 
      children SET (varchar(30) NOT NULL) 
   );

#print ("hello World")

myvar = 1
print (myvar)

#string data type
fruit = "apple"
print (fruit)

#decimal data type 
price = 1.50 
print (price)

#list data type 
list1 = [1,2,3,'a','b'];
print (list1)
print ("list1")
#show a only
print (list1[3])

a= 1 
b = 5 
c = a + b 
print (c)

d= 4
e= d + a 
print (e)


1
apple
1.5
[1, 2, 3, 'a', 'b']
list1
a
6
5




SearchMicroservices. (2017). What is data type? - Definition from WhatIs.com. [online] Available at: http://searchmicroservices.techtarget.com/definition/data-type [Accessed 10 Oct. 2017].


Ibm.com. (2017). IBM Knowledge Center. [online] Available at: https://www.ibm.com/support/knowledgecenter/en/SSGU8G_12.1.0/com.ibm.mig.doc/ids_mig_152.htm [Accessed 10 Oct. 2017].


Comments

Popular posts from this blog

WD&D (DNS)

kclothings.org

WDD-LO1-server