Download as pdf or txt
Download as pdf or txt
You are on page 1of 3

Last Minute Tips for Informatics Practices Board Exam

• Read and understand the concern of question carefully.


• Do questions Sectionwise and Write correct Section, Question number against the
attempted question.
• Write your answers in presentable form with proper example and output of each SQL
command.
• Draw network layout with pencil and scale.
• Check your paper before submitting that you have attempted all answers and review it
carefully.

UNIT 2 : DATABASE CONCEPTS-SQL(25 marks)


• Do not forget to put semicolon at the end of each SQL Query.
• While giving outputs, do write the column headers mentioned in SELECT command.
• Do not forget to put character and date values in quotes( Both quotes are acceptable ‘’ and “ “)
• Date format is ‘YYYY-MM-DD’ or ‘YYYY/MM/DD’
• 0 means value and NULL means no value (both are different)

• Do remember the syntax of SELECT command:


• SELECT colnames FROM tablename WHERE condition Order by colname asc/desc
• Where clause can contain single row methods not multiple row
• Where clause can be used by group by but not after it
• SELECT colnames FROM tablename WHERE condition GROUP BY colname
• SELECT colnames FROM tablename WHERE condition GROUP BY colname
ORDER BY colname
• SELECT colnames FROM tablename WHERE condition
GROUP BY colname HAVING condition
• SELECT colnames FROM tablename WHERE condition
GROUP BY colname HAVING condition ORDER BY colname
• Identification of group by clause: - as per , according to , wise, by each
• Having clause can be used after group by but not before it.
• Having can contain only the column given in group by or any aggregate method

• For multiple ordering:


• SELECT colnames FROM tablename WHERE condition Order by colname1
asc/desc,colname2 asc/desc;

• Increase and decrease any value- use update command


• Only display in calculation not permanent change- select expression as ‘alias’

• Is null and is not null used to check for blank entries or any value respectively.

• Single row gives single output for single row and multiple rows gives single output for
multiple rows
SINGLE ROW FUNCTIONS:
1. CHAR / STRING FUNCTIONS :
1
• Do not get confuse between substr and instr.
(Substr gives substring and instr gives position of the first occurrence of the substring)
• While giving length of string, do count all the spaces leading, trailing and middle
( space is also counted as character)

2. NUMERIC FUNCTIONS:

3. DATE/TIME FUNCTIONS:

2
• Now() and curdate() does not accept any parameters, rest all methods do accept one or two
parameters.
• Year(), month(), day() gives integer value, Like year(dob)=2002 where dob is date value.

MULTI ROW FUNCTIONS:


Aggregate Descriptions
Function

count() It returns the number of rows, including rows with NULL values in a
group.

sum() It returns the total summed values (Non-NULL) in a set.

average() It returns the average value of an expression.

min() It returns the minimum (lowest) value in a set.

max() It returns the maximum (highest) value in a set.


• Count(*) gives total rows including null values but count(col) gives only non-null values

You might also like