Discuss the various PL/ SQL scalar data types available to store specific kinds of data with the use of examples. (10 marks)
PL/SQL scalar data types:
Number Types: let you store numeric data (integers, real numbers, and floating-point numbers), represent quantities, and do calculations
example: NUMBER Datatype: stores fixed-point or floating-point numbers with absolute values in the range 1E-130 up to (but not including) 1.0E126
NUMBER[(precision,scale)]
Character and String Types: let you store alphanumeric data, represent words and text, and manipulate character strings
example: CHAR Datatype: store fixed-length character data. How the data is represented internally depends on the database character set
CHAR[(maximum_size [CHAR | BYTE] )]
LOB Types: store blocks of unstructured data, such as text, graphic images, video clips, and sound waveforms.
example: BFILE datatype: store large binary objects in operating system files outside the database
Boolean Types: representing Boolean values (true and false)
example: store the logical values TRUE, FALSE, and NULL
Date, Time, and Interval Types:
example: DATE datatype: store fixed-length datetimes, which include the time of day in seconds since midnight
Comments
Leave a comment