Skip to main content

SQL Basics: Introduction


Anonymous said…
Hello mithun,

Now SQL online reference is not worrking ....what is the reason?
Anonymous said…
Hello mithun,

Hi, Chandrasehar Here, Now SQL online reference is not worrking ....what is the reason?
Mithun Ashok said…

Please check the link again, it works fine.

Rakesh Ram said…
hi mithun, can u tell me some details about, Stored Procedures, and Triggers ?
Mithun Ashok said…
Hi Rakesh,

PL/SQL Procedure:

1. Doesn't need to return values but can return value.
2.Stored as a pseudo-code in database i.e. compiled form.
3.Can affect the state of database using commit etc.
4.Cannnot be invoked from SQL statements e.g. SELECT.
5.Procedures are mainly used to process the tasks.


Triggers provide a way of executing PL/SQL code on the occurrence of specific database events.

Oracle enables triggers to be invoked by many events other than table insert, update and delete operations.

Anonymous said…
Hi iS it possible to download the slides?
Mithun Ashok said…

No, it is not possible to download the slides.

Sundar said…
Hi Sir,

Whatever applications either it is MS word / Notepad / C, C++, Java, Perl, .Net / whatever it is... they need to have some database to function right? These don't come under any type of DBMS coz they don't belong to any of the structure (Tree, N/W, Table, Object) right? But still y dont we call them as a DBMS? (even when they don't belong to any type of DBMS). Can u explain in detail?
Mithun Ashok said…
Hi Sundar,

You need to understand the definition first, Database is a place where data is stored in an organized format.

DBMS is a program or a software which will give you access to any database.

Word, Excel are File based programs which stores data in files and do not require any language to manipulate the data.

C/C++/.Net etc are purely programing languages used to create programs/softwares/Applications etc. Infact some of the DBMS softwares are built using C/C++. These languages do not require DBMS rather they can only be executed using a compiler.

Hope this is clear.

Anonymous said…
Hello sir,
Pls explain the definition of identifying relationship and Derived attributes with an example? In given slides example is bit difficult to understand for me. So pls give an simple example……..
Mithun Ashok said…

Any relationship between a Strong entity and a Week entity is classified as Identifying relationship.

Derived attributes are logical attributes of an entity which can be derived by some means.

neetu singh said…
Hello sir.....with the end of SQL classes 2day i would like to thank you for giving a new definition n dimensions to teaching where non computer science students like me as well as those who have d knowledge r equally benefited.Those who really wanna learn SQL should definitely come 2 u 4 nutshell you r an excellent trainer..Thank you for building in confidence in me...
Anonymous said…
thankz alot for more think i want to tell u,i knw ppl like u very less on this earth....we need ppl like u n ANNA HAZAARE who devote their precious time and all life for helping ppl........thankz n keep it up....Sir u rockz everyday...ur students gives u alot of blessings n warm wishes like me ......
Mithun Ashok said…
Hi Neetu,

Thanks a lot for such wonderful comments.

Mithun Ashok said…
Thank you Anonymous. My work is just a drop in the ocean and am still very small compared to Anna Hazare. Wish you all the best and thanks for the wishes.

Anonymous said…
Hi Mithun, the presentations are down, I am not able to access it. Can you kindly check on this....

I am also sending out a mail to your yahoo id of the screen shot what i am seeing....
Mithun Ashok said…

There was some problem with the presentations and I have fixed it now.

Pls check.
pallu said…
hello sir. 'm ur student in q spiders ay 7-9 batch. will u pleas explain the yesterday class once.. bec 'm too confused in what is primary key and foreign key and constrants and what is not null and all pleas explain in todays class... bec so many students are confused so 'm asking
pallu said…
Hello sir 'm ur student in q spiders at 7-9 batch. will u pleas explain me yesterday topic in today's class bec so many peoples are confused yesterday so 'm asking... we r confused in what is foreign key master key and primary key and all pleas sir explain us once...
Sir in my database "default tables" are not present,how can i bring them?
Anonymous said…
Sir i want to laptop will u pleas tell me which should i buy........ actually u r using acer.
How its working sir
'm ur student pleas tell me sir
Mithun Ashok said…
Hi Rahul,

You should login as user SCOTT and use the default password tiger. This will work if you have installed enterprise edition of 10g or 11g.

Mithun Ashok said…
Hi Anonymous,

Acer is working fine and it has not given me any problem for last 1 year.

If you are planning to install database on your laptop then I would suggest you go for a laptop with DUAL Core CPU and minimum 2GB or 4GB RAM.

Sir select * from emp where mgr=null,is not working....,it gives "no row selected",infact any column name=null is giving "no rows selected",how can i find person with no manager?
Mithun Ashok said…
Hi Rahul,

mgr=NULL will not work, you should use mgr is NULL. In oracle NULL <> NULL.

Use the following statement,

select * from emp where mgr is null;

Anonymous said…
please go bit slow in the class..

thank you.....
PINJI said…
hi mithun sir,
pinji here...
sir,i have a doubt,not related to SQL.Actualy,i have been done engineering from chemical branch 2011 batch,so wlil i get opportunity in software field if i will learn this software testing coach nicely.
thnking you.
Mithun Ashok said…
Hi Pinji,

You will if you work hard.

baba said…
hello mithun u r a very good lecturer
your teaching is awesome
Mithun Ashok said…
Hi Baba,

Thank you,
Sahana Jogur said…
hello sir,
may i know the difference between data model and schema?
Nirmal said…
please go bit slow in the class..
couldnot understand tuesday(6.3.2012) class.because i am basically stundent
Rahul Desai said…
Hi Sir,
am a new student in Q-spiders morning batch...
m following u very well ur teaching is very good
u hv mistaken me as Rajnikant as i sit in d last once wen i came late
Sowjanya Kinthada said…
sir please go a bit slow.... morning batch...
Harisha said…
Hi Sir,Your Teaching is good but it is very fast. Please give us Notes immediately after Teaching so that we can recollect your words....
Priya088 said…
hello sir i have almost complete with manually testing i am attending sql class 2 i am BE E&C with 55% will i get job i am not getting interviews and with filed i need 2 work hard
:):) said…
hi sir,

