datatyps in posgresql

29

Upload: baabtracom-first-coding-school-in-india

Post on 10-May-2015

94 views

Category:

Technology


0 download

DESCRIPTION

Datatyps in posgresql

TRANSCRIPT

Page 1: Datatyps in posgresql
Page 2: Datatyps in posgresql

Disclaimer: This presentation is prepared by trainees of baabtra as a part of mentoring program. This is not official document of baabtra –Mentoring PartnerBaabtra-Mentoring Partner is the mentoring division of baabte System Technologies Pvt . Ltd

Page 3: Datatyps in posgresql

Title of the presentation

Page 4: Datatyps in posgresql

• PostgreSQL has a rich set of native data types available to users. Users may add new types to PostgreSQL using the CREATE TYPE command.

Page 5: Datatyps in posgresql

Major Data types

Page 6: Datatyps in posgresql

Numeric Types

Page 7: Datatyps in posgresql

Numeric Types

•Data Types• Smallint :- 2 bytes,• integer :- 4 bytes• bigint :- 8 bytes• Store whole numbers • Attempts to store values outside of the allowed range will result in an error.•Example• Smallint :- sint_type_room • integer :- fk_int_voucher_no• bigint :- pk_bigint_cu_id bigint

Page 8: Datatyps in posgresql

Numeric Types•Data Type

• numeric can store numbers with up to 1000 digits of precision and perform calculations exactly. • It is very slow compared to the floating-point

•Syntax: NUMERIC(precision, scale)• decimal :- is equavalent to numeric in sql standard.

Example monetary amounts.

Page 9: Datatyps in posgresql

Numeric Types• Data types

•real •double precision these types are usually for Binary Floating-Point ArithmeticPostgreSQL also supports the SQL-standard notations float and float(p)

Example prize_per_room, total_amount, balance_amount etc

Page 10: Datatyps in posgresql

Numeric TypesData Type

•serial notational convenience for creating unique identifier columns .

SyntaxCREATE TABLE tablename ( colname SERIAL );

ExampleCREATE TABLE

tbl_customer(pk_bint_cu_id bigint primary key serial);

Page 11: Datatyps in posgresql

Character Types

Character Types• character varying(n)– varchar(n)variable-length with limitcharacter(n)– char(n)fixed-length

• Example name,place,email Special Character Types– "char“ :-1 byte

• single-byte internal type

– Name:-64 bytes internal type for object name

Page 12: Datatyps in posgresql

Date/Time Types

Page 13: Datatyps in posgresql

Date/Time Types

Page 14: Datatyps in posgresql

Date/Time Types

Page 15: Datatyps in posgresql

Date/Time Types

Page 16: Datatyps in posgresql

Date/Time Types

Page 17: Datatyps in posgresql

Boolean Type

Page 18: Datatyps in posgresql

Monetary Types

Page 19: Datatyps in posgresql

Binary Data Types

Page 20: Datatyps in posgresql
Page 21: Datatyps in posgresql

Boolean Type

Page 22: Datatyps in posgresql

Geometric Types

Page 23: Datatyps in posgresql

Network Address Types

Page 24: Datatyps in posgresql

Network Address Types

Page 25: Datatyps in posgresql

Bit String Types

Page 26: Datatyps in posgresql

Arrays

Page 27: Datatyps in posgresql

Pseudo-Types

Page 28: Datatyps in posgresql

If this presentation helped you, please visit our page facebook.com/baabtra and like it.

Thanks in advance.

www.baabtra.com | www.massbaab.com |www.baabte.com

Page 29: Datatyps in posgresql

Contact Us