SQL query





1

Question 1:
You have a table named "FlightBookings" with columns: BookingID, FlightDate, PassengerID, Destination.
Write a SQL query to determine which destination has seen a steady month-on-month increase in bookings over the last year.
Question 2:
You have three tables: "Employees," "Departments," and "Salaries." The "Employees' table has the following columns: EmployeelD, EmployeeName, DepartmentID. The "Departments" table has the following columns: DepartmentID, DepartmentName. The "Salaries" table has the following columns: EmployeelD, Salary, EffectiveDate. Write a SQL query to retrieve the employee who has had the highest salary increase within the last year, along with their name, department, and the percentage increase.
Question 3:
Consider a table named "TouristSpots" with columns: SpotID, SpotName, VisitorID, VisitDate. Write a SQL query to find the least visited tourist spots in the last summer.
Question 4:
There are two tables: "Blog Posts" and "Comments". The "BlogPosts" table has columns: PostID, Title, PostDate, AuthorID.
The "Comments" table has columns: CommentID, PostID,
CommentDate, Text.
Write a SQL query to fetch the blog posts that have not received any comments within a week of their posting.
Question 5:
Consider a table named "OnlineCourses" with columns: CourseID, EnrollmentDate, StudentID, Completion Date. Write a SQL query to determine the courses which have the highest drop rate (i.e., students enrolling but not completing).
Question 6:
Consider a table named "Elections" with columns: CandidateID, VoterID, VoteDate. Write an SQL query to calculate the candidate who received the highest number of votes each month.

 


Contact us for software training, education or development










 

Post a Comment

0 Comments