Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
C
CryptoCurrencyTracker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
rs11g21
CryptoCurrencyTracker
Commits
00287095
Commit
00287095
authored
2 years ago
by
rs11g21
Browse files
Options
Downloads
Patches
Plain Diff
Created a sample table with keys and able to insert data into the table
parent
fa553007
No related branches found
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
databaseCryptoUpdated.sh
+22
-0
22 additions, 0 deletions
databaseCryptoUpdated.sh
with
22 additions
and
0 deletions
databaseCryptoUpdated.sh
0 → 100644
+
22
−
0
View file @
00287095
#! /usr/bin/bash
$(
/opt/lampp/bin/mysql
-u
root
-e
"create database cryptoTracker; use cryptoTracker"
)
#To store different types of crypto
$(
/opt/lampp/bin/mysql
-u
root
-e
"use cryptoTracker; create table crypto (cryptoId int PRIMARY KEY, name varchar(20))"
)
$(
/opt/lampp/bin/mysql
-u
root
-e
"use cryptoTracker; insert into crypto values (1,'Bitcoin')"
)
#To store the crypto price (value)
$(
/opt/lampp/bin/mysql
-u
root
-e
"use cryptoTracker;
create table cryptoPrice (
id int AUTO_INCREMENT,
cryptoID int,
value float,
collected datetime,
PRIMARY KEY(id),
FOREIGN KEY(cryptoID) REFERENCES crypto(cryptoId)
)"
)
$(
/opt/lampp/bin/mysql
-u
root
-e
"use cryptoTracker;
insert into cryptoPrice(cryptoID,value,collected) values (1,29.93,'2022-03-03 12:00:00')"
)
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment