Here is a list of Sample SQL Questions For Practice With SQL Queries that you can use accordingly. These are very common SQL Questions that you would need to find answers in the form of SQL Queries. Please use these to solve your SQL Related problems or you can also read Practice SQL Queries with Solutions For Employee Table.

32 Sample SQL Questions For Practice With SQL Queries

Question 1: Find out the selling cost average for packages developed in Microsoft.
Answer: SELECT AVG(SCOST) FROM SOFTWARE WHERE DEVIN = ‘MICROSOFT‘;
Also read: 
Practice SQL Queries with Solutions For Employee Table – Part 1

Question 2: Display the names, ages and experience of all programmers.
Answer: SELECT PNAME,TRUNC(MONTHS_BETWEEN(SYSDATE,DOB)/12)“AGE”, TRUNC(MONTHS_BETWEEN(SYSDATE,DOJ)/12) “EXPERIENCE”FROM PROGRAMMER;


Question 3: Display the names of those who have done the ITSM course.
Answer: SELECT PNAME FROM STUDIES WHERE COURSE = ‘ITSM’;
Also Read: 
Practice SQL Queries with Solutions For Employee Table – Part 3

Question 4: What is the highest number of copies sold by a package?
Answer: SELECT MAX(SOLD) FROM SOFTWARE;

Question 5: Display the names and date of birth of all programmers born in May.
Answer: SELECT PNAME, DOB FROM PROGRAMMER WHERE DOB LIKE‘%MAY%’;
Also Read: 
Practice SQL Queries with Solutions For Employee Table – Part 2

Question 6: Display the lowest course fee.
Answer: SELECT MIN(CCOST) FROM STUDIES;


Question 7: How many programmers have done the ITIL course
Answer: SELECT COUNT(*) FROM STUDIES WHERE COURSE = ‘ITIL’;

Question 8: How much revenue has been earned through the sale of packages developed in C
Answer: SELECT SUM(SCOST*SOLD-DCOST) FROM SOFTWARE GROUP BY DEVIN HAVING DEVIN = ‘C’;

Question 9: Display the details of software developed by Lyoid
Answer: SELECT * FROM SOFTWARE WHERE PNAME = ‘LYOID’;
Also Read: 
Practice SQL Queries with Solutions For Employee Table – Part 4

Question 10: How many programmers studied at Centennial
Answer: SELECT * FROM STUDIES WHERE SPLACE = ‘CENTENNIAL’;


Question 11: Display the details of packages whose sales crossed the 10000 mark.
Answer: SELECT * FROM SOFTWARE WHERE SCOST*SOLD-DCOST > 10000;

Question 12: Find out the number of copies which should be sold in order to recover the development cost of each package.
Answer: SELECT CEIL(DCOST/SCOST) FROM SOFTWARE;

Question 13: Display the details of packages for which the development cost has been recovered.
Answer: SELECT * FROM SOFTWARE WHERE SCOST*SOLD >= DCOST;


Question 14: What is the price of costliest software developed in RUBY?
Answer: SELECT MAX(SCOST) FROM SOFTWARE GROUP BY DEVIN HAVING DEVIN = ‘RUBY’;

Question 15: How many packages were developed in JAVA?
Answer: SELECT COUNT(*) FROM SOFTWARE WHERE DEVIN = ‘JAVA’;

Question 16: How many programmers studied at PARAMOUNT?
Answer: SELECT COUNT(*) FROM STUDIES WHERE SPLACE = ‘PARAMOUNT’;


Question 17: How many programmers paid 20000 to 25000 for the course?
Answer: SELECT COUNT(*) FROM STUDIES WHERE CCOST BETWEEN 20000 AND 25000;

Question 18: What is the average course fee?
Answer: SELECT AVG(CCOST) FROM STUDIES;


Question 19: Display the details of programmers knowing C.
Answer: SELECT * FROM PROGRAMMER WHERE PROF1 = ‘C’ OR PROF2 = ‘C’;

Question 20: How many programmers know either C or Ruby?
Answer: SELECT * FROM PROGRAMMER WHERE PROF1 IN (‘C’,’Ruby’) OR PROF2 IN (‘C’,’Ruby’);


