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.
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…

Basics of RDBMS

Small set of information becomes data, this set of information helps make decision. Data is always some useful information.

Place where you store the data. Database represents some aspect of the real world called "miniworld". A database is designed, built and populated with data for a specific purpose. It has intended group of users and some preconceived applications in which these users are interested.

In other words, a database has some source from which data is derived, some degree of interaction with events in the real world and an audience that is actively interested in the contents of the database.

Database can also be defined as collection of one or more tables.

Ex: Mobile, human brain etc

DBMS (Database Management System)
Is a program that stores retrieves and modifies data in the database on request.

Study of different techniques of design, development and maintenance of the database

Types of DBMS
These types are based upon their management of database s…

Answers for SQL Functions

1. SQL> SELECT empno, ename FROM emp WHERE Length(ename) = 4;

2. SQL> SELECT empno, ename, job FROM emp where Length(job)=7;

3. SQL> SELECT Length('qspiders') - Length(replace('qspiders','s','')) FROM dual;

4. SQL>  SELECT empno, ename, job FROM emp WHERE Instr(job,'MAN') >0;

5. SQL> SELECT empno, ename, job FROM emp WHERE Instr(job, 'MAN') =1;

6. SQL> SELECT empno, ename, job FROM emp WHERE (Length(ename) - Length(Replace(ename, 'L',''))) = 1;

7. SQL> SELECT * FROM dept WHERE Instr(dname,'O') > 0;

8. SQL> SELECT Concat(ename,' working as a ') || Concat(job, ' earns ') || Concat(sal, '  in ') || Conc
at('dept ',deptno) AS text from emp;


SQL> SELECT Concat(Concat(Concat(Concat(Concat(Concat(Concat(ename,' working as a '), job),' earns '), sal),'  in '),'dept '), deptno) AS text FROM emp;

9. SQL> SELECT empno, ename…