VisualStudio Installer 에서 ASP.NET 웹 개발 설치

 

 

 

              https://downloads.mysql.com/archives/c-odbc/

 

MySQL :: Download MySQL Connector/ODBC (Archived Versions)

Please note that these are old versions. New releases will have recent bug fixes and features! To download the latest release of MySQL Connector/ODBC, please visit MySQL Downloads. MySQL open source software is provided under the GPL License.

downloads.mysql.com

 

64 비트

그냥 Accpet 후 설치

 

 

ODBC란?

 

64비트 선택

 

 

 

 

 

 

 

test가 완료되면 ok를 누르고 확인

 


 

 

그후 비쥬얼스튜디오를 키고

 

추가로 솔루션 탐색기 단축키 -> Ctrl + Alt + L

 

인스톨러로 다시 돌아와서

 

체크 후 설치

 

 

 

 

 

이 사이에 테스트를 돌려보고 Succes가 된다면 저장하고 다음을 눌러주면 된다. 

 

테이블을 SQL문을 활용해서 만들 수 있다.

 

CREATE TABLE indexTBL (first_name varchar(14), last_name varchar(16), hire_date date);

INSERT INTO indexTBL
SELECT first_name, last_name, hire_date
FROM employees.employees
LIMIT 500;

SELECT * FROM indexTBL;

 

 

 

아래 모양 키를 누른후 Execution Plan 클릭

 

 

 

Execution Plan이란?

 

그 후

 

 CREATE INDEX idx_indexTBL_firstname ON indexTBL(first_name);

 

 

 

 

뷰란?

가상의 테이블

원래 있는 테이블을 가상으로 만들어서 뷰테이블?이라고 만든 후 SELECT로 볼 수 있다.

 

뷰는 수정을 할 수 있지만 SELECT만 권장

 

CREATE VIEW uv_memberTBL
AS
SELECT memberName, memberAddress FROM uv_membertblmemberTBL;

 

 

 

 

 

DELIMITER 는 '구분 문자'를 의미한다.

뒤에 //가 나오면 기존의 세미클론(;)을 // 로 대신한다는 것이다.

 

 

프로시저란?

 

 

SELECT를 한다면 어떻게 탐색해서 들어갔는지 보여주는 과정

 

 

 

 

프로시저 만들기

 

1. 델리미터를 작성 후 실행

 

2. CREATE로 만들고

3. BEGIN과 END로 실행

 

4. 셀렉트 문을 실행

 

즉, 총 3 번을 실행해야 한다.

 

그러면 이렇게 프로시져가 만들어짐을 확인할 수 있다.

 

 

트리거란?

 

테이블에 부착되어 테이블에 INSERT나 UPDATE 또는 DELETE 작업이 발생되면 실행되는 코드

 

 

가끔 업데이트할때 오류가 나는 이유는 맨 아래 세이프 모드가 체크 되어있기 때문에

테스트를 하려면 풀어주면 된다.

 

가끔 업데이트가 안될 경우 Reconnect

 

 

생성 후 잘 지워 지는 것을 확인 할 수 있다.

 

 

이제 지워진 것을 확인할 테이블을 만들 것이다.

CREATE TABLE deletedMemberTBL(
	memberID CHAR(8),
    memberName CHAR(5),
    memberAddress CHAR(20),
    deletedDate DATE
);

 

 

CREATE VIEW uv_membertbl
AS SELECT memberName, memberAddress FROM memberTBL;

DELIMITER //
CREATE PROCEDURE myProc()
BEGIN
    SELECT * FROM memberTBL WHERE memberName = '당탕이';
    SELECT * FROM productTBL WHERE productName = '냉장고';
END //
DELIMITER ;

INSERT INTO memberTBL VALUES ('Figure', '연아', '경기도 군포시 당정동');
UPDATE memberTBL SET memberAddress = '서울 강남구 역삼동'
WHERE memberName = '연아';

DELETE FROM memberTBL WHERE memberName = '연아';
SELECT * from memberTBL;

CREATE TABLE deletedMemberTBL(
	memberID CHAR(8),
    memberName CHAR(5),
    memberAddress CHAR(20),
    deletedDate DATE
);

DELIMITER //
CREATE TRIGGER trg_deletedMemberTBL
	AFTER DELETE
	ON memberTBL
	FOR EACH ROW
BEGIN
	INSERT INTO deletedmembertbl
		VALUES (OLD.memberID, OLD.memberName, OLD.memberAddress, CURDATE());
END //

DELIMITER ;

 

당탕이라는 멤버를 지우고 지워지는지 확인

 

 

백업하는 법

 

C에 DB백업이라는 폴더 생성

