데이터베이스 개발자 질문과 답변 게시판

데이터베이스 개발/운영 관련 질문과 답변을 올리는 게시판입니다. 궁금하신 내용을 이곳에서 문의하시면 SQLER 분들의 답변을 받으실 수 있습니다. 문의를 하실때에는 최근 작업하신 특이 사항이나, 장애 발생 전 상황을 상세히 올려 주시면 답글을 적어주시는 SQLER분들의 답변이 더 정확할 수 있으니 도움 되시길 바랍니다. 쿼리 문의일 경우, 실제 문제가 재현되는 테이블생성, 샘플데이터 생성 쿼리를 함께 올려 주시면 더 빠르고 정확한 쿼리 문의 응답이 가능합니다.

sql 쿼리 질문 드립니다

me3258 2018.06.04 20:46 Views : 869

1For Those About To Rock We Salute You11AC/DC
1For Those About To Rock We Salute You12Accept
1For Those About To Rock We Salute You13Aerosmith
1For Those About To Rock We Salute You14Alanis Morissette
1For Those About To Rock We Salute You15Alice In Chains
1For Those About To Rock We Salute You16Antônio Carlos Jobim
1For Those About To Rock We Salute You17Apocalyptica
1For Those About To Rock We Salute You18Audioslave
1For Those About To Rock We Salute You19BackBeat
1For Those About To Rock We Salute You110Billy Cobham
1For Those About To Rock We Salute You111Black Label Society
1For Those About To Rock We Salute You112Black Sabbath
1For Those About To Rock We Salute You113Body Count
1For Those About To Rock We Salute You114Bruce Dickinson
1For Those About To Rock We Salute You115Buddy Guy
1For Those About To Rock We Salute You116Caetano Veloso
1For Those About To Rock We Salute You117Chico Buarque
1For Those About To Rock We Salute You118Chico Science & Nação Zumbi
1For Those About To Rock We Salute You119Cidade Negra
1For Those About To Rock We Salute You120Cláudio Zoli
1For Those About To Rock We Salute You121Various Artists
1For Those About To Rock We Salute You122Led Zeppelin
1For Those About To Rock We Salute You123Frank Zappa & Captain Beefheart
1For Those About To Rock We Salute You124Marcos Valle
1For Those About To Rock We Salute You125Milton Nascimento & Bebeto
1For Those About To Rock We Salute You126Azymuth
1For Those About To Rock We Salute You127Gilberto Gil
1For Those About To Rock We Salute You128João Gilberto
1For Those About To Rock We Salute You129Bebel Gilberto
1For Those About To Rock We Salute You130Jorge Vercilo
1For Those About To Rock We Salute You131Baby Consuelo
1For Those About To Rock We Salute You132Ney Matogrosso
1For Those About To Rock We Salute You133Luiz Melodia
1For Those About To Rock We Salute You134Nando Reis
1For Those About To Rock We Salute You135Pedro Luís & A Parede
1For Those About To Rock We Salute You136O Rappa
1For Those About To Rock We Salute You137Ed Motta
1For Those About To Rock We Salute You138Banda Black Rio
1For Those About To Rock We Salute You139Fernanda Porto
1For Those About To Rock We Salute You140Os Cariocas
1For Those About To Rock We Salute You141Elis Regina
1For Those About To Rock We Salute You142Milton Nascimento
1For Those About To Rock We Salute You143A Cor Do Som
1For Those About To Rock We Salute You144Kid Abelha
1For Those About To Rock We Salute You145Sandra De Sá
1For Those About To Rock We Salute You146Jorge Ben
1For Those About To Rock We Salute You147Hermeto Pascoal
1For Those About To Rock We Salute You148Barão Vermelho
1For Those About To Rock We Salute You149Edson, DJ Marky & DJ Patife Featuring Fernanda Porto
1For Those About To Rock We Salute You150Metallica
1For Those About To Rock We Salute You151Queen
1For Those About To Rock We Salute You152Kiss
1For Those About To Rock We Salute You153Spyro Gyra
1For Those About To Rock We Salute You154Green Day
1For Those About To Rock We Salute You155David Coverdale
1For Those About To Rock We Salute You156Gonzaguinha
1For Those About To Rock We Salute You157Os Mutantes
1For Those About To Rock We Salute You158Deep Purple
1For Those About To Rock We Salute You159Santana
1For Those About To Rock We Salute You160Santana Feat. Dave Matthews
1For Those About To Rock We Salute You161Santana Feat. Everlast
1For Those About To Rock We Salute You162Santana Feat. Rob Thomas
1For Those About To Rock We Salute You163Santana Feat. Lauryn Hill & Cee-Lo
1For Those About To Rock We Salute You164Santana Feat. The Project G&B
1For Those About To Rock We Salute You165Santana Feat. Maná
1For Those About To Rock We Salute You166Santana Feat. Eagle-Eye Cherry
1For Those About To Rock We Salute You167Santana Feat. Eric Clapton
1For Those About To Rock We Salute You168Miles Davis
1For Those About To Rock We Salute You169Gene Krupa
1For Those About To Rock We Salute You170Toquinho & Vinícius
1For Those About To Rock We Salute You171Vinícius De Moraes & Baden Powell
1For Those About To Rock We Salute You172Vinícius De Moraes
1For Those About To Rock We Salute You173Vinícius E Qurteto Em Cy
1For Those About To Rock We Salute You174Vinícius E Odette Lara
1For Those About To Rock We Salute You175Vinicius, Toquinho & Quarteto Em Cy
1For Those About To Rock We Salute You176Creedence Clearwater Revival
1For Those About To Rock We Salute You177Cássia Eller
1For Those About To Rock We Salute You178Def Leppard
1For Those About To Rock We Salute You179Dennis Chambers
1For Those About To Rock We Salute You180Djavan
1For Those About To Rock We Salute You181Eric Clapton
1For Those About To Rock We Salute You182Faith No More
1For Those About To Rock We Salute You183Falamansa
1For Those About To Rock We Salute You184Foo Fighters
1For Those About To Rock We Salute You185Frank Sinatra
1For Those About To Rock We Salute You186Funk Como Le Gusta
1For Those About To Rock We Salute You187Godsmack
1For Those About To Rock We Salute You188Guns N' Roses
1For Those About To Rock We Salute You189Incognito
1For Those About To Rock We Salute You190Iron Maiden
1For Those About To Rock We Salute You191James Brown
1For Those About To Rock We Salute You192Jamiroquai
1For Those About To Rock We Salute You193JET
1For Those About To Rock We Salute You194Jimi Hendrix
1For Those About To Rock We Salute You195Joe Satriani
1For Those About To Rock We Salute You196Jota Quest
1For Those About To Rock We Salute You197João Suplicy
1For Those About To Rock We Salute You198Judas Priest
1For Those About To Rock We Salute You199Legião Urbana
1For Those About To Rock We Salute You1100Lenny Kravitz
1For Those About To Rock We Salute You1101Lulu Santos
1For Those About To Rock We Salute You1102Marillion
1For Those About To Rock We Salute You1103Marisa Monte
1For Those About To Rock We Salute You1104Marvin Gaye
1For Those About To Rock We Salute You1105Men At Work
1For Those About To Rock We Salute You1106Motörhead
1For Those About To Rock We Salute You1107Motörhead & Girlschool
1For Those About To Rock We Salute You1108Mônica Marianno
1For Those About To Rock We Salute You1109Mötley Crüe
1For Those About To Rock We Salute You1110Nirvana
1For Those About To Rock We Salute You1111O Terço
1For Those About To Rock We Salute You1112Olodum
1For Those About To Rock We Salute You1113Os Paralamas Do Sucesso
1For Those About To Rock We Salute You1114Ozzy Osbourne
1For Those About To Rock We Salute You1115Page & Plant
1For Those About To Rock We Salute You1116Passengers
1For Those About To Rock We Salute You1117Paul D'Ianno
1For Those About To Rock We Salute You1118Pearl Jam
1For Those About To Rock We Salute You1119Peter Tosh
1For Those About To Rock We Salute You1120Pink Floyd
1For Those About To Rock We Salute You1121Planet Hemp
1For Those About To Rock We Salute You1122R.E.M. Feat. Kate Pearson
1For Those About To Rock We Salute You1123R.E.M. Feat. KRS-One
1For Those About To Rock We Salute You1124R.E.M.
1For Those About To Rock We Salute You1125Raimundos
1For Those About To Rock We Salute You1126Raul Seixas
1For Those About To Rock We Salute You1127Red Hot Chili Peppers
1For Those About To Rock We Salute You1128Rush
1For Those About To Rock We Salute You1129Simply Red
1For Those About To Rock We Salute You1130Skank
1For Those About To Rock We Salute You1131Smashing Pumpkins
1For Those About To Rock We Salute You1132Soundgarden
1For Those About To Rock We Salute You1133Stevie Ray Vaughan & Double Trouble
1For Those About To Rock We Salute You1134Stone Temple Pilots
1For Those About To Rock We Salute You1135System Of A Down
1For Those About To Rock We Salute You1136Terry Bozzio, Tony Levin & Steve Stevens
1For Those About To Rock We Salute You1137The Black Crowes
1For Those About To Rock We Salute You1138The Clash
1For Those About To Rock We Salute You1139The Cult
1For Those About To Rock We Salute You1140The Doors
1For Those About To Rock We Salute You1141The Police
1For Those About To Rock We Salute You1142The Rolling Stones
1For Those About To Rock We Salute You1143The Tea Party
1For Those About To Rock We Salute You1144The Who
1For Those About To Rock We Salute You1145Tim Maia
1For Those About To Rock We Salute You1146Titãs
1For Those About To Rock We Salute You1147Battlestar Galactica
1For Those About To Rock We Salute You1148Heroes
1For Those About To Rock We Salute You1149Lost
1For Those About To Rock We Salute You1150U2
1For Those About To Rock We Salute You1151UB40
1For Those About To Rock We Salute You1152Van Halen
1For Those About To Rock We Salute You1153Velvet Revolver
1For Those About To Rock We Salute You1154Whitesnake
1For Those About To Rock We Salute You1155Zeca Pagodinho
1For Those About To Rock We Salute You1156The Office
1For Those About To Rock We Salute You1157Dread Zeppelin
1For Those About To Rock We Salute You1158Battlestar Galactica (Classic)
1For Those About To Rock We Salute You1159Aquaman
1For Those About To Rock We Salute You1160Christina Aguilera featuring BigElf
1For Those About To Rock We Salute You1161Aerosmith & Sierra Leone's Refugee Allstars
1For Those About To Rock We Salute You1162Los Lonely Boys
1For Those About To Rock We Salute You1163Corinne Bailey Rae
1For Those About To Rock We Salute You1164Dhani Harrison & Jakob Dylan
1For Those About To Rock We Salute You1165Jackson Browne
1For Those About To Rock We Salute You1166Avril Lavigne
1For Those About To Rock We Salute You1167Big & Rich
1For Those About To Rock We Salute You1168Youssou N'Dour
1For Those About To Rock We Salute You1169Black Eyed Peas
1For Those About To Rock We Salute You1170Jack Johnson
1For Those About To Rock We Salute You1171Ben Harper
1For Those About To Rock We Salute You1172Snow Patrol
1For Those About To Rock We Salute You1173Matisyahu
1For Those About To Rock We Salute You1174The Postal Service
1For Those About To Rock We Salute You1175Jaguares
1For Those About To Rock We Salute You1176The Flaming Lips
1For Those About To Rock We Salute You1177Jack's Mannequin & Mick Fleetwood
1For Those About To Rock We Salute You1178Regina Spektor
1For Those About To Rock We Salute You1179Scorpions
1For Those About To Rock We Salute You1180House Of Pain
1For Those About To Rock We Salute You1181Xis
1For Those About To Rock We Salute You1182Nega Gizza
1For Those About To Rock We Salute You1183Gustavo & Andres Veiga & Salazar
1For Those About To Rock We Salute You1184Rodox
1For Those About To Rock We Salute You1185Charlie Brown Jr.
1For Those About To Rock We Salute You1186Pedro Luís E A Parede
1For Those About To Rock We Salute You1187Los Hermanos
1For Those About To Rock We Salute You1188Mundo Livre S/A
1For Those About To Rock We Salute You1189Otto
1For Those About To Rock We Salute You1190Instituto
1For Those About To Rock We Salute You1191Nação Zumbi
1For Those About To Rock We Salute You1192DJ Dolores & Orchestra Santa Massa
1For Those About To Rock We Salute You1193Seu Jorge
1For Those About To Rock We Salute You1194Sabotage E Instituto
1For Those About To Rock We Salute You1195Stereo Maracana
1For Those About To Rock We Salute You1196Cake
1For Those About To Rock We Salute You1197Aisha Duo
1For Those About To Rock We Salute You1198Habib Koité and Bamada
1For Those About To Rock We Salute You1199Karsh Kale
1For Those About To Rock We Salute You1200The Posies






