Chapter - 8: Let's Make Coding Fun!
Chapter - 8: Let's Make Coding Fun!
SQL TECHniCAL
inTERviEw TiPS
& PREPARATion
Let’s make coding fun!
What is the difference between DELETE and TRUNCATE
statements?
DELETE vs TRUNCATE
DELETE TRUNCATE
Q3. What do you mean by DBMS? What are its different types?
Table: StudentInformation
Field: Stu Id, Stu Name, Stu Marks
Inner Join
Right Join
Left Join
Full Join
Both Char and Varchar2 are used for characters datatype but
varchar2 is used for character strings of variable length whereas
Char is used for strings of fixed length. For example, char(10) can
only store 10 characters and will not be able to store a string of any
other length whereas varchar2(10) can store any length i.e 6,8,2 in
this variable.
Q7. What is a Primary key?
Constraints are used to specify the limit on the data type of the table.
It can be specified while creating or altering the table statement. The
sample of constraints are:
NOT NULL
CHECK
DEFAULT
UNIQUE
PRIMARY KEY
FOREIGN KEY
.
Q10. What is a Unique key?
Apart from this SQL Interview Questions blog, if you want to get
trained from professionals on this technology, you can opt for a
structured training from edureka! Click below to know more.
There are various types of joins which are used to retrieve data
between the tables. There are four types of joins, namely:
Inner join: Inner Join in MySQL is the most common type of join. It
is used to return all the rows from multiple tables where the join
condition is satisfied.
Left Join: Left Join in MySQL is used to return all the rows from the
left table but only the matching rows from the right table where the
join condition is fulfilled.
Right Join: Right Join in MySQL is used to return all the rows from
the right table but only the matching rows from the left table where
the join condition is fulfilled.
Full Join: Full join returns all the records when there is a match in
any of the tables. Therefore, it returns all the rows from the left-hand
side table and all the rows from the right-hand side table.
Entities: A person, place, or thing in the real world about which data
can be stored in a database. Tables store data that represents one
type of entity. For example – A bank database has a customer table
to store customer information. Customer table stores this
information as a set of attributes (columns within the table) for each
customer.
Unique Index:
This index does not allow the field to have duplicate values if the
column is unique indexed. If a primary key is defined, a unique index
can be applied automatically.
Clustered Index:
This index reorders the physical order of the table and searches
based on the basis of key values. Each table can only have one
clustered index.
Non-Clustered Index:
Non-Clustered Index does not alter the physical order of the table
and maintains a logical order of the data. Each table can have many
nonclustered indexes.
Consistency: Consistency ensures that the data must meet all the
validation rules. In simple words, you can say that your transaction
never leaves the database without completing its state.
1. Arithmetic Operators
2. Logical Operators
3. Comparison Operators
Apart from this SQL Interview Questions blog, if you want to get
trained from professionals on this technology, you can opt for a
structured training from edureka! Click below to know more.
Q26. Are NULL values same as that of zero or a blank space?
A NULL value is not at all same as that of zero or a blank space. NULL
value represents a value which is unavailable, unknown, assigned or
not applicable whereas a zero is a number and blank space is a
character.
Q27. What is the difference between cross join and natural join?
Correlated subquery: These are queries which select the data from
a table referenced in the outer query. It is not considered as an
independent query as it refers to another table and refers the column
in a table.
To count the number of records in a table, you can use the below
commands:
SELECT * FROM table1
To display name of the employees that begin with ‘A’, type in the
below command:
Group functions work on the set of rows and returns one result per
group. Some of the commonly used group functions are: AVG,
COUNT, MAX, MIN, SUM, VARIANCE.
Q34 . What is a Relationship and what are they?
Example of BETWEEN:
SELECT * FROM Students where ROLL_NO BETWEEN 10 AND 50;
Example of IN:
SELECT * FROM students where ROLL_NO IN (8,15,25);
-
Q37. Why are SQL functions used?
Apart from this SQL Interview Questions Blog, if you want to get
trained from professionals on this technology, you can opt for a
structured training from edureka! Click below to know more.