1. When two or more tables are joining without equal to condition then that join is known as Non Equi Join. Any operator can be used here that is <>,!=,<,>,Between. Example: Select b.Department_ID,b.Department_name from Employee a,Department b where a.Department_id <> b.Department_ID;
When a COMMIT is uded in a transaction all chnages made in the transaction are written into the database permanently. Example: BEGIN TRANSACTION; DELETE FROM HR.JobCandidate WHERE JobCandidateID = 20; COMMIT TRANSACTION; The above example deletes a job candidate in a SQL server.
The FULL OUTER JOIN combines the results of both left and right outer joins. The joined table will contain all records from both the tables and fill in NULLs for missing matches on either side.
The INNER JOIN creates a new result table by combining column values of two tables (table1 and table2) based upon the join-predicate. The query compares each row of table1 with each row of table2 to find all pairs of rows which satisfy the join-predicate.
“Order by 2” is valid when there are at least 2 columns used in SELECT statement. Here this query will throw error because only one column is used in the SELECT statement.
Primary Key is a constraint in SQL. So, before understanding what exactly is a primary key, let’s understand what exactly is a constraint in SQL. Constraints are the rules enforced on data columns on a table. These are used to limit the type of data that can go into a table.
A table can be joined to itself using self join, when you want to create a result set that joins records in a table with other records in the same table.
A hash table is typically an array of linked lists. When you want to insert a key/value pair, you first need to use the hash function to map the key to an index in the hash table. Given a key, the hash function can suggest an index where the value can be found or stored: This is often done in two steps:
There are two main approaches to handling collisions: chaining and open addressing .
Open addressing means that, once a value is mapped to a key that's already occupied, you move along the keys of the hash table until you find one that's empty. For example, if "John Smith" was mapped to 152, "Sandra Dee" will be mapped to the next open index:
The main drawback of chaining is the increase in time complexity.
A hash function is an algorithm that produces an index of where a value can be found or stored in the hash table. Some important notes about hash tables: Values are not stored in a sorted order. You mush account for potential collisions. This is usually done with a technique called chaining.