Skip to content

Instantly share code, notes, and snippets.

View Justus-coded's full-sized avatar

Justus Ilemobayo Justus-coded

View GitHub Profile
@Justus-coded
Justus-coded / WOS_7.sql
Created September 29, 2020 17:19
Hackerrank Challenge - Weather Observation Station(WOS)
/*
Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE RIGHT(UPPER(CITY),1) IN ('A', 'E', 'I', 'O', 'U')
@Justus-coded
Justus-coded / Weather Observation Station 8.sql
Created September 29, 2020 18:07
Hackerrank SQL Challenge
/*
Query the list of CITY names from STATION which have vowels (i.e., a, e, i, o, and u) as both their first and last characters. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE (LEFT(UPPER(CITY),1) IN ('A','E','I','O','U')) AND (RIGHT(UPPER(CITY),1) IN ('A','E','I','O','U'))
@Justus-coded
Justus-coded / Weather Observation Station 9.sql
Created September 30, 2020 13:37
Hackerrank SQL Challenge
/*
Query the list of CITY names from STATION that do not start with vowels. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE LEFT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U')
@Justus-coded
Justus-coded / Weather Observation Station 10.sql
Created September 30, 2020 13:40
Hackerrank SQL Challenge
/*
Query the list of CITY names from STATION that do not end with vowels. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE RIGHT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U')
@Justus-coded
Justus-coded / Weather Observation Station 11.sql
Created September 30, 2020 13:45
Hackerrank SQL Challenge
/*
Query the list of CITY names from STATION that either do not start with vowels or do not end with vowels. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE (RIGHT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U')) OR (LEFT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U'))
@Justus-coded
Justus-coded / Weather Observation Station 12.sql
Created September 30, 2020 13:48
Hackerrank SQL Challenge
/*
Query the list of CITY names from STATION that do not start with vowels and do not end with vowels. Your result cannot contain duplicates.
*/
SELECT DISTINCT CITY
FROM STATION
WHERE (RIGHT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U')) AND (LEFT(UPPER(CITY), 1) NOT IN ('A', 'E', 'I', 'O', 'U'))
@Justus-coded
Justus-coded / Higher Than 75 Marks.sql
Created September 30, 2020 14:10
Hackerrank SQL Challenge
/*
Query the Name of any student in STUDENTS who scored higher than Marks. Order your output by the last three characters of each name. If two or more students both have names ending in the same last three characters (i.e.: Bobby, Robby, etc.), secondary sort them by ascending ID.
*/
SELECT Name
FROM STUDENTS
WHERE Marks > 75
ORDER BY RIGHT(Name, 3) , ID ;
@Justus-coded
Justus-coded / Employee Names.sql
Created September 30, 2020 14:14
Hackerrank SQL Challenge
/*
Write a query that prints a list of employee names (i.e.: the name attribute) from the Employee table in alphabetical order.
*/
SELECT name
FROM Employee
ORDER BY name;
@Justus-coded
Justus-coded / Employee Salaries.sql
Created September 30, 2020 14:33
Hackerrank SQL Challenge
/*
Write a query that prints a list of employee names (i.e.: the name attribute) for employees in
Employee having a salary greater than 2000 per month who have been employees for less than months.
Sort your result by ascending employee_id.
*/
SELECT name
FROM Employee
WHERE (salary > 2000) AND (months< 10)
ORDER BY employee_id;
@Justus-coded
Justus-coded / Manual_tuning.py
Last active December 5, 2020 16:43
Hyperparameter tuning of Machine learning models using manual tuning
#import libraries
from sklearn import datasets
from catboost import CatBoostClassifier
from sklearn.model_selection import cross_val_score
# load data
cancer = datasets.load_breast_cancer()
# target
y = cancer.target