Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
K9272
TTC2020-Tietokannat
Commits
c1ca5b86
Commit
c1ca5b86
authored
Jan 12, 2022
by
K9272
Browse files
H1
parent
64f63406
Changes
4
Hide whitespace changes
Inline
Side-by-side
README.md
View file @
c1ca5b86
# TTC2020-Tietokannat
Tietokannat-opintojakson palautukset
\ No newline at end of file
Tietokannat-opintojakson palautukset
## Viikkotehtävät
[
H1
](
harjoitukset/1.md
)
\ No newline at end of file
harjoitukset/H1.md
0 → 100644
View file @
c1ca5b86
# Viikko 1 Työkalut
## T1
Asenna MySQL XAMPPista ja MySQL WorkBench

Asenna MySQL WorkBench ja luo esimerkkitietokanta.

## T2
Luo ohjeen mukaisesti itsellesi mariaDB-tunnus.
```
Authenticated as: K9272
Account created: yes
A database 'K9272' has been created.
You can also manually create K9272_1, K9272_2, and K9272_3.
```
Ota yhteys tunnuksellasi Labranetin MariaDB-palvelimelle
```
[K9272@student ~]$ mysql -u K9272 -p********** -h mariadb.labranet.jamk.fi
```
Valitaan sallittu nimi
```
MariaDB [(none)]> use K9272
Database changed
MariaDB [K9272]>
```
Ja CopyPaste init-tiedoston sisältö
tulkkiin ja esimerkkitietokanta on valmis.
Suoritetaan esimerkkikyselyt
```
MariaDB [K9272]> SELECT * FROM students;
OM courses;+-----------+----------+-----------+------------+----------+----------+---------+----------+
| studentID | lastname | firstname | birthdate | eyecolor | incomes | taxrate | hometown |
+-----------+----------+-----------+------------+----------+----------+---------+----------+
| 2001 | Guru | Ken | 2001-11-11 | Ruskea | 12010.12 | 5.10 | 1 |
| 2002 | Saurus | Tino | 2002-11-11 | Ruskea | 14010.22 | 6.20 | 1 |
| 2003 | Tiainen | Sini | 2003-11-11 | Sininen | 16010.32 | 7.30 | 1 |
| 2004 | Vainio | Vilja | 2004-11-11 | Sininen | 0.00 | 0.00 | 3 |
| 2005 | Vainio | Elo | 2005-11-11 | Sininen | 0.00 | 0.00 | 3 |
| 2006 | Rahainen | Muu | 2006-11-11 | Harmaa | 13010.12 | 5.80 | 2 |
| 2007 | Alainen | Kim | 2007-11-11 | NULL | 18010.12 | 8.80 | 2 |
| 2008 | Ana | Ruut | 2008-11-11 | NULL | 20010.12 | 9.90 | NULL |
+-----------+----------+-----------+------------+----------+----------+---------+----------+
8 rows in set (0.001 sec)
MariaDB [K9272]> SELECT * FROM courses;
+----------+-------------+---------+
| courseID | coursename | credits |
+----------+-------------+---------+
| 1 | Ohjelmointi | 5 |
| 2 | Tietokannat | 4 |
| 3 | Ruotsi | 3 |
+----------+-------------+---------+
3 rows in set (0.001 sec)
MariaDB [K9272]>
```
harjoitukset/H1/t1-mysql.png
0 → 100644
View file @
c1ca5b86
154 KB
harjoitukset/H1/t1-workbench.png
0 → 100644
View file @
c1ca5b86
332 KB
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment