0% found this document useful (0 votes)
97 views21 pages

MySql Notes For The Class XI and XII 2022-23

Uploaded by

kartiksahu082006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
97 views21 pages

MySql Notes For The Class XI and XII 2022-23

Uploaded by

kartiksahu082006
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 21

An Introduction to MySQL Session: 2022-23

Class XI and XII [ ip] INFORMATICS PRACTICES

Class XI - Unit 3: Database concepts and the Structured Query Language

Database Concepts: Introduction to database concepts and its need, Database


Management System.
Relational data model: Concept of domain, tuple, relation, candidate key, primary
key, alternate key
Advantages of using Structured Query Language, Data Definition Language, Data
Query Language and Data Manipulation Language, Introduction to MySQL, creating a
database using MySQL, Data Types
Data Definition: CREATE TABLE
Data Query: SELECT, FROM, WHERE.
Data Manipulation: INSERT

Class XII - Unit 2: Database Query using SQL

Math functions: POWER (), ROUND (), MOD ().


Text functions: UCASE ()/UPPER (), LCASE ()/LOWER (), MID ()/SUBSTRING ()/SUBSTR
(), LENGTH (), LEFT (), RIGHT (), INSTR (), LTRIM (), RTRIM (), TRIM ().
Date Functions: NOW (), DATE (), MONTH (), MONTHNAME (), YEAR (), DAY (),
DAYNAME ().
Aggregate Functions: MAX (), MIN (), AVG (), SUM (), COUNT (); using COUNT (*).
Querying and manipulating data using Group by, Having, Order by.

Q What do you mean by Data, Field, Tuple, Table and Database?


Ans Data : it is one of the smallest element of the table.

Field : It is a collection of the data with same type. The region where the data is
kept called as field. In simple words it is also known as column. Technically it is
called as attribute.

Record : It is a collection of the data with multiple type which points to a


particular person or any object. In simple words it is called as row. Technically it
is called as record.

Table : It is a collection of multiple records. It stores data logically. In simple


words it is known as combination of row & column. Technically it is called as
relation.

Database: It is a collection of multiple tables which belongs to an organization /

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

an institution.
OR

Database is an organized collection of data. Here organized means insertion,


deletion, searching, sorting and modification of records.

Q What are the advantages of DBMS?


Ans Data Base Management System provides a centralized control to the data.
Various advantages of database systems are:
a. It reduces data redundancy (data duplication) to a large extent.
b. It controls data inconsistency.
c. It facilitate sharing of data
d. Integrity can be maintained through databases
e. Centralized database can ensure data security.

Q Define the term Cardinality and Degree


Ans Cardinality: No. of records in a table is called as cardinality.
Degree: No. of fields in a table is called as degree.

Q What do you mean by Key in MySql? Define various types of keys available.
Ans Key: a field with any specialty is called as key. OR a column which is used to
identify one or more rows in a table.

Primary Key: A field which contains values without repetition. It has capacity to
hold / uniquely identify record.

Candidate Key: The fields which have willingness to be primary key, called as
candidate key.

Alternate Key: Except primary key From the pool of candidate keys, all the
remaining candidate keys are called as alternate key(s).

Foreign Key: The field which is non-primary key in the first table, but acting as a
primary key in another table, called as Foreign key. ( non-primary key of first
table)

Q What is MYSQL? Also mention features.


Ans It is an open source Relational Database Management System. It stands for My
Structured Query Language. It is a fast, reliable, scalable alternative to many of
the commercial RDBMSs.
The other popular RDBMS softwares are Oracle, Sybase, DB2, and MS SQL
Server etc.
[The chief inventor of MySQL was Michael Widenius (Monty). MySQL has been

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

named after Monty’s daughter My.]


Features:
> It is open-source software.
> It has superior speed, is easy to use and is reliable.
> it is a platform independent i.e. it can work on many operating systems like
Windows, UNIX, LINUX etc
> It is compatible with many languages including JAVA, C++, PHP, PERL, etc.
> it can handle large no. of records(data sets)

Q Classify MySQL commands.


OR
What do you mean by DDL, DML and TCL?
Ans As soon as we install mysql, it releases some set of commands for user for
operational point of view. these set of commands can be classified into three
categories:
1. DDL 2. DML 3. TCL

DDL: It stands for data definition language. It has a set of commands which is
used to create / delete / modify [change or edit] the structure of the table.
eg:
Create Table, Drop Table, Alter Table etc.

DML: It stands for data manipulation language. It has a set of commands which
is used to insert / remove [erase or eliminate or delete] / modify / search / sort
[arrange or order] the records [i.e. actual data].
eg:
Select, Insert, Update, Delete etc

