Tutor SQL
@TutorSql
Followers
26
Following
3
Media
23
Statuses
34
Find answers to commonly asked SQL interview questions.
Joined July 2023
How can you find the 3rd highest salary in Oracle using an analytic function? #DenseRank #SQL #TutorSQL #Oracle #Analytics #Database #DataAnalyst #DataScientist
0
0
0
Q9: Write an SQL query using CASE to calculate the grade for each student: If the avg of math and science scores is greater than or equal to 90, assign A grade. If the avg is between 80 & 89, assign B grade If the avg is between 70 & 79, assign C grade Otherwise, assign 'D'.
0
0
1
If you find these interview questions helpful and insightful, consider following us on Twitter for more engaging content and valuable insights into SQL and database-related topics! ππ#SQLInterviewQuestions #TechInterviews #DatabaseSkills #FollowUs #InterviewPractice #SQLCoding
1
0
0
We calculate the percentage growth by subtracting the previous month's sales from the current month's sales, dividing by the previous month's sales, and multiplying by 100. The ROUND function round the percentage growth to two decimal places.
1
0
0
In this query, we use the LEAD and LAG functions to access values from the previous and next rows. The PARTITION BY clause is used with LEAD and LAG to calculate the values within each partition of the specified column (in this case, product_id).
1
0
0
Q8: Write an SQL query to calculate the month-over-month percentage growth for each product's sales. You should retrieve the product_id, sale_date, and percentage growth from the previous month's sales using the LEAD and LAG functions.
1
0
0
Protip: π Do you know that using the LEAD and LAG functions effectively and considering both the PARTITION BY and ORDER BY clauses, you can perform robust time-based and comparative analysis on your data in Oracle SQL. π
0
1
0
If you find these interview questions helpful and insightful, consider following us on Twitter for more engaging content and valuable insights into SQL and database-related topics! ππ #SQLInterviewQuestions
#TechSkills
#SQLCoding
#SQLTips
#DataSorting
#InterviewPractice
0
0
0
The expected output values are for illustrative purposes and may vary based on the provided data.) #OracleSQLInterview
#RowNumTechnique
#FetchClause
#TopNRows
#OrderBy
#SQLLimitEquivalent
#QueryChallenge
#InterviewPrep
#DatabaseSkills
#TechInterviews
#SQLQueries
#DataRetrieval
1
0
0
Here's the SQL query to solve the same interview question using the FETCH clause in Oracle. The FETCH FIRST 3 ROWS ONLY clause limits the result set to the first 3 rows after sorting the rows in ascending order based on the "price" column using the ORDER BY clause.
1
0
0
The inner query retrieves all rows from the "products" table and sorts them in asc order based on the "price" using the ORDER BY clause. The outer query then selects the rows from the result of the inner query where the ROWNUM is <= 3, limiting to the top 3 cheapest products.
1
0
0
Q7: In Oracle SQL, the LIMIT function is unavailable, but there's an equivalent approach using the ROWNUM technique. Consider a table named "products" as per the screenshot. Write an SQL query to retrieve the top 3 cheapest products using the ROWNUM technique (equi. to LIMIT).
1
0
0
A master class in creating Synthetic datasets with LLMs! π ToolLLM paper has been popular for creating the strongest API following models. I think thereβs an incredibly underrated side to it, hereβs my summary: - The paper aims to improve API following capabilities of open
3
37
220
The TO_CHAR function extracts and formats the hours, minutes, and seconds from the "event_date". The 'HH24' format specifier extracts the hours in 24-hour format with leading zeros, 'MI' extracts the minutes with leading zeros, and 'SS' extracts the seconds with leading zeros.
1
0
0
Question #6: Imagine you have a table named "events" with the attached structure and data: Write an SQL query to extract the hours, minutes, and seconds from the "event_date" column and display them in separate columns in the result set. Hint: Use the TO_CHAR function.
1
0
0