i was able to download the oracle 10 g client, got the SQL tool too...couldn't log in though!. it wasn't authenticating the "scott "and "tiger "as the user name and password.I'm not sure if that's the enterprise edition.
Mithun Ashok said…
You have donwloaed only 10g Client. You need to download 10g Enterprise edition server.
Mithun Ashok said…
Yes Priya, you need to work hard..
Mithun Ashok said…
Sure Harisha.
Mithun Ashok said…
Sure Sowjanya
maya said…
sir plz give me definition of repository
Swetha Suryanarayana said…
Hello sir,
How do I download the PPTs on your blog?
I dont see an option like that here.
Kindly help.

santosh said…
Hi sir, i m a student of jspiders. and i want to download the ppt's of sql from ur site. plzz suggest me how to get those.
imagine india said…
Hii mithun sir
sir first of all i want to thank to u for---that u teaches Sql very well.Being a ECE student I am able to understand all 3 to 4 classes u have taken.
My question to is that............u told server is that machine on which server program is installed(e.g in the context of DB u told DBMS server programs) but in genral there are a lot of softares avialble on each PC which can modify or access date(for example....word can modify dat,media softwares can be used to editing video data.) so is that machine also severs.
or is there any restrictions on softwares to be called a server programs......which programs only called server programs?
rahul kumar(evening 40'clock batch)

Popular posts from this blog

SQL Interview Questions on Subqueries

SUB Queries:
1. List the employees working in research department 2. List employees who are located in New York and Chicago
3. Display the department name in which ANALYSTS are working
4. Display employees who are reporting to JONES
5. Display all the employees who are reporting to Jones Manager
6. Display all the managers in SALES and ACCOUNTING department
7. Display all the employee names in Research and Sales Department who are having at least 1 person reporting to them
8. Display all employees who do not have any reportees
9. List employees who are having at least 2 reporting
10. List the department names which are having more than 5 employees
11. List department name having at-least 3 salesman
12. List employees from research and accounting having at-least 2 reporting
13. Display second max salary
14. Display 4th max salary
15. Display 5th max salary  -- Answer for nth Max Salary
Co-Related Subqueries:
16. Write a query to get 4th max salary from EMP table
17. Write a query to get 2nd…

Answers for SUB Queries

1. SQL> select empno, ename from emp where deptno=(select deptno from dept where dname='RESEARCH');

2. SQL> select empno, ename from emp where deptno in (select deptno from dept where loc in ('NEW YORK','CHICAGO'));

3. SQL> select dname from dept where deptno in ( select deptno from emp where job ='ANALYST');

4. SQL> select empno, ename, mgr from emp where mgr = (select empno from emp where ename='JONES');

5. SQL> select empno, ename, mgr from emp where mgr = (select mgr from emp where ename='JONES')

6. SQL> select empno, ename, job from emp where deptno in ( select deptno from dept where dname in ('SALES','ACCOUNTING'))

7. SQL> select empno, ename, job from emp where deptno in ( select deptno from dept where dname in ('SALES','RESEARCH')) and empno in (select mgr from emp)

8. SQL> select empno, ename from emp where empno not in ( select mgr from emp where mgr is not null)

9. select…

'Linux-x86_64 Error: 28: No space left on device' While trying to start the database -- Error

SQL> startup mount pfile='/tmp/initdlfasp12.ora'
ORA-27102: out of memory
Linux-x86_64 Error: 28: No space left on device

This as you can see is on Linux x86 with 64 bit processor. We got this error after we changed SGA on 10gR2 database. So was sure that this is something to do with the OS.

Parameters to check for this are shmall.

shmall is the total amount of shared memory, in pages, that the system can use at one time.

$cat /proc/sys/kernel/shmmax

$ getconf PAGE_SIZE

As per Oracle SHMALL should be set to the total amount of physical RAM divided by page size.

Our system has 64GB memory, so change kernel.shmall = 1024 * 1024 * 1024 * 64 / 4096 = 16777216

Once this value is calculated you can modify Linux system configuration file directly.

$ su - root
vi /etc/sysctl.conf file:


# sysctl -p

Once this is done the database was started without any problem.