Posts

Showing posts from September, 2021

Magic of Algorithm header file in C++

In C++ Algorithm header file contains bountiful magical operations which are very important in competitive programming and take less time to write code. There are some predefined methods in the algorithm: 1. find(): This method helps to search an element in a vector or array. It will return the address to that particular index. We can calculate the index by subtracting the base address of the array from it. Syntax:          auto it = find(arr,arr+n,key);          int index= it-arr; 2. Upper bound and lower bound: upper_bound() return index to ending index of searched element. lower_bound() return first index of searched element. 3. reverse(): used to reverse a string 4. swap(): used to swap two values variables 5. sort(): sort an array or vector. By specify first address nd end element. Map: begin()  – Returns an iterator to the first element in the map end()  – Returns an iterator to the theoretical element that follows last e...

SQL Notes for Interview purpose

  SQL   DDL:   DDL is short name of Data Definition Language, which deals with database schemas and descriptions, of how the data should reside in the database.  ● CREATE - to create a database and its objects like (table, index, views, store procedure, function, and triggers)  ● ALTER - alters the structure of the existing database  ● DROP - delete objects from the database  ● TRUNCATE - remove all records from a table, including all spaces allocated for the records are removed  ● RENAME - rename an object  DML:   DML is short name of Data Manipulation Language which deals with data manipulation and includes most common SQL statements such SELECT, INSERT, UPDATE, DELETE, etc., and it is used to store, modify, retrieve, delete and update data in a database.  ● SELECT - retrieve data from a database  ● INSERT - insert data into a table  ● UPDATE - updates existing data within a table  ● DELETE - Delete all records from...