Skip to content

SQL repository contains my answers to queries and challenges posed by numerous websites.

Notifications You must be signed in to change notification settings

Tungana-Bhavya/SQL

Repository files navigation

Content


  1. Description of SQL
  2. StrataScratch Solutions
  3. Leetcode Solutions
  4. Hackerrank Solutions
  5. DataLemur Solutions

SQL

Structured Query Language(SQL) is special purpose programming language which is designed for managing relational database. SQL is the one of the basis for relational database. SQL provides various commands and classified as :

  • Data Definition Language(DDL):CREATE, DROP, TRUNCATE, ALTER
  • Data Manipulation Language(DML):SELECT, INSERT,UPDATE, DELETE
  • Data Control Language(DCL): GRANT, REVOKE
  • Transaction Control Language(TCL):COMMIT, ROLLBACK, SAVEPOINT

The below are my solutions to the various queries and challenges

StrataScratch

ID QUESTION ANSWER IMAGE
1 Salaries Differences Solution Output
2 Finding Updated Records Solution Output
3 Unique Users Per Client Per Month Solution Output
4 Bikes Last Used Solution Output
5 Reviews of Hotel Arena Solution Output
6 Count the number of movies that Abigail Breslin nominated for oscar Solution Output
7 Popularity of Hack Solution Output
8 Lyft Driver Wages Solution Output
9 Find how many times each artist appeared on the Spotify ranking list Solution Output
10 Find the base pay for Police Captains Solution Output
11 Find libraries who haven't provided the email address in circulation
year 2016 but their notice preference definition is set to email
Solution Output
12 Average Salaries Solution Output
13 Customer Details Solution Output
14 Number of Workers by Department Starting in April or Later Solution Output
15 Admin Department Employees Beginning in April or Later Solution Output
16 Churro Activity Date Solution Output
17 Find the most profitable company in the financial sector of the entire
world along with its continent
Solution Output
18 Count the number of user events performed by MacBookPro users Solution Output
19 Number Of Bathrooms And Bedrooms Solution Output
20 Number of Shipments Per Month Solution Output
21 Order Details Solution Output
22 Find all posts which were reacted to with a heart Solution Output
23 Most Lucrative Products Solution Output
24 Activity Rank Solution Output
25 New Products Solution Output
26 Number Of Units Per Nationality Solution Output
27 Ranking Most Active Guests Solution Output
28 Find the top 10 ranked songs in 2010 Solution Output
29 Top Cool Votes Solution Output
30 Find matching hosts and guests in a way that they
are both of the same gender and nationality
Solution Output
31 Highest Salary In Department Solution Output
32 Number of violations Solution Output
33 Top Ranked Songs Solution Output
34 Find all wineries which produce wines by possessing aromas of plum,
cherry, rose, or hazelnut
Solution Output
35 Highest Cost Orders Solution Output
36 Second Highest Salary Solution Output
37 Customer Revenue In March Solution Output
38 Highest Target Under Manager Solution Output
39 Employee and Manager Salaries Solution Output
40 Top Businesses With Most Reviews Solution Output

Leetcode

ID QUESTION ANSWER
1 Recyclable and Low Fat Products Solution
2 Find Customer Referee Solution
3 Big Countries Solution
4 Article Views I Solution
5 Invalid Tweets Solution
6 Replace Employee ID With The Unique Identifier Solution
7 Product Sales Analysis I Solution
8 Customer Who Visited but Did Not Make Any Transactions Solution
9 Rising Temperature Solution
10 Employee Bonus Solution
11 Not Boring Movies Solution
12 Project Employees I Solution
13 Queries Quality and Percentage Solution
14 Classes More Than 5 Students Solution
15 Find Followers Count Solution
16 Biggest Single Number Solution
17 Customers Who Bought All Products Solution
18 Fix Names in a Table Solution
19 Patients With a Condition Solution
20 Average Time of Process per Machine Solution
21 Employees Whose Manager Left the Company Solution
22 Second Highest Salary Solution

HackerRank

ID QUESTION ANSWER
1 Select All Solution
2 Revising the Select Query I Solution
3 Revising the Select Query II Solution
4 Select By ID Solution
5 Japanese Cities' Attributes Solution
6 Japanese Cities' Names Solution
7 Weather Observation Station 1 Solution
8 Weather Observation Station 3 Solution
9 Weather Observation Station 4 Solution
10 Weather Observation Station 5 Solution
11 Weather Observation Station 6 Solution
12 Weather Observation Station 7 Solution
13 Weather Observation Station 8 Solution
14 Weather Observation Station 9 Solution
15 Weather Observation Station 10 Solution
16 Weather Observation Station 11 Solution
17 Weather Observation Station 12 Solution
18 Higher Than 75 Marks Solution
19 Employee Names Solution
20 Employee Salaries Solution
21 Placements Solution
22 Binary Tree Nodes Solution
23 New Companies Solution
24 Weather Observation Station 18 Solution
25 Weather Observation Station 19 Solution

DataLemur

ID QUESTION ANSWER IMAGE
1 Data Science Skills Solution Output
2 Page With No Likes Solution Output
3 Unfinished Parts Solution Output
4 Laptop vs. Mobile Viewership Solution Output
5 Cities With Completed Trades Solution Output
6 Teams Power Users Solution Output
7 Average Review Ratings Solution Output
8 Cards Issued Difference Solution Output
9 Compressed Mean Solution Output
10 Pharmacy Analytics (Part 1) Solution Output
11 Pharmacy Analytics (Part 2) Solution Output
12 App Click-through Rate (CTR)] Solution Output
13 Duplicate Job Listings Solution Output
14 Average Post Hiatus (Part 1) Solution Output