SELECT *  FROM "albums"  LEFT JOIN "artists" LIMIT 400



1./* 
위의 LEFT JOIN을 이용한 쿼리는 albums 테이블과 artists 테이블을 아무런 제한 없이 마구 갖다붙이고 있다.
두 테이블에서 같은 AirtistId를 가진 튜플(또는 레코드)끼리 JOIN되도록 쿼리를 작성해서 실행하라.
그리고 AlbumId나 ArtistId는 보이지 않고 Title과 Name 두 개의 속성만 결과로 나오도록 쿼리를 작성하라.

힌트:
SELECT "Title", "Name" FROM "albums"  LEFT JOIN "artists" ON ...(여기에 JOIN 조건 작성)...
*/

2./* 
문제(1)번의 쿼리에 ORDER BY를 추가하여 앨범 제목(Title) 오름차순(알파벳 순서, 사전순으로) 정렬되어 나오도록 쿼리를 작성해 실행하라.
*/

3./* 
문제(1)번의 쿼리에 ORDER BY를 추가하여 앨범 제목(Title) 내림차순(알파벳 순서 반대, 사전의 역순으로)으로 정렬되어 나오도록 쿼리를 작성해 실행하라.
*/

4./* 
문제(1)번의 쿼리에 ORDER BY를 추가하여 우선 아티스트 이름(Name) 오름차순으로 정렬되고
또 같은 아티스트의 앨범들끼리는 앨범 이름(Title) 오름차순 정렬되어 나오도록 쿼리를 작성해 실행하라.
*/

