Monthly Archive:: February 2016

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:
Read More >>

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, …. ); Example: ALTER TABLE dept_049 DROP(dname,loc); Note: You can’t
Read More >>

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
Read More >>

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;
Read More >>

Prime Number Program in C++

This program get the number and check is it primer number or not. The logic of this program is that it will take number and will divide the given number to all sub numbers up to 2 and less than given number. You need just a single loop to check primer number using this logic.  
Read More >>

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 table) To Fetch Specific Columns of all Rows SELECT column1, column2 FROM table_n
Read More >>

INSERT VALUES INTO TABLE

Keywords: INSERT INTO, VALUES Syntax: To insert value into all columns INSERT INTO TABLE_NAME VALUES(c1value, c2value……); Example: INSERT INTO DEPT_049(1,’SE’,’B-BLOCK’); It will required all columns’ value. If you want to skip value for specific columns use below Syntax. INSERT INTO T
Read More >>

Matrix Solved in C++

Here is the code that will solve the matrix. You need just 3 loops to solve the matrix. You can change rows and columns on your desire or requirement. Matrix Solved Program in C++  
Read More >>