Category: SQL

OUTER JOIN in SQL

INNER JOIN and EQ-JOIN show you just matched record and OUTER JOIN will also show you matched and un-matched record. There are three types of OUTER-JOIN LEFT OUTER JOIN RIGHT OUTER JOIN FULL OUTTER...

INNER JOIN in SQL

INNER JOIN is same as EQ-JOIN but you use INNER JOIN keyword and ON instead of WHERE. If you have same COLUMN-NAME in both table you can use USING keyword instead of = operator....

NON-EQ-JOIN in SQL

When you join Two or more than two tables without EQUALITY operator Or using ( >, < Between) Operators that’s called NON-EQ-JOIN. There is no PRIMARY and FOREIGN KEY relation in NON-EQ-JOIN Syntax: is...

EQ-JOIN IN SQL

When you join two table using EQUALITY (=) operator that’s called EQ-JOIN. The = operator should be between PRIMARYKEY and FOREIGN KEY. To get record using this join, you need to have same value...

CARTESIAN or CROSS JOIN IN SQL

Cartesian Join is also called cross join. This join give result by multiplying one row of Table A to all rows of Tale B. You will get (Table_A_Rows) x (Table_B_Rows). Suppose Table_A has 10...

ADD NEW COLUMN TO TABLE

Keywords: ALTER TABLE, ADD Syntax: Add Single Column ALTER TABLE table_name ADD column_Name dataType(size); Example: ALTER TABLE dept_049 ADD name Varchar2(20); Add Multiple Columns

Example:

DELETE or DROP COLUMN FROM TABLE

Keywords: ALTER TABLE, DROP COLUMN Syntax: DROP one column. ALTER TABLE TABLE_NAME DROP COLUMN COLUMN_NAME; Example: Alter Table dept_049 DROP COLUMN loc; DROP Multiple Columns. ALTER TABLE TABLE_NAME DROP ( col1, col2, …. );...

UPDATE RECORD IN TABLE

Keywords: UPDATE, SET, WHERE Syntax: Update all Rows. UPDATE Table_Name SET colName=’newValue’; Example: UPDATE emp_049 SET salary=5000; Update Specific Record. UPDATE Table_Name SET colName=’newValue’ WHERE Condition; Example: UPDATE emp_049 SET comm=3.4 WHERE salary>3000; Update...

DELETE RECORD FROM TABLE

Keywords: DELETE, FROM, WHERE Syntax: Delete all record/rows from table. DELETE FROM TABLE_NAME; Example: DELETE FROM dept_049 Delete specific Record/row from table. DELETE FROM TABLE_NAME WHERE CONDITION; Example: Delete from dept_049 where dept_id=20;

FETCH RECORD FROM TABLE

Keywords: SELECT, FROM, WHERE, * (to fetch all columns) Syntax: To Fetch all Rows and Columns SELECT * FROM table_name; Example: SELECT * FROM DEPT_049; Screen Shot: (Fetching/Getting all rows and columns from DEPT_049...