Question 21: How many programmers don’t know Java and C++?
Answer: SELECT * FROM PROGRAMMER WHERE PROF1 NOT IN (‘Java’,’C++’) AND PROF2 NOT IN (‘Java’,’C++’);

Question 22: How old is the oldest male programmer?
Answer: SELECT TRUNC(MAX(MONTHS_BETWEEN(SYSDATE,DOB)/12)) FROM PROGRAMMER WHERE SEX = ‘M’;


Question 23: What is the average age of female programmers?
Answer: SELECT TRUNC(AVG(MONTHS_BETWEEN(SYSDATE,DOB)/12)) FROM PROGRAMMER WHERE SEX = ‘F’;

Question 24: Calculate the experience in years for each programmer and display along with their names in descending order
Answer: SELECT PNAME, TRUNC(MONTHS_BETWEEN(SYSDATE,DOJ)/12)FROM PROGRAMMER ORDER BY PNAME DESC;


Question 25: Who are the programmers who celebrate their birthdays during the current month?
Answer: SELECT PNAME FROM PROGRAMMER WHERE TO_CHAR(DOB,’MON’)= TO_CHAR(SYSDATE,’MON’);

Question 26: How many female programmers are there?
Answer: SELECT COUNT(*) FROM PROGRAMMER WHERE SEX = ‘F’;


Question 27: What are the languages known by the male programmers?
Answer: SELECT DISTINCT(PROF1) FROM PROGRAMMER WHERE SEX = ‘M’;

Question 28: What is the average salary?
Answer: SELECT AVG(SAL) FROM PROGRAMMER;


Question 29: How many people draw 5000 to 7500?
Answer: SELECT COUNT(*) FROM PROGRAMMER WHERE SAL BETWEEN 5000 AND 7500;

Question 30: Display the details of those who don’t know C, Ruby or Java.
Answer: SELECT * FROM PROGRAMMER WHERE PROF1 NOT IN(‘C’,’Ruby’,’Java’) AND PROF2 NOT IN (‘C’,’Ruby’,’Java’);

Question 31: Display the costliest package developed by each programmer.
Answer: SELECT PNAME,TITLE,SCOST FROM SOFTWARE WHERE SCOST IN(SELECT MAX(SCOST) FROM SOFTWARE GROUP BY PNAME);

Question 32: Produce the following output for all the male programmers Programmer Mr. Lyoid – has 15 years of experience
Answer: SELECT ‘Mr.’ || PNAME || ‘ – has ‘ ||TRUNC(MONTHS_BETWEEN(SYSDATE,DOJ)/12) || ‘ years of experience’“Programmer” FROM PROGRAMMER WHERE SEX = ‘M’ UNION SELECT ‘Ms.’ || PNAME || ‘ – has ‘ || TRUNC (MONTHS_BETWEEN(SYSDATE,DOJ)/12) || ‘ years of experience’ “Programmer” FROM PROGRAMMER WHERE SEX = ‘F’;

http://techhowdy.com/wp-content/uploads/2018/04/32-Sample-SQL-Questions-For-Practice-With-SQL-Queries-1024x614.pnghttp://techhowdy.com/wp-content/uploads/2018/04/32-Sample-SQL-Questions-For-Practice-With-SQL-Queries-150x150.pngDemonDatabase Programmingoracle sql questions for practice,pl sql questions for practice,practice questions for joins in sql,practice questions for sql joins,practice questions for sql server 2008,questions of sql for practice,sql interview questions for practice,sql practice questions for beginners,sql queries practice questions and answers,sql queries practice questions online,sql queries practice questions with answers,sql queries practice questions with answers pdf,sql queries questions for practice,sql queries questions for practice pdf,sql query questions and answers for practice pdf,sql questions for practice,sql questions for practice pdf,sql questions to practiceHere is a list of Sample SQL Questions For Practice With SQL Queries that you can use accordingly. These are very common SQL Questions that you would need to find answers in the form of SQL Queries. Please use these to solve your SQL Related problems or you can...Latest technology news