TCL: It stands for Transaction Control Language. It has a set of commands,


which allow managing and controlling transaction. [a transaction is one
complete unit of work involving many steps]
eg: Commit, Rollback etc

Q How can we create database?


ans Syntax:
create database name_of_the_database ;
eg:
create database stpauls;

Note:
- It is a non case sensitive language.
- Every query ends with semi-colon.
- The name of the database / table name should not contain any special

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

characters except underscore.

Q List the name of databases existing in your computer.


Ans show databases;

Q How can we create table?


Ans
create table table_name
(
field1 datatype,
field2 datatype,
field3 datatype,
---,
---,
---
);

Note:
> Table name should not contain any special character.
> The last field should not carry comma

Q What is Data Type?


Ans It is used to associate field name. The filed can be identified by the type of
value.
OR
It is defined as a set of values along with the operations that can be performed
on those values.
There are various data types available:

char(w) - to hold names, text, messages or alpha-numeric values

varchar(w) - same as above


varchar2(w) - same as above

int(w)
or - to hold integer values
integer(w)

decimal(w,d)
or - to hold real / decimal values
float(w,d)

date - to hold date type values

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

Q Create a table Student with following fields and respective data type
rollno – int
name – char
gender – char
city – char
dob – date
class – int
section – char
per - decimal (5,2)
Ans create table student
(
rollno int(2),
name char(15),
gender char,
city char(15),
dob date,
class int(2),
section char,
per decimal(5,2)
);

Note: If the data type char is not mentioned with any width, then by default it
will hold 1 character.

Q How can we activate database?


OR
Q. What should be done when mysql shows error: "No Database Selected"
after creation of table?
Ans use databasename;

Q Write a command to display list of tables available in the database.


Ans show tables;

Q Insert one record in the table.


Ans insert into student
values(53,"Payal","f",'Udaipur',"2017-01-23","12",'C',67.88);

Note:
> All the char / varchar / date type based field - data will be enclosed with
double quotes or single quotes.

insert into student

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

values(26,"Suresh","m",'Dungarpur',"2001-08-1","12",null,77.14);

Q Display the list of records of table student.


OR
Show all the records available in the table student
Ans select rollno,name,gender,city,dob,class,section,per
from student;
or
select *
from student;

Note: Here * means all unknown fields

Q Display names of all the students with their city.


Ans select name, city
from student;

Q Write command to see structure of the table.


Ans desc student;
OR
describe student;

Q What is Relational Operator in Mysql?


Ans Relational operators are used to create condition.
eg:

< less than


> greater than
= equal to
<= less than equal to
>= greater than equal to
!= or <> or ^= not equal to

Q Display the names of all the students belongs to BHILWARA.


Ans Select name
from student
where city = 'BHILWARA' ;

Q Display the names with their percentage of those students who have scored
less than 50%.
Ans Select name, per
from student
where per<50;

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

Q Display the names along with date of birth of those students whose dob is
before 1st April 2005.
Ans Select name, dob
from student
where dob<'2005-04-01';

Q What do you mean by Logical operators? Define.


Ans Logical operators: such operators are used to join multiple conditions. There
are 3 types
AND cond1 and cond2
OR cond1 or cond2
NOT not cond

Q Display names as well as dob of all those female students who belongs to
Udaipur.
Ans select name, dob
from student
where gender="f" and city="Udaipur";

Q Show names along with percentage and city of those students who either
belongs to other than Udaipur city or whose per is more than 50.
Ans select name, per, city
from student
where city<>"Udaipur" or per>50;

Q Display records of all such students whose percentage is in between 50 and


70.
Ans select *
from student
where per>=50 and per<=70;

Note: The above query can be written like this:

select *
from student
where per between 50 and 70 ;

Q Display records of all such students whose percentage is not in between 50


and 70.
Ans select *
from student
where per<50 and per>70;

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

OR

select *
from student
where not (per>=50 and per<=70);
OR

select *
from student
where per not between 50 and 70 ;

Q Display details of students named with Sunil, Rajesh and Payal.


Ans select *
from student
where name = "Sunil " or name="Rajesh" or name="papal" ;

OR

