본문 바로가기
728x90
반응형

전체 글165

HackerRank_15. Weather Observation Station 9 문제 : 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 SUBSTR(CITY, 1, 1) NOT IN ('a', 'e', 'i', 'o', 'u'); Kissee Mills Loma Mar Sandy Hook Tipton Turner Slidell Negreet Glencoe Chelsea Chignik Lagoon Pelahatchie Hanna City Dorrance Monument Manchester Prescott Graettinger Cahone Sturgis Highwo.. 2020. 6. 11.
HackerRank_14. Weather Observation Station 8 문제 : 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 SUBSTR(CITY, 1, 1) IN ('a', 'e', 'i', 'o', 'u') AND SUBSTR(CITY, -1, 1) IN ('a', 'e', 'i', 'o', 'u'); Upperco Aguanga East China East Irvine Amo Eleele Oconee Amazonia Aliso Viejo Anderso.. 2020. 6. 11.
HackerRank_13. Weather Observation Station 7 문제 : Query the list of CITY names ending with vowels (a, e, i, o, u) from STATION. Your result cannot contain duplicates. SUBSTR을 사용할 때 start의 위치를 -1로 지정해주었다. ( python의 list[-1] 느낌 ! ) SELECT distinct CITY FROM STATION WHERE SUBSTR(CITY, -1, 1) IN ('a', 'e', 'i', 'o', 'u'); Glencoe Chelsea Pelahatchie Dorrance Cahone Upperco Waipahu Millville Aguanga Morenci South El Monte Gustine Delano Westpha.. 2020. 6. 11.
HackerRank_12. Weather Observation Station 6 문제 : Query the list of CITY names starting with vowels (i.e., a, e, i, o, or u) from STATION. Your result cannot contain duplicates. city의 첫번째 문자만 가져오기 위해서 SUBSTR 함수를 사용하자. SUBSTR(str, pos, len) 로 사용할 수 있다. MySQL : SUBSTR(), SUBSTRING() Oracle : SUBSTR() SQL Server : SUBSTRING() SELECT distinct CITY FROM STATION WHERE SUBSTR(CITY, 1, 1) IN ('a', 'e', 'i', 'o', 'u'); Arlington Albany Upperco Agua.. 2020. 6. 11.
HackerRank_11. Weather Observation Station 5 문제 : Query the two cities in STATION with the shortest and longest CITY names, as well as their respective lengths (i.e.: number of characters in the name). If there is more than one smallest or largest city, choose the one that comes first when ordered alphabetically. SELECT CITY, CHAR_LENGTH(CITY) FROM STATION ORDER BY CHAR_LENGTH(CITY) ASC, CITY ASC LIMIT 1; SELECT CITY, CHAR_LENGTH(CITY) FRO.. 2020. 6. 11.
HackerRank_10. Weather Observation Station 4 문제 : SELECT COUNT(*) - COUNT(distinct CITY) FROM STATION; 13 2020. 6. 11.
HackerRank_09. Weather Observation Station 3 문제 : Query a list of CITY names from STATION with even ID numbers only. You may print the results in any order, but must exclude duplicates from your answer. select distinct CITY from STATION where MOD(ID,2) = 0; 2020. 6. 11.
HackerRank_08. Weather Observation Station 2 문제 : Query the following two values from the STATION table: The sum of all values in LAT_N rounded to a scale of decimal places. The sum of all values in LONG_W rounded to a scale of decimal places. SELECT ROUND(SUM(LAT_N), 2) AS lat, ROUND(SUM(LONG_W),2) AS lon FROM STATION; 42850.04 47381.48 2020. 6. 11.
HackerRank_07.Weather Observation Station 1 문제 : Query a list of CITY and STATE from the STATION table. select CITY, STATE from STATION; 2020. 6. 11.
HackerRank_06. Japanese Cities' Names 문제 : Query the names of all the Japanese cities in the CITY table. The COUNTRYCODE for Japan is JPN. select NAME from CITY where COUNTRYCODE = 'JPN'; Neyagawa Ageo Sayama Omuta Tokuyama 2020. 6. 11.
HackerRank_05.Japanese Cities' Attributes 문제 : Query all attributes of every Japanese city in the CITY table. The COUNTRYCODE for Japan is JPN. select * from CITY where COUNTRYCODE = 'JPN'; 1613 Neyagawa JPN Osaka 257315 1630 Ageo JPN Saitama 209442 1661 Sayama JPN Saitama 162472 1681 Omuta JPN Fukuoka 142889 1739 Tokuyama JPN Yamaguchi 107078 2020. 6. 11.
HackerRank_04. Select By ID 문제 : Query all columns for a city in CITY with the ID 1661. select * from CITY where ID = 1661; 1661 Sayama JPN Saitama 162472 2020. 6. 11.
HackerRank_03. SELECT ALL 문제 : Query all columns (attributes) for every row in the CITY table. select * from CITY 6 Rotterdam NLD Zuid-Holland 593321 3878 Scottsdale USA Arizona 202705 3965 Corona USA California 124966 3973 Concord USA California 121780 3977 Cedar Rapids USA Iowa 120758 3982 Coral Springs USA Florida 117549 4054 Fairfield USA California 92256 4058 Boulder USA Colorado 91238 4061 Fall River USA Massachuse.. 2020. 6. 11.
HackerRank_02. Revising the Select Query II 문제 : Query the names of all American cities in CITY with populations larger than 120000. The CountryCode for America is USA. select Name from CITY where COUNTRYCODE = 'USA' AND POPULATION > 120000; Scottsdale Corona Concord Cedar Rapids 2020. 6. 11.
HackerRank_01. Revising the Select Query I 문제 : Query all columns for all American cities in CITY with populations larger than 100000. The CountryCode for America is USA. select * from CITY where COUNTRYCODE = 'USA' AND POPULATION > 100000; 3878 Scottsdale USA Arizona 202705 3965 Corona USA California 124966 3973 Concord USA California 121780 3977 Cedar Rapids USA Iowa 120758 3982 Coral Springs USA Florida 117549 2020. 6. 11.
03. Data Type #R #DataType #기본데이터 #특수데이터 #numeric #charcter #logical #complex #NULL #NA #Nan #Inf #-Inf #mode #is #as ​ ​ ​ 1. 기본 데이터 타입 1) 숫자형(numeric) : 숫자로 되어있고 정수형, 실수형을 의미 100 이면 실수형 100L 이면 정수형 2) 문자열(character) : 하나 혹은 둘 이상의 문자 집합 "홍길동" '최길동' '홍' 3) 논리형(logical) : TRUE(T), FALSE(F) 4) 복소수형(complex) : 4-3i ​ 2. 특수 데이터 타입 1) NULL : 객체가 존재하지 않음을 지칭하는 객체 2) NA : Not Available 결측치 표현시에 사용 -> 데이터 전처리 과정에서 이상.. 2020. 5. 28.
02. vector #R #vector #선형저장공간 #& #&& ​ 1. vector - 연속적인 저장공간 (선형) - 1차원 자료구조 - R의 여러가지 자료구조 중 대표적 - 저장공간 안에 모두 같은 데이터 타입이 저장됨 - 함수를 이용해서 vector 생성 ​ 2. c() : combine의 약자 입력 : c(10,20,30) 결과 : 10 20 30 ​ 입력 : c(TRUE, 20, 3.14) 결과 : 1.0 20 3.14 ​ 입력 : c(TRUE,FALSE) & c(TRUE, TRUE) 결과 : TRUE FALSE ​ 입력 : c(TRUE,FALSE) && c(TRUE, TRUE) 결과 : TRUE -> 맨 앞의 벡터만 연산하고 나머지는 안함( &, &&에서 스칼라와 벡터의 차이점! ) ​ 입력 : c(TRUE,F.. 2020. 5. 27.
01. Operator (연산자) #R #Operator #연산자 #비교연산자 #논리연산자 ​ var1 = 100 var2 = 3 ​ 1. 몫 구하기 : %/% 입력 : var1%/%var2 결과 : 33 ​ 2. 나머지 구하기 : %% 입력 : var1%%var2 결과 : 1 ​ 3. 비교연산자 입력 : var1 ​== var2 결과 : FALSE(F) ​ 입력 : var1 != var2 결과 : TRUE(T) ​ 4. 논리연산자(AND 연산) ※스칼라 연산에서는 &와 &&, | 와 || 의 차이가 없다 !! 벡터 연산에서는 차이가 있다!! 1) &, && : 양쪽 값이 TRUE이면 결과가 TRUE 2) |,|| : 하나라도 TRUE이면 결과가 TRUE ​ 입력 : TRUE & TRUE 결과 : TRUE ​ 입력 : TRUE & FAL.. 2020. 5. 27.
00. R 개요 #R #alignment #cat() #seq() ​ 1. 변수에 값을 할당하는 방법 var1 =​ 100 var2 ​ var3 ​ 2. 여러개의 값을 동시에 출력하는 방법 : cat() 사용 ​ 입력 : cat(var1,var2) 결과 : 100 200 ​ 입력 : cat("결과값은 : ", var1) 결과 : 결과값은 : 100 ​ ※ print("결과값은 : " + var1)에서 + 연산을 문자, 숫자 연결을 위해 사용할 수 없다. R은 숫자연산에만 + 사용이 가능하다 ​ 3. 순서, 순열의 집합을 표현할 때 : seq() 사용 mySeq = seq(100) 일 때, 1부터 100까지 1씩 증가하는 숫자의 집합 mySeq = seq(5,100) 일 때, 5부터 100까지 1씩 증가하는 숫자의 집합 .. 2020. 5. 27.
통계분석_성별/혼인/피부/가격/재사용 등 In [30]: import tensorflow as tf C:\python\envs\cpu_env\lib\site-packages\tensorflow\python\framework\dtypes.py:493: FutureWarning: Passing (type, 1) or '1type' as a synonym of type is deprecated; in a future version of numpy, it will be understood as (type, (1,)) / '(1,)type'. _np_qint8 = np.dtype([("qint8", np.int8, 1)]) C:\python\envs\cpu_env\lib\site-packages\tensorflow\pytho.. 2020. 5. 24.
728x90
반응형