5./* 
아티스트 별로 몇 개의 앨범이 albums 테이블에 등록되어 있는지
아티스트 이름(Name)과 그 아티스트의 앨범이 몇 개인지 개수 이렇게 두 개의 열로 이루어진 결과가 나오도록 쿼리를 작성해 실행하라
힌트: GROUP BY를 사용
*/

6./* 
(5)번 문제의 결과와 같은 내용이지만 아티스트 이름 내림차순(알파벳 역순, 사전순 반대)으로 정렬되어 나오도록 쿼리를 작성해 실행하라
*/


6개 정답과 풀이 아시는분 부탁 드립니다ㅠㅠ
No. Subject Author Date Views
10247 sql server 2000 에서 2008 업그레이드시 2000 호환문제 [1] 슈토파이터 2018.06.12 759
10246 안녕하세요 질문있어서 글을 씁니다. snoopy_123 2018.06.12 525
10245 컴퓨터 이름을 바꾸었더니 "your sql server,...."에러가 뜹니다.. [1] 듣기평가 2018.06.11 893
10244 select 에서 채번쿼리 문의드립니다 선배님들 도와주세요ㅠㅠ dkfkqldy1 2018.06.11 792
10243 테이블 2개 조건을 이용하여 데이터 삭제방법 문의 [1] 노란하늘 2018.06.11 793
10242 날짜비교 (형변환) 질문 드립니다. [1] 비폭력무저항 2018.06.08 811
10241 제발 부탁드립니다 하 [1] fjfjfj 2018.06.07 1389
10240 row data 한줄을 두줄로...(현충일인데 근무중 헬프미..) [1] 촐이 2018.06.06 977
10239 다중열 서브쿼리 정렬 질문 [1] 정연석6546 2018.06.05 871
» sql 쿼리 질문 드립니다 me3258 2018.06.04 869
10237 LEFT OUTER JOIN 중복관련 질문입니다ㅣ [2] kjw3157 2018.06.04 2010
10236 특정 컬럼에서 연속된 데이터들만 카운트 하는법 질문 드립니다 [3] 스터프 2018.06.04 835
10235 쿼리 질문입니다. 얼음왕자 2018.06.02 584
10234 db의 lock을 강제로 킬하는 타임아웃 설정이 가능한가요? 개발좋아 2018.06.02 667
10233 대용량 테이블(1억건) 인덱스 생성 질문 드립니다. [1] 깜우석 2018.06.01 1564
10232 ISDATE INDEX 관련 질문입니다~! [2] 엔더 2018.06.01 695
10231 쿼리 문의드립니다~! [3] 엔더 2018.05.31 752
10230 정말 이상한 사칙연산 결과 질문 드립니다. [1] hackhyun 2018.05.30 941
10229 쿼리 문의 드립니다. l1j2e3 2018.05.30 682
10228 고수님들께 SQL 쿼리작성문 문의드립니다! 브라미 2018.05.29 795





XE Login