왼쪽에 아래에 Administration 클릭후 Data Export

 

모두 체크 후 -> Star Export

 

추출이 잘 되어있음을 확인 할 수 있다.

 

이제 데이터를 옮길 것이다.

 

삭제가 되거나 문제가 생길 경우 Import 해서 저장된 데이터를 가져올 수 있다.

 

 

 

 

 

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CardData
{
    public int id;
    public string name;
    public string sprite_name;
}

 

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class CardInfo
{
    public int id;

    public CardInfo(int id)
    {
        this.id = id;
    }
}

 

 

using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Card : MonoBehaviour
{
    private CardInfo cardInfo;

    [SerializeField] private SpriteRenderer spriteRenderer;

    public void SetCardInfo(CardInfo cardInfo)
    {
        this.cardInfo = cardInfo;
    }

    public void SetSprite(Sprite sp)
    {
        spriteRenderer.sprite = sp;
    }
}

 

using Newtonsoft.Json;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using Unity.VisualScripting;
using UnityEngine;
using UnityEngine.U2D;

public class Main : MonoBehaviour
{
    [SerializeField] private GameObject cardPrefab;
    [SerializeField] private SpriteAtlas cardAtlas;

    void Start()
    {
        TextAsset ts = Resources.Load<TextAsset>("Data/card_data");
        string json = ts.text;
        Debug.Log(json);

        Dictionary<int, CardData> dicCardDatas = JsonConvert.DeserializeObject<List<CardData>>(json).ToDictionary(x => x.id);

        GameObject cardGo = Instantiate(cardPrefab);
        Card card = cardGo.GetComponent<Card>(); //생성된 프리팹에
        CardInfo cardInfo = new CardInfo(100);

        card.SetCardInfo(cardInfo);
        CardData cardData = dicCardDatas[101];
        Sprite sp = cardAtlas.GetSprite(cardData.sprite_name);
        card.SetSprite(sp);
        

    }

}

'Study > ' 카테고리의 다른 글

[Tip] Object.FindObjectOfType  (0) 2024.06.11
[Tip] RenderSettings  (0) 2024.06.05
[팁] Slider.onValueChanged  (0) 2024.06.05
[Tip] 패키지에서 프리팹찾기  (0) 2024.04.18
[Tip] CameraShaker  (0) 2024.03.29

SQL 언어는 마크업언어(Html 등)과 다르게 "연산이 가능"하여 프로그래밍 언어

 

데이터의 무결성 - 고유키(중복 x)

 

데이터의 독립성 

 

mysql 설치 링크

https://downloads.mysql.com/archives/installer/

 

MySQL :: Download MySQL Installer (Archived Versions)

Please note that these are old versions. New releases will have recent bug fixes and features! To download the latest release of MySQL Installer, please visit MySQL Downloads. MySQL open source software is provided under the GPL License.

downloads.mysql.com

 

 

설치 후 -> 커스텀

 

오류가 날때가 있는데

 

보통 경로가 한글로 되있어서 문제이니 pc의 이름이나 디렉토리에 한글이 있다면

영문으로 바꾸고 mysql을 재시작하고 재부팅하자!

 

보통 이 경로의 위치를 따라가 메모장으로 열어보면 한글이 있을 확률 매우 높으므로

주석처리도 해보고, 여러방법을 시도해보았지만 결론이 pc의 이름을 바꾸는게 베스트

 

 

 

윈도우에서 powershell을 관리자 권환으로 실행

 

 

https://cafe.naver.com/thisisMYSQL

 

이것이MySQL이다 : 네이버 카페

한빛미디어 [이것이 MySQL이다] 카페입니다.

cafe.naver.com

이곳에서 파일을 다운받고 

 

 

경로를 지정

 

 

그 다음에 파워쉘이다가

source employees.sql; 입력

 

그후

show databases;

 

Select * from 테이블명

 

 

조건을 지정해 출력

Select * From 테이블명 where 필드명 = '값';

 

 

테이블 만드는법

 

스키마안에 있는 Tables를 우클릭후 생성

그 후 데이터타입이랑 변수명을 지정해주면 된다.

 

 

이제 변수와 타입을 만들었으니

값을 할당해주면 된다.

 

 

 

 

 

정보를 찾는 방법을 이해하려면 이런 식으로 생각하면 편하다

 

 

 

 

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class SelectPreparedCard : MonoBehaviour
{
    
    public TMP_Text preparedCardName;
    public TMP_Text preparedCardDesc;
    public int id;


    public void UpdateCard(int id)
    {
        this.id = id;
        preparedCardName.text = PlayerManager.Instance.dicPreparedCardDatas[id].card_name;
        preparedCardDesc.text = PlayerManager.Instance.dicPreparedCardDatas[id].desc;

    }
}

 