select *
from student
where name in ("sunil","Rajesh","payal");
Q Display details of all the students except Sunil, Rajesh and Payal.
Ans select *
from student
where not (name = "Sunil " or name="Rajesh" or name="payal" );
OR
where name != "sunil " or name!="Rajesh" or name!="payal";
OR
where name not in ("sunil","Rajesh","payal");
Q Display Complete Information Of All The Students Except Roll Number 35, 65,
82.
Ans select *
from student
where not (rollno= 35 or rollno=65 or rollno=82 );
OR
where rollno != 35 or rollno!=65 or rollno!=82;
OR
where rollno not in (35,65,82);
Q Display names of cities without any duplication. or remove the duplicate
names of cities.

Ans select distinct city

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

from student;
Note: the distinct keyword is used to remove duplicate values.

Q Explain arithmetic operators in MySql.


Ans + [addition]
- [Subtraction]
* [Multiplication]
/ [Division]
% [Modulus or Remainder]

Q Display new roll numbers with their name along with class of all the students.
The new roll number can be finding out by addition of 100 to each roll
number.
Ans select rollno+100, name, class
from student ;
Or
select rollno+100 as "New Roll No." , name, class
from student;

Q What is column alias? Explain it with an example.


Ans Column Alias: A substitute name of any column is known as column alias.
eg:
select rollno as "Roll No.", name as "Name of Student"
from student;
Note: As keyword is optional.

Q Delete all the records.


Ans delete
from student;

Q Remove all such records whose percentage is less than 33.


Ans delete
from student
where per < 33 ;

Q Erase the name of Suresh from the student table.


Ans delete
from student
where name = "Suresh";

Q What do you mean by Pattern Matching? Explain.


Ans In case a part of information is missing and an attempt is put to find out such
information, then this concept is called as pattern matching.

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

How can we achieve?


wild characters : there are two wild characters
1. % - for all unknown characters
2. _ - single unknown character

"Ar%" - name begins with Ar


"%Ar" - name ends with Ar. Even though name name starts or ends with
Ar
"%Ar%" - name which contains Ar in-between
"_ _ Rd"- name with four characters in which first two characters are
unknown
"KA_AL%"- name with variable length in which middle character is unknown

Q Display the name of the student with their class and roll number whose name
starts with "A" and ends with "Kar".
Ans select name, class, rollno
from student
where name = "A%kar";

Note: the above query is wrong. in spite of = sign, like keyword must be
used(during pattern matching)
select name, class, rollno
from student
where name like "A%kar";

Q Show all the records in ascending order of their name.


Ans select *
from student
order by name asc;
Note: asc is an optional keyword. but while going descending, desc keyword
must be used.

Q Display names of all the students with their city and percentage in descending
manner of percentage.
Ans select name, city, per
from student
order by per desc;

Q Modify the records of all the students by adding 100 to each roll number.
Ans update student
set rollno = rollno + 100 ;

Q Change the name of tarun which is of class 9 with tarun kumar.

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

Ans update student


set name = "tarun kumar"
where name = "tarun" and class=9;

Q shop (table)
itemname - biscuit, chocolates, maggie, ...
itemcost - xx, xxx, xxx
Modify the itemcost of all the biscuit type of products with addition of 5%.
Ans update shop
set itemcost = itemcost + itemcost * 5 / 100
where itemname = "biscuit";

Q What is function in MYSQL? Elaborate the term.


Ans Each function performs a specific task and returns a value.
there are two types of functions
a. Multiple Row Functions / Aggregate Function / Group Function
b. Single Row Functions

a. Multiple Row Functions / Aggregate Function : when multiple records are


involved to find out a single result, such functions are called as multiple row
functions.

Q Describe multiple row functions.


Ans 1. sum() : it will display / return sum (total) of all the values.
eg:
select sum(cost)
from shop;

2. max() : it will display / return maximum value from the group of values.
eg:
select max(per)
from student;

3. min() : it will display / return minimum value from the group of values.
eg:
select min(per)
from student;

4. avg() : it will display / return average from the group of values.


eg:
select avg(per)
from student;
Note: in avg() null values are ignored.

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

mysql> select * from sample1;


+------+------+
| val1 | val2 |
+------+------+
| 1| 6|
| NULL | 2 |
| 4| 4|
| 7| 0|
+------+------+
4 rows in set (0.00 sec)

mysql> select avg(val1), avg(val2)


-> from sample1;
+-----------+-----------+
| avg(val1) | avg(val2) |
+-----------+-----------+
| 4.0000 | 3.0000 |
+-----------+-----------+
1 row in set (0.01 sec)

5. count() : this function display / returns no. of records available in the table.

Sample1
------------
val1 val2
1 6
null 2
3 4
8 0

select count(*)
from student;

Note: it will count all the records including null

select count(rollno)
from student;

Note: it will count no. of records specified in the field excluding null.

example:

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

select publisher
from book;

select distinct publisher


from book;

select count(distinct publisher)


from book;

Q.
ans.

Q what will happen when the following query will be got executed?
select name, avg(per)
from student;

Ans Actually the above query is wrong. ...

Q Describe single row functions.


Ans 1. upper() / ucase() : this function returns / displays the name in upper case
letters.

select ucase(name)
from student;

2. lower() / lcase() : this function returns / displays the name in lower case
letters.

select lower(name)
from student;
----------------------------------------------------------------------------------
mysql> select 45*3 ;
+------+
| 45*3 |
+------+
| 135 |
+------+
1 row in set (0.00 sec)

mysql> select 45*3 from dual;


+------+
| 45*3 |
+------+

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

| 135 |
+------+
1 row in set (0.00 sec)

mysql> select 45*3 from student;


+------+
| 45*3 |
+------+
| 135 |
| 135 |
| 135 |
| 135 |
| 135 |
+------+
5 rows in set (0.00 sec)
----------------------------------------------------------------------------------

3. mid() / substr()/substring() : it will return the extracted part of the source


string.

eg:
select mid("informatics",3, 4);

o/p: form
Note: here 3 is position where to begin the operation, and 4 is no. of characters
to be extracted.

Note: in case 4(3rd argument) is not mentioned, then all the characters will be
extracted ffrom the beginning(3).

eg: select name, mid(stream,1,3)


from student;

4. instr() : it will return the position of the serached string from the in / source
string.

select instr("i like to teach ip to my students", "ke")


from dual;
o/p : 5

eg:
select instr("this is a bus","is");

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

o/p : 3

5. concat() : it is a function which is used to concatenate two or more than two


strings / texts / messages / lines.

select concat("dhawal","jain");

6. length() : it will return no. of characters (including spaces & special chars.)
from the existing string.

eg:
select length("yuvraj");
o/p : 6

7. ltrim() : it will remove all the leading / left-most spaces of the string
.
8. rtrim() : it will remove all the trailing / right-most spaces of the string
.
9. trim() : it will remove all the leading as well as trailing spaces of the string. It
will not remove the spaces in-between.

10. left() : it will extract number of characters from the left most side of the
string.

eg:
select left("ravi",2);
o/p : ra

11. right() : it will extract number of characters from the right most side of the
string.

eg:
select right("ravi",2);
o/p : vi

12. round() : this function returns numeric expression rounded up to position


required.
eg: select round(59926.69932,2);
eg: select round(salary,0) from employee;
OR
select round(salary) from employee;

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

13. truncate() : it returns numeric expression truncated to the place required.


Select truncate(59.592,1);

Q What do you mean by group by?


Ans This clause is used to classify the records OR this clause combines all those
records that have identical values in a particular field or a group of fiels.

Select job, count(*)


From employee
Group by job
Having count(*)>10;

Q What is the difference between WHERE and HAVING ?


Ans The Where clause is used to restrict records in a query i.e. it is applied on
individual row whereas Having clause restricts the records after they have been
grouped using group by.

Q Define the term constraint. Also brief its types.


Ans Constraints: these are checks which validates data (at the time of input) OR a
constraint is a condition or check applicable on a field or set of fields
There are many constraints. as per board only two we have to study

- primary key : it will make sure that repeated values should not be entered
it will be used only once (allowed for only one field) in a table
- not null : none of the data will be left blank for the respective field
it can be applied for more than 1 field

create table book


(
bno int(3) primary key,
bname char(20) not null,
bauthor char(10),
bprice int(4) not null
);

Q While creation of the structure of table, what type of constraints will be


applied to each and every field.
Ans NULL

Q how would you come to know the field is of primary key


Ans using describe table_name;
We will come to know the primary key.

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

Q What is alter table?


Ans . This command belongs to ddl category. Generally it is used to modify the
structure of the table. it can be used:
to add a constraint
to remove a constraint
to remove a column from a table
to modify a table column

Q Make the column rollno as primary key in the table student.


Ans alter table student
add primary key (rollno);

Q Remove the constraint primary key.


Ans alter table student
drop primary key;

Q Remove the column section from the table student.


Ans alter table student
drop column section;
OR
drop section;

Q Add the column bprice in the table book.


Ans alter table book
add bprice decimal(6,2);
OR
alter table book
add column bprice decimal(6,2);

Q Change the data type decimal to int for the column bprice in the table book.
Ans alter table book
modify bprice int(4);

Q Put the constraint not null to the column name of student table.

Ans alter table student


modify name char(15) not null;

Q What will be the output of the following query when executed?


