Posts

Showing posts with the label database

DATATYPES in sql || Sql Tutorial -5

DATATYPES IN SQL  The data type represents the type of data to be entered into a column and Db engine can assign memory for thevalue entered into the column. There are 5 types of DataType in sql. String DataTypes Numeric DataTypes Date Datatypes Binary DataTypes LOB--Large Objects String Data Types These data types support sequence of character, digits and any symbol from keyboard. CHAR(size) It is used to store fixed length character strings. By default the size is 1 character, and max size is 2000 chars orbytes. Ex: student_id, email, address and so on VARCHAR2(size) It is used to store variable length character strings. No default size. we should specify size and max size is 4000 chars /bytes. Ex: emp names, addresses, descriptions, city names. LONG It is used to store variable length char data(similar to varchar2 data type) but max size is 2 GB NOTE: Only one long type column is allowed per a table. 1) NUMBER(Precision, [Scale])    It is used to store numb

SQL COMMANDS || Oracle SQL COMMANDS Sql Tutorial -3

Types of SQL commands 1) DDL(data definition language) commands:       Used to create or change or delete any data base objects CREATE ALTER DROP TRUNCATE RENAME 2) DML(data manipulation language) COMMANDS       Used to fetch data / enter new data/ changing existed data / deleting the data from table. INSERT  UPDATE  DELETE  TRUNCATE 3) DRL(dataretrieval language) Command     SELECT (logicalcommand) 4) DCL(DATA CONTROL LANGUAGE) COMMANDS     Used to control the access of data base objects. These commands are used by DBA (databaseadministrator) GRANT  REVOKE 5) TCL(TRANSACTION CONTROL LANGUAGE) COMMANDS      Used to save or cancel the actions/transactions made on table data. COMMIT  ROLLBACK  SAVEPOINT