
Weekends means the Saturdays and Sundays from the month. The query will give the all the dates from first to last of current date.įrom all the month, we need to calculate the weekends. SELECT TRUNC (SYSDATE,’mm’) +LEVEL-1 Current_dtĬONNECT BY LEVEL <= last_day (SYSDATE) – TRUNC (SYSDATE,’mm’) +1 Let us Fragment the Query for Understanding, Where TO_CHAR (Current_dt,’dy’) IN (‘sat’,’sun’) (SELECT TRUNC (SYSDATE,’mm’) +LEVEL-1 Current_dtĬONNECT BY LEVEL <= last_day (SYSDATE) – TRUNC (SYSDATE,’mm’) +1 (Select * from Tabs) -Tabs is system table in which user get the different user defined table names.Įxecute immediate (‘Drop Table ‘||i.table_name||’cascade constraints’) ġ1.How to get number of Weekends of current month? To Drop all tables user needs to write simple PLSQL block Tip: In real scenarios, lot of times developer needs to calculate the number of commas in the column then regexp_count function is used.ĩ.How to create the Student_1 table, which is exact replica of Student table?Ĭreate Table Student_1 as select * from Student ġ0.What is Query to drop all user tables from Oracle? Select Student_name, regexp_count (marks,’,’) + As “Marks Count” from Student

Want to display output like : Student Name
INTERVIEW QUESTIONS FOR ORACLE SQL DEVELOPER HOW TO
How to calculate the count of that comma separated values? Student Name Select to_date (Hire_date,’DD-MON-YYYY’) Date_Format from Employee Ĩ.If marks column contain the comma separated values from Student table. SELECT lpad (‘*’, ROWNUM,’*’) FROM Student WHERE ROWNUM <4 ħ.How to display Date in DD-MON-YYYY table? We cannot use dual table to display output given above. Click here to get information about union and union all. Tip : Use the concept of union to show the max and min marks together. Select * from Employee a Where 3 = (Select Count (distinct Salary) from Employee where a.salary<=b.salary ĥ.How to Show the Max marks and min marks together from student table? Select rollno, count (rollno) from StudentĤ.How to find Third highest salary in Employee table using self-join?(90% asked Complex SQL Interview Questions ) (Select max (rowid) from Student b where rollno=b.rollno) 3.How to find count of duplicate rows? (95% asked complex sql interview questions )

These are stored separately from other data items.(Select max (rowid) from Student b where rollno=b.rollno)

3) State few characteristics of PL/SQL?.2) Differentiate between PL/SQL and SQL?.
