1. https://www.hackerrank.com/challenges/revising-the-select-query-2/problem?isFullScreen=true Revising the Select Query II | HackerRank Query the city names for all American cities with populations larger than 120,000. www.hackerrank.com Q: Query the NAME field for all American cities in the CITY table with populations larger than 120000. The CountryCode for America is USA. The CITY table is de..
1. https://www.hackerrank.com/challenges/revising-the-select-query/problem?isFullScreen=true Revising the Select Query I | HackerRank Query the data for all American cities with populations larger than 100,000. www.hackerrank.com Q: Query all columns for all American cities in the CITY table with populations larger than 100000. The CountryCode for America is USA. The CITY table is described as f..
LIKE 활용, 데이터 속 문자열의 패턴 찾기 - LIKE 명령어 뒤에 문자열 조건 써주기 - %기호는 아무 문자나 들어가도 상관없다는 뜻이다, '와일드카드'라고도 불림 ex) b% : b라는 문자로 시작하는 모든 데이터 검색 %b : b라는 문자로 끝나는 모든 데이터 검색 %b% : b라는 문자가 속해있는 모든 데이터 검색 SELECT * FROM Customers WHERE country LIKE '%r' -- 또는 SELECT * FROM Customers WHERE country LIKE 'r%' -- 또는 SELECT * FROM Customers WHERE country LIKE '%r%' - 만약 찾고 싶은 키워드가 명확하다면. 즉, 패턴을 가지고 데이터를 불러오고 싶은게 아니라면 LIKE ..
특정 조건을 가지는 데이터 가져오기 SELECT * FROM 테이블명 WHERE 칼럼명 = '데이터값' -- 예를 들어 SELECT * FROM Customers WHERE Country = 'Germany' 비교연산자 = 같다 다르다 >= 크거나 같다 크다 < 작다 SELECT * FROM Customers WHERE CustomerID < 50 또는 SELECT * FROM Customers WHERE CustomerName < 'B' -- 알파벳 순서에 따라 문자 'B' 이전에 오는 데이터들만 검색하게됨 논리연산자 AND: 그리고, 조건을 결합하고 싶을 때 SELECT * 또는 칼럼명 FROM 테이블명 WHERE 조건1 AND 조건2 AND... -- 예를 들어 SELECT * FROM Custom..
모든 데이터 가져오기 SELECT * FROM 테이블명 예제: https://www.hackerrank.com/challenges/select-all-sql/problem?isFullScreen=true Select All | HackerRank Query all columns for every row in a table. www.hackerrank.com Q: Query all columns (attributes) for every row in the CITY table. The CITY table is described as follows: A: SELECT * FROM city !! 가독을 위해 명령어는 대문자로, 테이블명이나 칼럼명은 소문자로 써준다. 특정 칼럼의 데이터 가져오기 SELECT 칼럼..
1. SQL이란? - SQL이란 Structured Query Langauge, 구조적 쿼리 언어로 관계형 데이터베이스에 정보를 저장하고 처리하기 위한 프로그래밍 언어이다. - 관계형 데이터베이스는 정보를 표 형식으로 저장하며, 행과 열은 다양한 데이터 속성과 데이터값 간의 관계를 나타낸다. - SQL문을 사용하여 데이터베이스에서 정보를 저장, 업데이트, 제거, 검색 등을 할 수 있으며 데이터베이스의 성능을 유지, 관리하고 최적화하는데에 SQL을 사용하기도 한다. - SQL은 모든 유형의 어플리케이션에서 자주, 널리 사용되는 쿼리 언어로 데이터 분석가와 개발자는 SQL이 서로 다른 프로그래밍 언어와 잘 통합되기 때문에 사용한다. - Oracle 또는 MS SQL Server와 같은 주요 SQL 데이터베이..