djdj - HTMLify profile
files of /djdj/challange/
/*
https://www.hackerrank.com/challenges/
revising-the-select-query/problem
*/
SELECT *
FROM CITY
WHERE population > 100000
https://www.hackerrank.com/challenges/
revising-the-select-query/problem
*/
SELECT *
FROM CITY
WHERE population > 100000
/*
https://www.hackerrank.com/challenges/weather-observation-station-5/problem
*/
SELECT CITY, LENGTH(CITY)
FROM STATION
ORDER
https://www.hackerrank.com/challenges/weather-observation-station-5/problem
*/
SELECT CITY, LENGTH(CITY)
FROM STATION
ORDER
/*
https://www.hackerrank.com/challenges/weather-observation-station-6/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE CITY
https://www.hackerrank.com/challenges/weather-observation-station-6/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE CITY
/*
https://www.hackerrank.com/challenges/weather-observation-station-7/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE CITY
https://www.hackerrank.com/challenges/weather-observation-station-7/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE CITY
/*
https://www.hackerrank.com/challenges/weather-observation-station-8/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE CITY
https://www.hackerrank.com/challenges/weather-observation-station-8/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE CITY
/*
https://www.hackerrank.com/challenges/weather-observation-station-9/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE CITY
https://www.hackerrank.com/challenges/weather-observation-station-9/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE CITY
/*
https://www.hackerrank.com/challenges/weather-observation-station-10/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE CIT
https://www.hackerrank.com/challenges/weather-observation-station-10/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE CIT
/*
https://www.hackerrank.com/challenges/weather-observation-station-11/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE LEF
https://www.hackerrank.com/challenges/weather-observation-station-11/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE LEF
/*
https://www.hackerrank.com/challenges/weather-observation-station-12/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE LEF
https://www.hackerrank.com/challenges/weather-observation-station-12/problem
*/
SELECT DISTINCT CITY
FROM STATION
WHERE LEF
/*
https://leetcode.com/problems/combine-two-tables/description
*/
# Write your MySQL query statement below
Select firstName,
https://leetcode.com/problems/combine-two-tables/description
*/
# Write your MySQL query statement below
Select firstName,
/*
https://leetcode.com/problems/second-highest-salary/
*/
# Write your MySQL query statement below
select
(select distinct
https://leetcode.com/problems/second-highest-salary/
*/
# Write your MySQL query statement below
select
(select distinct
SELECT name
FROM city
WHERE countrycode = 'USA'
AND population > 120000;
FROM city
WHERE countrycode = 'USA'
AND population > 120000;
/*
https://leetcode.com/problems/employees-earning-more-than-their-managers/description/
*/
# Write your MySQL query statement
https://leetcode.com/problems/employees-earning-more-than-their-managers/description/
*/
# Write your MySQL query statement
# Write your MySQL query statement below
select email from person
group by email
having count(email) > 1;
select email from person
group by email
having count(email) > 1;
# Write your MySQL query statement below
select name as Customers from Customers
where id not in(select customerId from Orders);
select name as Customers from Customers
where id not in(select customerId from Orders);
# Write your MySQL query statement below
delete p1
from Person p1
inner join Person p2
on p1.email = p2.email
where p1.id > p2.i
delete p1
from Person p1
inner join Person p2
on p1.email = p2.email
where p1.id > p2.i
# Write your MySQL query statement below
SELECT w1.id
FROM Weather w1
JOIN Weather w2
ON DATEDIFF(w1.recordDate, w2.recordDate
SELECT w1.id
FROM Weather w1
JOIN Weather w2
ON DATEDIFF(w1.recordDate, w2.recordDate
# Write your MySQL query statement below
SELECT
player_id,
MIN(event_date) AS first_login
FROM
Activity
GROUP BY
SELECT
player_id,
MIN(event_date) AS first_login
FROM
Activity
GROUP BY
# Write your MySQL query statement below
SELECT name
FROM Employee
WHERE id IN (
SELECT managerId
FROM Employee
WHER
SELECT name
FROM Employee
WHERE id IN (
SELECT managerId
FROM Employee
WHER
# Write your MySQL query statement below
select name,bonus from employee
left join bonus
on bonus.empId = employee.empId
where b
select name,bonus from employee
left join bonus
on bonus.empId = employee.empId
where b
# Write your MySQL query statement below
select round(sum(tiv_2016),2) as tiv_2016
from Insurance
WHERE
tiv_2015 IN (
select round(sum(tiv_2016),2) as tiv_2016
from Insurance
WHERE
tiv_2015 IN (
# Write your MySQL query statement below
SELECT customer_number FROM Orders
GROUP BY customer_number
ORDER BY COUNT(*) desc limi
SELECT customer_number FROM Orders
GROUP BY customer_number
ORDER BY COUNT(*) desc limi
# Write your MySQL query statement below
select name,population,area from World
where area >= 3000000 or population >= 25000000;
select name,population,area from World
where area >= 3000000 or population >= 25000000;
# Write your MySQL query statement below
select class from courses
group by class
having count(class) >= 5
select class from courses
group by class
having count(class) >= 5
# Write your MySQL query statement below
SELECT MAX(num) AS num
FROM (
SELECT num
FROM MyNumbers
GROUP BY num
HA
SELECT MAX(num) AS num
FROM (
SELECT num
FROM MyNumbers
GROUP BY num
HA
# Write your MySQL query statement below
select * from cinema
where id % 2 = 1 and description != 'boring' order by rating desc;
select * from cinema
where id % 2 = 1 and description != 'boring' order by rating desc;
# Write your MySQL query statement below
update salary set sex = replace('m',sex,'f');
update salary set sex = replace('m',sex,'f');
# Write your MySQL query statement below
SELECT customer_id
FROM Customer
GROUP BY customer_id
HAVING COUNT(DISTINCT product_key
SELECT customer_id
FROM Customer
GROUP BY customer_id
HAVING COUNT(DISTINCT product_key
# Write your MySQL query statement below
select actor_id,director_id from ActorDirector
group by actor_id, director_id
Having c
select actor_id,director_id from ActorDirector
group by actor_id, director_id
Having c
# Write your MySQL query statement below
select product_name, year, price
from Sales
inner join Product
where Sales.product_i
select product_name, year, price
from Sales
inner join Product
where Sales.product_i
# Write your MySQL query statement below
select distinct p.project_id, Round(AVG(e.experience_years), 2) AS average_years
from
select distinct p.project_id, Round(AVG(e.experience_years), 2) AS average_years
from
# Write your MySQL query statement below
select distinct author_id as id
from Views
where author_id = viewer_id
order by id a
select distinct author_id as id
from Views
where author_id = viewer_id
order by id a
# Write your MySQL query statement below
select
p.product_id,
round(coalesce(sum(p.price * u.units) / sum(u.units),0), 2) a
select
p.product_id,
round(coalesce(sum(p.price * u.units) / sum(u.units),0), 2) a
/*
https://www.hackerrank.com/challenges/weather-observation-station-3/problem
*/
SELECT DISTINCT city
FROM station
WHERE MOD
https://www.hackerrank.com/challenges/weather-observation-station-3/problem
*/
SELECT DISTINCT city
FROM station
WHERE MOD
/*
https://www.hackerrank.com/challenges/weather-observation-station-1/problem
*/
SELECT city, state
FROM station;
https://www.hackerrank.com/challenges/weather-observation-station-1/problem
*/
SELECT city, state
FROM station;