Ans an example of sorting on multiple columns

select name,per

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

from student
order by per desc , name ;

sumit - 77
aman - 45
nilesh - 78
sumit - 82
raj - 77
payal - 36
sumit - 12
rajesh - 77

----------------------------------------
sumit - 82
nilesh - 78
raj - 77
rajesh - 77
sumit - 77
...

Q what is null?
Ans NULL means a value that is unavailable, unassigned, unknown or inapplicable.
NULL is not the same as zero or a space or any other character. In a table NULL
is searched for using IS NULL or IS NOT NULL keywords.

Q What is drop?
Ans This command removes records as well as structure of the table. This belongs
to DDL category.
Whereas delete command removes only records not structure. The command
delete belongs to DML category.

Q What is the difference between CHAR and VARCHAR data types?


Ans The char data type is used for fixed length of strings whereas varchar data type
is used for variable length of strings.

Q Define the following TCL commands:


Ans Commit: it means all the steps of transaction are carried out successfully and
all the data changes are made permanent in the database. OR this command
permanently saves the changes made during the transaction execution.

Rollback: it means transaction has not been finished completely and hence all
data changes made by the transaction in the database are undone. OR this
command undoes the changes made during the transaction execution.

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

Savepoint: it is a point in a transaction, uptil which all changes have been saved
permanently. Basically it creates history.

Q What is Join?
Ans A join is a query that combines rows from two or more tables. There are
basically two types
Cross-Join: it is also called as Cartesian product. It is a basic type of join that
simply matches each row from one table to every row from another table. OR it
is a joining of two tables without any condition. It forms a table which consist
multiplication of rows of and addition of columns from both the tables.
eg:
select *
from table1, table2;

Equi-Join: An equi-join of two tables is obtained by putting an equality


condition on the joining of two tables. This equality condition is put on the
common column of the tables.

Select emp.deptno, ename, dname, loc


From emp,dept
Where emp.deptno = dept.deptno and…..;

Q What is table alias?


Ans A table alias is a temporary label given along with table name in from clause.
Select e.deptno, dname, empno, ename, job, sal
From emp e, dept d
Where e.deptno = d.deptno
Order by e.deptno, empno desc;
Note: Here e and d are table alias.

Q Date & Time Based Functions

Ans CURDATE() : Returns the current date in YYYY-MM-DD format


Eg: SELECT CURDATE();

NOW() : Returns the current date and time in 'YYYY-MM-DD HH:MM:SS'


Eg: SELECT NOW();

SYSDATE() : Returns the current date and time in 'YYYY-MM-DD HH:MM:SS'


Eg: SELECT SYSDATE();

MONTH(date) : Returns the numeric month from the date passed, in the range

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

0 to 12.
Eg: SELECT MONTH('2010-02-26');
Eg: SELECT MONTH(curdate());

YEAR(date) : Returns the year for date passed in the range 0 to 9999. Returns
values like 1998, 2010,1996 and so on.
Eg: SELECT YEAR('2010-02-26');
Eg: SELECT YEAR(DOB)from student;

DAYNAME(date) : it returns the name of the day for the date passed
Eg: SELECT YEAR('2009-07-21');
Result: Tuesday

DAYOFMONTH(date) : Returns the day of the month in the range 0 to 31.


Eg: SELECT DAYOFMONTH('2009-07-21');

DAYOFWEEK(date) : Returns the day of week in number as 1 for Sunday, 2 for


Monday and so on.
Eg: SELECT DAYOFWEEK('2009-07- 21');

DAYOFYEAR(date) : Return the day of the year for the given date in numeric
format in the range 1 to 366.
Eg: SELECT DAYOFYEAR('2009-07-21');
Result: 202
Eg: SELECT DAYOFYEAR('2009-01-01');
Result: 1
Q

Ans

Ans

St. Paul’s Sr. Sec. School, Udaipur


An Introduction to MySQL Session: 2022-23
Class XI and XII [ ip] INFORMATICS PRACTICES

Ans

Ans

--- Special Points to Remember ---

* The names of clauses are: DISTINCT, ORDER BY, GROUP BY, WHERE,
* The names of operators are: BETWEEN, IN
* % AND _ are two wild card characters.
* NULLs in aggregate functions totally ignore null values present in a field.
* Min(), Max() and Count() work on any type of values-Numeric, Date and String
AVG() and SUM() work on only numeric values (Int and Decimal)
* When AutoCommit is ON [SET AUTOCOMMIT =1;] each statement during
transaction automatically committed.

St. Paul’s Sr. Sec. School, Udaipur

You might also like