using System.Collections;
using System.Collections.Generic;
using TMPro;
using UnityEngine;

public class SelectStartCard : MonoBehaviour
{
    public Transform content;
    public GameObject cardPrefab;


    void Start()
    {
        PlayerManager.Instance.LoadPreparedCardData();
        PlayerManager.Instance.LoadPlayerSelectCardInfo();


        PreparedCardData[] prepareCards = new PreparedCardData[2];
        prepareCards[0] = PlayerManager.Instance.dicPreparedCardDatas[2000];
        prepareCards[1] = PlayerManager.Instance.dicPreparedCardDatas[2001];

        for (int i = 0; i < 2; i++){

            GameObject card = Instantiate(cardPrefab, content);
            SelectPreparedCard c = card.GetComponent<SelectPreparedCard>();
            c.id = prepareCards[i].id;
            c.UpdateCard(c.id);
        }
    }
}

 

inspector에서 string으로 원하는 scene의 이름을 저장한 후 클릭을 하면 해당  씬으로 이동

 

using System.Collections;
using System.Collections.Generic;
using System.Threading;
using UnityEngine;
using UnityEngine.SceneManagement;
using UnityEngine.UI;

public class ChangeScene : MonoBehaviour
{
    public string sceneName;
    private Button btn;

    void Start()
    {
        btn = GetComponent<Button>();

        btn.onClick.AddListener(() =>
        {
            SceneManager.LoadScene(sceneName);
        });
    }
}

'산대특' 카테고리의 다른 글

[애드몹] 배너 광고 붙이기  (0) 2024.06.28
플레이콘솔 리더보드에 점수 올리기  (0) 2024.06.26
2D 3Matchpuzzle - 블록 위치 찾기 테스트  (0) 2024.05.16
2D 3Matchpuzzle - 빈공간 찾기  (0) 2024.05.14
Download Python  (0) 2024.05.08

https://github.com/wlgys8/Sprites-Outline

 

GitHub - wlgys8/Sprites-Outline: Outline effect for Unity SpriteRenderer

Outline effect for Unity SpriteRenderer. Contribute to wlgys8/Sprites-Outline development by creating an account on GitHub.

github.com

 

'라이브러리' 카테고리의 다른 글

DOTween  (1) 2024.03.29

완전 탐색을 하여 2중 for문을 돌린다

 

using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class MatchTest : MonoBehaviour
{
    private static readonly int Rows = 4;
    private static readonly int Cols = 4;
    
    private int[,] board =
    {
        {1, 1, 2, 0},
        {1, 1, 1, 1},
        {2, 1, 0, 1},
        {0, 0, 1, 1}
    };
    void Start()
    {
        FindMatchingBlocks();
    }
    
    private void FindMatchingBlocks()
    {
        HashSet<(int, int)> matchedBlocks = new HashSet<(int, int)>();

        for (int i = 0; i < Rows; i++)
        {
            for (int j = 0; j < Cols; j++)
            {
                CheckHorizontalMatch(i, j, matchedBlocks);
                CheckVerticalMatch(i, j, matchedBlocks);
            }
        }

        Debug.Log("Matching Blocks:");
        foreach (var block in matchedBlocks)
        {
            Debug.Log($"({block.Item1}, {block.Item2})");
        }
    }

    private void CheckHorizontalMatch(int row, int col, HashSet<(int, int)> matchedBlocks)
    {
        if (col + 2 < Cols &&
            board[row, col] == board[row, col + 1] &&
            board[row, col] == board[row, col + 2])
        {
            matchedBlocks.Add((row, col));
            matchedBlocks.Add((row, col + 1));
            matchedBlocks.Add((row, col + 2));
        }
    }

    private void CheckVerticalMatch(int row, int col, HashSet<(int, int)> matchedBlocks)
    {
        if (row + 2 < Rows &&
            board[row, col] == board[row + 1, col] &&
            board[row, col] == board[row + 2, col])
        {
            matchedBlocks.Add((row, col));
            matchedBlocks.Add((row + 1, col));
            matchedBlocks.Add((row + 2, col));
        }
    }
}

'산대특' 카테고리의 다른 글

플레이콘솔 리더보드에 점수 올리기  (0) 2024.06.26
2D 3Matchpuzzle - 매치 시 파괴 및 로드 + 힌트  (0) 2024.05.20
2D 3Matchpuzzle - 빈공간 찾기  (0) 2024.05.14
Download Python  (0) 2024.05.08
Learn Firebase  (0) 2024.05.02

+ Recent posts