h...........12/3/2019 - 1/4/19
i............7/3/2019- 27/3/19



Numerical analysis
4 way search tree with child pointer and record pointer (problem with mbay search tree is creation of node under the guideline can be done in any way)
About b tree:
here is cp and bp  both
B+ tree
B++ tree theory part
Note:
<v1,R1,> value and record pointer
Note:
  • A B/B+ tree with order p has maximum p pointers and hence maximum p children.
  • A B/B+ tree with order p has minimum ceil(p/2) pointers and hence minimum ceil(p/2) children.
  • A B/B+ tree with order p has maximum (p – 1) and minimum ceil(p/2) – 1 keys.

What is SQL?
SQL stands for Structured Query Language. It is a language used to interact with the database, i.e to create a database, to create a table in the database, to retrieve data or update a table in the database etc. SQL is an ANSI(American National Standards Institute) standard.
What is a Database?
A Database is defined as a structured form of data which is stored in a computer or data in an organised manner and can be accessed in various ways. It is also the collection of schemas, tables, queries, views etc. Database helps us in easily storing, accessing and manipulation of data held in a computer. The Database Management System allows a user to interact with the database.

Does SQL support programming language features ?
It is true that SQL is a language but it does not support programming as it is not a programming language, it is a command  language. We do not have conditional statements in SQL like for loops or if..else, we only have commands which we can use to query, update , delete etc. data in the database. SQL allows us to manipulate data in a database.
What is the difference between BETWEEN and IN operators in SQL?
SELECT * FROM Students
WHERE ROLL_NO BETWEEN 20 AND 30;
This query will select all those rows from the table Students where the value of the field ROLL_NO lies between 20 and 30.
SELECT * FROM Students  WHERE ROLL_NO IN (20,21,23);
This query will select all those rows from the table Students where the value of the field ROLL_NO is either 20 or 21 or 23.

Write an SQL query to find names of employee start with ‘A’?
SELECT * FROM Employees WHERE EmpName like 'A%' ;
What is the difference between CHAR and VARCHAR2 datatype in SQL?
Both of these datatypes are used for characters but varchar2 is used for character strings of variable length whereas char is used for character strings of fixed length. For example, if we specify the type as char(5) then we will not be allowed to store string of any other length in this variable but if we specify the type of this variable as varchar2(5) then we will be allowed to store strings of variable length, we can store a string of length 3 or 4 or 2 in this variable.

Name different types of case manipulation functions available in SQL.
There are three types of case manipulation functions available in SQL. They are,
LOWER: LOWER('string')                  UPPER:UPPER('string')                     INITCAP:INITCAP('string')

What do you mean by data definition language?
Data definition language or DDL allows to execute queries like CREATE, DROP and ALTER. That is, those queries which define the data.
What do you mean by data manipulation language?
Data manipulation Language or DML is used to access or manipulate data in the database.
It allows us to perform below listed functions:
    • Insert data or rows in database
    • Delete data from database
    • Retrieve or fetch data
    • Update data in database.

  1. What is the difference between primary key and unique constraints?
  2. Primary key cannot have NULL value, the unique constraints can have NULL values. There is only one primary key in a table, but there can be multiple unique constrains. The primary key creates the cluster index automatically but the Unique key does not.
What do you mean by foreign key?
A Foreign key is a field which can uniquely identify each row in another table. And this constraint is used to specify a field as Foreign key. That is, this field points to primary key of another table.

What is a join in SQL? What are the types of joins?
An SQL Join statement is used to combine data or rows from two or more tables based on a common field between them. Different types of Joins are:
INNER JOIN: The INNER JOIN keyword selects all rows from both the tables as long as the condition satisfies.
LEFT JOIN:This join returns all the rows of the table on the left side of the join and matching rows for the table on the right side of join. The rows for which there is no matching row on right side, the result-set will contain null. LEFT JOIN is also known as LEFT OUTER JOIN
RIGHT JOIN:RIGHT JOIN is similar to LEFT JOIN. This join returns all the rows of the table on the right side of the join and matching rows for the table on the left side of join. The rows for which there is no matching row on left side, the result-set will contain null. RIGHT JOIN is also known as RIGHT OUTER JOIN.
FULL JOIN: FULL JOIN creates the result-set by combining result of both LEFT JOIN and RIGHT JOIN. The result-set will contain all the rows from both the tables. The rows for which there is no matching, the result-set will contain NULL values.
What is an index?
A database index is a data structure that improves the speed of data retrieval operations on a database table at the cost of additional writes and the use of more storage space to maintain the extra copy of data. Data can be stored only in one order on disk. To support faster access according to different values, faster search like binary search for different values is desired. For this purpose, indexes are created on tables. These indexes need extra space on disk, but they allow faster search according to different frequently searched values.
Note:

Aggregate functions:
  1. These functions are used to do operations from the values of the column and a single value is returned.
    1. AVG()
    2. COUNT()
    3. FIRST()
    4. LAST()
    5. MAX()
    6. MIN()
    7. SUM()
Scalar functions:
  1. These functions are based on user input, these too returns single value.
    1. UCASE()
    2. LCASE()
    3. MID()
    4. LEN()
    5. ROUND()
    6. NOW()
    7. FORMAT()
Note:
UCASE(): It converts the value of a field to uppercase.
   SELECT UCASE(column_name) FROM table_name;
LCASE(): It converts the value of a field to lowercase.
MID(): The MID() function extracts texts from the text field.
SELECT MID(NAME,1,4) FROM Students;
Output:
NAME
HARS
LEN(): The LEN() function returns the length of the value in a text field.
Fetching length of names of students from Students table.
SELECT LENGTH(NAME) FROM Students;
Output:
NAME
5
SELECT ROUND(MARKS,0) FROM table_name;

Comments

Post a Comment

Popular posts from this blog

java for interview