Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Creates new table #2

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"sqltools.connections": [
{
"askForPassword": true,
"connectString": "mysql://b1b6204e10cc4a:[email protected]/heroku_200db3188ed14b8",
"driver": "MySQL",
"mysqlOptions": {
"authProtocol": "default"
},
"name": "clearDB_heroku",
"port": 3306,
"previewLimit": 50,
"server": "localhost"
}
]
}
9 changes: 5 additions & 4 deletions sequelize/not-for-git-settings.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
module.exports = {
mysqlUrl: "mysql://bde20ee7c51015:3e39a5fe@us-cdbr-east-02.cleardb.com/heroku_09684ba4a58d7c4",
username: "bde20ee7c51015",
password: "3e39a5fe",
host: "heroku_09684ba4a58d7c4",
mysqlUrl: "mysql://b1b6204e10cc4a:ef42a233@us-cdbr-east-02.cleardb.com/heroku_200db3188ed14b8",
username: "b1b6204e10cc4a",
password: "ef42a233",
host: "heroku_200db3188ed14b8",
port: 3306
}

8 changes: 8 additions & 0 deletions sql/employers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
create table if not exists employers
(
ID INT NOT NULL AUTO_INCREMENT,
name VARCHAR (250),
primary key (ID)
);


16 changes: 16 additions & 0 deletions sql/insert_employers.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
insert into employers (name)
VALUES
(
"MaxwellHealth"
),
(
"HealthNet"
),
(
"NetHealthAll"
),
(
"Walgreens"
)

select * from employers
18 changes: 18 additions & 0 deletions sql/members.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

CREATE TABLE IF NOT EXISTS members
(
id int AUTO_INCREMENT not null,
name VARCHAR(250),
employer_id INT NOT NULL,
PRIMARY KEY (id)
)

insert into members (name, employer_id)
VALUES ("Steve", 11)


select a.name as "Name", b.name as "Employer"
from members a
join employers b on a.id = b.id
where a.name = "Jane" Or a.name like "%J%"

7 changes: 7 additions & 0 deletions sql/salaries.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CREATE TABLE IF NOT EXISTS salaries
(
emp_id int NOT NULL,
salary int not NULL,
primary key (emp_id),
Foreign key (emp_id) REFERENCES members (id)
)
7 changes: 7 additions & 0 deletions sql/where.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
select a.id as "Member Id", b.id as "Employer Id", a.name as "Name", b.name as "Employer"
from members a
join employers b on a.id = b.id
where b.name = "MaxwellHealth"
order by a.id DESC