'LIFE (일상다반사)' 카테고리의 다른 글
| 메타 1만1000명 정리해고한다 (0) | 2022.11.10 |
|---|---|
| 붕어빵 1개 1천원, 호떡 2천원...도대체 안 오르는게 없네 (1) | 2022.11.08 |
| 긴급취재 이태원 참사 - 전반부 - PD수첩 2022년11월1일 방송 (0) | 2022.11.02 |
| 짱구아빠 신형만 명대사 (0) | 2022.10.31 |
| 7종 멀티캠핑 반합+컵 세트를 3만원대로 | 포스코 304 스텐 국내생산 (0) | 2022.10.28 |
| 메타 1만1000명 정리해고한다 (0) | 2022.11.10 |
|---|---|
| 붕어빵 1개 1천원, 호떡 2천원...도대체 안 오르는게 없네 (1) | 2022.11.08 |
| 긴급취재 이태원 참사 - 전반부 - PD수첩 2022년11월1일 방송 (0) | 2022.11.02 |
| 짱구아빠 신형만 명대사 (0) | 2022.10.31 |
| 7종 멀티캠핑 반합+컵 세트를 3만원대로 | 포스코 304 스텐 국내생산 (0) | 2022.10.28 |
| 붕어빵 1개 1천원, 호떡 2천원...도대체 안 오르는게 없네 (1) | 2022.11.08 |
|---|---|
| 긴급취재 이태원 참사 - 후반부 - PD수첩 2022년11월1일 방송 (1) | 2022.11.02 |
| 짱구아빠 신형만 명대사 (0) | 2022.10.31 |
| 7종 멀티캠핑 반합+컵 세트를 3만원대로 | 포스코 304 스텐 국내생산 (0) | 2022.10.28 |
| 핼러윈 대신 'K 귀신잔치'…"박물관서 DJ 라이브 공연 즐겨요" (0) | 2022.10.28 |
MSSQL 링크드서버, linked server
MSSQL 은 연결된서버 기능을 제공하는데 이를 이용하면 다른 네트워크의 데이터베이스를 원격으로 접속하여
사용할 수 있도록 해줍니다.
-- MSSQL 연결된 서버 생성
EXEC sp_addlinkedserver
@server = '[연결된 서버별칭]',
@srvproduct = '',
@provider = 'SQLOLEDB',
@datasrc = '[서버 아이피]',
@catalog = '[데이터 베이스명]'
-- MSSQL 연결계정 생성
EXEC sp_addlinkedsrvlogin
@rmtsrvname= '[연결된 서버별칭]',
@useself= 'false',
@rmtuser = '[사용자 이름]',
@rmtpassword = '[사용자 암호]'
-- MSSQL 연결된 서버 확인
SELECT * FROM master.dbo.sysservers WHERE srvname = '[연결된 서버별칭]'
-- MSSQL 연결계정 확인
SELECT * FROM master.sys.linked_logins WHERE remote_name = '[사용자 이름]'
-- MSSQL 연결된 서버 이용방법
/*연결된 서버를 등록한 후 사용하려면 [연결된 서버별칭].[데이터 베이스명].[데이터베이스 소유자명].[테이블명]
형태로 호출하여 사용할 수 있습니다.
SELECT 쿼리를 예로 들면 아래와 같습니다. */
-- MSSQL 일반서버에 SELECT 쿼리시
SELECT [컬럼명] FROM [테이블명] WHERE [조건절]
-- MSSQL 연결된 서버에 SELECT 쿼리시
SELECT [컬럼명] FROM [연결된 서버별칭].[데이터 베이스명].[데이터베이스 소유자명].[테이블명] WHERE [조건절]
-- MSSQL 연결된 서버 삭제
EXEC sp_dropserver
@server = '[연결된 서버별칭]'
-- MSSQL 연결계정 삭제
EXEC sp_droplinkedsrvlogin
@rmtsrvname= '[연결된 서버별칭]',
@locallogin = NULL| [MSSQL] STRING_AGG(Transact-SQL) 문자열 식의 값을 연결하고 그 사이에 구분 기호 값을 추가 (0) | 2023.01.17 |
|---|---|
| [MSSQL] STRING_SPLIT(Transact-SQL) 지정된 구분 기호 문자에 따라 문자열을 부분 문자열의 행으로 분할하는 테이블 반환 함수 (0) | 2023.01.17 |
| [DB] SQL Server 모든 테이블 크기를 조회하는 쿼리 (0) | 2022.11.02 |
| [MSSQL] DB 복구모델 - 전체(Full) 로 변경 (0) | 2022.11.02 |
| [MSSQL] Sub Query 서브쿼리에서 정렬하기 (0) | 2022.08.25 |
테이블의 건수와, 테이블에 구성된 인덱스들의 합도 같이 확인할 수 있습니다.
SELECT
OBJECT_SCHEMA_NAME(a2.object_id) AS SchemaName,
a2.name AS TableName,
a1.rows as [RowCount],
CAST(ROUND(((a1.reserved + ISNULL(a4.reserved,0)) * 8) / 1024.00, 2) AS NUMERIC(36, 2)) AS ReservedSize_MB,
CAST(ROUND(a1.data * 8 / 1024.00, 2) AS NUMERIC(36, 2)) AS DataSize_MB,
CAST(ROUND((CASE WHEN (a1.used + ISNULL(a4.used,0)) > a1.data THEN (a1.used + ISNULL(a4.used,0)) - a1.data ELSE 0 END) * 8 / 1024.00, 2) AS NUMERIC(36, 2)) AS IndexSize_MB,
CAST(ROUND((CASE WHEN (a1.reserved + ISNULL(a4.reserved,0)) > a1.used THEN (a1.reserved + ISNULL(a4.reserved,0)) - a1.used ELSE 0 END) * 8 / 1024.00, 2) AS NUMERIC(36, 2)) AS UnusedSize_MB
FROM
(SELECT
ps.object_id,
SUM (CASE WHEN (ps.index_id < 2) THEN row_count ELSE 0 END) AS [rows],
SUM (ps.reserved_page_count) AS reserved,
SUM (CASE
WHEN (ps.index_id < 2) THEN (ps.in_row_data_page_count + ps.lob_used_page_count + ps.row_overflow_used_page_count)
ELSE (ps.lob_used_page_count + ps.row_overflow_used_page_count)
END
) AS data,
SUM (ps.used_page_count) AS used
FROM sys.dm_db_partition_stats ps
GROUP BY ps.object_id) AS a1
LEFT OUTER JOIN
(SELECT
it.parent_id,
SUM(ps.reserved_page_count) AS reserved,
SUM(ps.used_page_count) AS used
FROM sys.dm_db_partition_stats ps
INNER JOIN sys.internal_tables it ON (it.object_id = ps.object_id)
WHERE it.internal_type IN (202,204)
GROUP BY it.parent_id) AS a4 ON (a4.parent_id = a1.object_id)
INNER JOIN sys.all_objects a2 ON ( a1.object_id = a2.object_id )
WHERE a2.type <> N'S' and a2.type <> N'IT'
ORDER BY ReservedSize_MB DESC| [MSSQL] STRING_SPLIT(Transact-SQL) 지정된 구분 기호 문자에 따라 문자열을 부분 문자열의 행으로 분할하는 테이블 반환 함수 (0) | 2023.01.17 |
|---|---|
| [Database] MSSQL 링크드서버, linked server (0) | 2022.11.02 |
| [MSSQL] DB 복구모델 - 전체(Full) 로 변경 (0) | 2022.11.02 |
| [MSSQL] Sub Query 서브쿼리에서 정렬하기 (0) | 2022.08.25 |
| [MSSQL] SSMS(SQL Server Management Studio) 다운로드 (0) | 2022.07.15 |
https://towardsdatascience.com/the-10-best-data-visualizations-of-2022-3e49d7ccb832
The 10 Best Data Visualizations of 2022
Awesome visualizations on the Ukraine War, Inflation, and more!
towardsdatascience.com
Last year I shared what I thought were ten of the best data visualizations from 2021. I’m back again with ten of the best data visualizations from 2022!
Similar to last year, I wanted to share a variety of types of data visualizations, and also ones that were relevant with particular events that happened this year.
Let’s dive into it!
Be sure to SUBSCRIBE here to never miss another article on data science guides, tricks and tips, life lessons, and more!
One of the biggest events this year was the war between Russia and Ukraine. Comforting or not, the infograph above shows the difference in military power between NATO and Russia. The actual data can be found here.
I love this infograph, it’s many pictographs combined into one, it’s clean, and it’s very clear what message it’s trying to convey.
NATO out-powers Russia in every aspect other than Nuclear Weapons… I wonder how this would change if Russia’s budget towards nuclear weapons went to other things 🤔.
Be sure to SUBSCRIBE here to never miss another article on data science guides, tricks and tips, life lessons, and more!
One of the consequences of the war between Russia and Ukraine is inflation. If you click on the visualization above, you’ll see how inflation has impacted our cost of every day items, like gas, coffee, and corn. (On the bright side, the cost of orange juice went down!)
If you’re interested, this type of data visualization is similar to a bar chart race, which is a dynamic bar chart shown over a period of time. If you want to build one yourself, here’s a tutorial that you can check out.
Every day items aren’t the only things affected by inflation, wages are also impacted by inflation. What does this mean? As inflation increases, the value of the dollar decreases, meaning our dollar doesn’t go as far as it used to.
This visualization is a dynamic line chart that shows how wage growth and inflation has changed since 2015. In 2021, for the first time since 2015, inflation surpassed wage growth.
Sometimes, a static bar chart is all you need to convey a message. This visualization shows the number of school shootings by country from 2009 to 2018. If this doesn’t imply that the US has a gun problem, I don’t know what does!
FYI, the US has 48 times more school shootings than the second highest country… fourty eight!
Be sure to SUBSCRIBE here to never miss another article on data science guides, tricks and tips, life lessons, and more!
While we’re on the topic of school, the image above shows the fastest growing and shrinking fields of study in US colleges. STEM fields seem to make up the fastest growing fields, while arts and history fields seem to make up the fastest shrinking fields.
This data was provided by the U.S. Department of Education.
Ever wonder why certain websites require a variety of characters and a minimum number ? This visualization shows the time that it takes a hacker to brute force your password in 2022.
What makes this visualization so powerful is how comprehensive it is — part of this is attributed to the colour scheme depending on how long it takes to brute for the password.
The data was compiled from How Secure is My Password and this was built using Illustrator and Excel.
Now for the “Most Popular” visualizations of the year, this visualization shows the most popular web browsers over the last 28 years! As of March 2022, it’s no surprise that Google Chrome takes 80% of the market share, but that wasn’t the case back in the day.
This type of visualization is called a pie chart race, and it’s serves a similar purpose as as bar chart race, except that it’s more useful when you’re trying to emphasize proportions as opposed to absolute numbers.
The data used to build this was taken from the following sources:
The most popular web browsers is one thing, but the most popular websites is another. This visualization shows the most popular websites since 1993. What’s surprising is that Yahoo is still the ninth most visited website as of January 2022!
This type of data visualization is called a bar chart race. I’m sure you’ve seen many of these all over YouTube and Reddit.
Another simple yet powerful visualization, this bar chart shows the most spoken languages in the world, with the top three being English, Mandarin, and Hindi.
This visualization was created using ggplot in R with data provided from Wikipedia.
Be sure to SUBSCRIBE here to never miss another article on data science guides, tricks and tips, life lessons, and more!
For the last article, this visualization shows the top 50 biggest fast food chains based on the number of stores in the US. You can see that it’s split by “food category”, and within each category, the size of each restaurant represents its magnitude.
Who know that there were more Subways and Starbucks than McDonalds?
This visualization is called a treemap and is typically used when you want to visualize hierarchical and partitioned data. If you want to learn how to build one in Python, check out this link.
| ‘대퇴사의 시대(the Great Resignation)’ : 문제는 퇴사하는 이유는 그대로라는 것 (0) | 2022.11.10 |
|---|---|
| Cheat-Sheets.org - 프로그램 커닝페이퍼 (0) | 2022.11.08 |
| 직장인의 79.5% “우리 회사에 빌런 있다”, 82.8% “하지만 나는 아냐” (0) | 2022.11.01 |
| 사무실 없이 일 잘하는 법 – 자율 근무 문화 가이드북 (0) | 2022.11.01 |
| The New Science of Customer Emotions , 고객 감정의 새로운 과학 (0) | 2022.10.28 |
[MSSQL] DB 복구모델 - 전체(Full) 로 변경
-- 복구 모델을 보려면
SELECT name, recovery_model_desc
FROM sys.databases
WHERE name = 'model' ;
-- 복구 모델을 변경하려면
USE [master] ;
ALTER DATABASE [model] SET RECOVERY FULL ;
SSMS에서 하기.
DB 속성에서 옵션 들어가서 복구모델 선택하기.

