Skip to content
Navigation Menu
Sign in
Appearance settings
Platform
AI CODE CREATION
GitHub Copilot
Write better code with AI
GitHub Copilot app
Direct agents from issue to merge
MCP Registry
Integrate external tools
DEVELOPER WORKFLOWS
Actions
Automate any workflow
Codespaces
Instant dev environments
Issues
Plan and track work
Code Review
Manage code changes
Code Quality
Enforce quality at merge
APPLICATION SECURITY
GitHub Advanced Security
Find and fix vulnerabilities
Code security
Secure your code as you build
Secret protection
Stop leaks before they start
EXPLORE
Why GitHub
Documentation
Blog
Changelog
Marketplace
View all features
Solutions
BY COMPANY SIZE
Enterprises
Small and medium teams
Startups
Nonprofits
BY USE CASE
App Modernization
DevSecOps
DevOps
CI/CD
View all use cases
BY INDUSTRY
Healthcare
Financial services
Manufacturing
Government
View all industries
View all solutions
Resources
EXPLORE BY TOPIC
AI
Software Development
DevOps
Security
View all topics
EXPLORE BY TYPE
Customer stories
Events & webinars
Ebooks & reports
Business insights
GitHub Skills
SUPPORT & SERVICES
Documentation
Customer support
Community forum
Trust center
Partners
View all resources
Open Source
COMMUNITY
GitHub Sponsors
Fund open source developers
PROGRAMS
Security Lab
Maintainer Community
GitHub Stars
Archive Program
REPOSITORIES
Topics
Trending
Collections
Enterprise
ENTERPRISE SOLUTIONS
Enterprise platform
AI-powered developer platform
AVAILABLE ADD-ONS
GitHub Advanced Security
Enterprise-grade security features
Copilot for Business
Enterprise-grade AI features
Premium Support
Enterprise-grade 24/7 support
Pricing
Search
/
Sign in
Sign up
Appearance settings
You signed in with another tab or window.
Reload
to refresh your session.
You signed out in another tab or window.
Reload
to refresh your session.
You switched accounts on another tab or window.
Reload
to refresh your session.
Dismiss alert
{{ message }}
khss4008
SQLclass
Repository navigation
Code
Issues
Pull requests
Actions
Projects
Security and quality
Insights
More
items
Files
Expand file tree
main
Breadcrumbs
SQLclass
/
0929.sql
Copy path
Blame
More file actions
Blame
More file actions
Latest commit
History
History
History
36 lines (22 loc) · 1.48 KB
main
Breadcrumbs
SQLclass
/
0929.sql
Copy path
Top
File metadata and controls
Code
Blame
36 lines (22 loc) · 1.48 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
ALTER USER HR ACCOUNT UNLOCK IDENTIFIED BY 1234;
연습용 계정과 비밀번호 생성
SELECT * FROM TAB;
# 주의 : 기본적으로 SQL은 대소문자를 가리지 않지만, 보통 SQL 구문 대문자로 사용하는 관례가 있다.
SQL은 한줄 여러줄로 작성할 수 있다. 들여쓰기도 필요없다.
관례적으로 들여쓰기를 사용한다.
명령어는 대문자로 작성하고 나머지는 모두 소문자로 작성하자.
# SELECT - 데이터베이스에 있는 데이터를 조회한다.
SELECT를 이요앻서 테이블에서 행을 선택하고 열을 선택하고 테이블과 테이블을 연결할 수 있다.
데이터베이스에서 가장 기본이면서 중요한 SQL 구문이다.
SELECT은 항상 SELECT과 FROM을 같이 사용한다. WHERE, ORDER BY와도 함께 사용된다.
전체 데이터 조회하기
SELECT * FROM employees;
*의미는 모든 열을 의미한다.
FROM은 ~ 테이블로부터 라는 의미이다.
명령어는 대문자로 작성하고 나머지는 모두 소문자로 작성한다.
가독성을 위해서 SELECT 다음에 줄을 바꾸었다.
SELECT employee_id, first_name, last_name
FROM employees;
SELECT 명령문뒤에 나열한 열 이름들의 순서대로 결과가 조회된다. 열의 이름들은 쉼표를 계속 붙여서 나열할 수 있다.
결과는 나열한 순서대로 출력된다. 모든 열을 조회하는 * 대신 열 이름을 모두 나열해도 같은 결과가 출력된다.
가나다라마바사
You can’t perform that action at this time.