# Database Creation and Requests on Phenotyping Data
###### tags: emPLANT+, 第一年 法國 UniLaSalle, 下學期
**Use Microsoft Excel, Microsoft Access**
課程時間表:


# Microsoft Access
## 1. Data type

## 2. Database creat
1. data name
Access doesn't accept " " (space), name evry data put "_"
2. set up primary key, foreign key
primary key (1): id_
foreign key (infinity): ref_

3. join
make sure data type are the same
*remeber to delete 0 down the format of all numeric data
autonumber - long integer
short text - short text
*autonumber: sometimes you copy the data directly to paste in Access the number will have memory doesn't start from 1
4. import data
outer data -> import data
choose the form you are going to put data in
choose file place -> the first column is the name column -> check the data type -> don't choose any primary key

## 3. Relationship
1. design -> relationship
2. right click -> choose left or right join (inner join at first, if data is right 1 and infinity will directly come out)

## 4. Query create
1. create -> query
you can directly drag database into the query to modify.

2. There are 3 visual way to check the data: database itself, SQL, and design view.


```
SELECT
WHERE
HAVING
GROUP BY
```
https://www.w3schools.com/sql/sql_ref_sqlserver.asp
## 5. Put data inside Access (append + run)
*remeber have to agree modification, or it will not run.
1. creat query
import database and join (inner, left, right join)
append and run, then check if the database if the data already in or not.

# Microsoft Excel