단순(Simple) 데이터베이스 복구 모델을 선택하는 몇 가지 이유는 다음과 같습니다.
다음을 지원합니다.
장점 : 고성능 대량 복사 작업이 가능하고 로그 공간을 확보하여 공간 요청을 작게 유지합니다.
단점 : 가장 최근의 데이터베이스 또는 불일치 백업을 다시 빌드해야 하므로 변경됩니다.

Full
전체 복구 모델을 사용하면 SQL Server는 사용자가 백업할 때까지 트랜잭션 로그를 예약합니다. 이 복구 모델에서는 모든 거래(DDL(데이터 정의 언어) + DML(데이터 조작 언어))가 트랜잭션 로그 파일에 완전히 기록됩니다. 로그 순서는 손상되지 않고 데이터베이스가 작업을 복원할 수 있도록 보존됩니다. 단순 복구 모델과 달리 트랜잭션 로그 파일은 CHECKPOINT 작업 중에 자동으로 잘리지 않습니다.
데이터베이스 오류가 발생했을 때 전체 복구 모델을 사용하여 데이터베이스를 복원하는 가장 유연성을 얻을 수 있습니다. 지정 시간 복원, 페이지 복원 및 파일 복원을 포함한 모든 복원 작업이 지원됩니다.
전체 데이터베이스 복구 모델을 선택하는 이유:
다음을 지원합니다.
장점 : 데이터 파일의 유실 또는 손상으로 인한 작업 오작동이 없습니다. 임의의 시점으로 회복될 수 있습니다.
단점 : 로그가 손상되면 가장 최근의 로그 백업 이후의 변경 사항을 다시 작성해야 합니다.
데이터베이스가 개발 또는 테스트 서버인 경우 단순 복구 모델이 대부분 적합해야 합니다. 그러나 데이터베이스가 프로덕션 데이터베이스인 경우 일반적으로 전체 복구 모델을 사용하는 것이 좋습니다. 전체 복구 모델은 대량 로그 복구 모델로 보완할 수 있습니다. 물론 데이터베이스가 작거나 데이터 웨어하우스의 일부이거나 데이터베이스가 읽기 전용인 경우에도 마찬가지입니다.
| [Database] MSSQL 링크드서버, linked server (0) | 2022.11.02 |
|---|---|
| [DB] SQL Server 모든 테이블 크기를 조회하는 쿼리 (0) | 2022.11.02 |
| [MSSQL] Sub Query 서브쿼리에서 정렬하기 (0) | 2022.08.25 |
| [MSSQL] SSMS(SQL Server Management Studio) 다운로드 (0) | 2022.07.15 |
| "이러려고 데이터 과학자 됐나" 데이터 관리의 11가지 어두운 비밀원문보기:https://www.itworld.co.kr/news/242939?page=0,1#csidx82bff532382199ebc486939ae73a2c7 (0) | 2022.07.07 |