Some More Questions
Some More Questions
Some More Questions
Find difference between two date fields & retrieve the difference - in
days/hour/year
DELETE TRUNCATE
Delete command is used to delete a row in a table. Truncate is used to delete
all the rows from a table.
You can rollback data after using delete statement. You cannot rollback data.
It is a DML command. It is a DDL command.
It is slower than truncate statement. It is faster.
Clustered index is used for easy retrieval of data from the database and its faster
whereas reading from non clustered index is relatively slower.
Clustered index alters the way records are stored in a database as it sorts out
rows by the column which is set to be clustered index whereas in a non clustered
index, it does not alter the way it was stored but it creates a separate object
within a table which points back to the original table rows after searching.
One table can only have one clustered index whereas it can have many non clustered
index.
A) CONCAT (joining two or more values): This function is used to join two or more
values together. The second string is always appended to the end of the first
string.
B) SUBSTR: This function returns a segment of a string from a given start point to
a given endpoint.
C) LENGTH: This function returns the length of the string in numerical form,
including blank spaces.
G) TRIM: This function removes all defined characters from the beginning, end, or
both ends of a string. It also reduced the amount of wasted space.
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.
Single-Row functions: These functions operate on a single row to give one result
per row.
Character
Number
Date
Conversion
General
Multiple-Row functions: These functions operate on groups of rows to give one
result per group of rows.
AVG
COUNT
MAX
MIN
SUM
STDDEV
VARIANCE
What is the use of Double Ampersand (&&) in SQL Queries? Give an example?
Use “&&” if you want to reuse the variable value without prompting the user each
time.
For ex: Select empno, ename, &&column_name from employee order by &column_name;