AIM: Study data types in SQL and usage of various Data Definition Language commands. PROCEDURE: What is SQL? SQL is structured Query Language which is a computer language for storing, manipulating and retrieving data stored in relational database. SQL is the standard language for Relation Database System. All relational database management systems like MySQL, MS Access, Oracle, Sybase, Informix, postgres and SQL Server uses SQL as standard database language. Also they are using different dialects, Such as: • MS SQL Server using T-SQL, • Oracle using PL/SQL, • MS Access version of SQL is called JET SQL (native format )etc Why SQL? • Allow users to access data in relational database management systems. • Allow users to describe the data. • Allow users to define the data in database and manipulate that data. • Allow to embed within other languages using SQL modules, libraries & pre-compilers. • Allow users to create and drop databases and tables. • Allow users to create view, stored procedure, functions in a database. • Allow users to set permissions on tables, procedures, and views History: • 1970 -- Dr. E.F. "Ted" of IBM is known as the father of relational databases. He described a relational model for databases. • 1974 -- Structured Query Language appeared. • 1978 -- IBM worked to develop Codd's ideas and released a product named System/R. • 1986 -- IBM developed the first prototype of relational database and standardized by ANSI. The first relational database was released by Relational Software and its later becoming Oracle.
1
DATA TYPES: Data Type integer smallint numeric decimal Real double precision Float character character varying Bit bit varying Date Time timestamp time with time zone timestamp with time zone year-month interval day-time interval Syntax Integer Smallint numeric(p,s) decimal(p,s) Real Explanation (if applicable)
Where p is a precision value; s is a scale value. For example, numeric(6,2) is a number that has 4 digits