-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathBioinformatics_Advanced_DB.sql
More file actions
164 lines (142 loc) · 4.97 KB
/
Copy pathBioinformatics_Advanced_DB.sql
File metadata and controls
164 lines (142 loc) · 4.97 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
-- Create the database
CREATE DATABASE Bioinformatics_Advanced_DB;
USE Bioinformatics_Advanced_DB;
-- Create a table for organisms
CREATE TABLE Organisms (
OrganismID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Taxonomy VARCHAR(255)
);
-- Create a table for genes
CREATE TABLE Genes (
GeneID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
OrganismID INT,
Functions VARCHAR(255),
FOREIGN KEY (OrganismID) REFERENCES Organisms(OrganismID)
);
-- Create a table for proteins
CREATE TABLE Proteins (
ProteinID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
GeneID INT,
Functions VARCHAR(255),
FOREIGN KEY (GeneID) REFERENCES Genes(GeneID)
);
-- Create a table for sequences
CREATE TABLE Sequences (
SequenceID INT AUTO_INCREMENT PRIMARY KEY,
ProteinID INT,
Sequence TEXT NOT NULL,
FOREIGN KEY (ProteinID) REFERENCES Proteins(ProteinID)
);
-- Create a table for diseases
CREATE TABLE Diseases (
DiseaseID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Description TEXT
);
-- Create a linking table for genes and diseases
CREATE TABLE GeneDiseases (
GeneID INT,
DiseaseID INT,
FOREIGN KEY (GeneID) REFERENCES Genes(GeneID),
FOREIGN KEY (DiseaseID) REFERENCES Diseases(DiseaseID),
PRIMARY KEY (GeneID, DiseaseID)
);
-- Create a linking table for proteins and diseases
CREATE TABLE ProteinDiseases (
ProteinID INT,
DiseaseID INT,
FOREIGN KEY (ProteinID) REFERENCES Proteins(ProteinID),
FOREIGN KEY (DiseaseID) REFERENCES Diseases(DiseaseID),
PRIMARY KEY (ProteinID, DiseaseID)
);
-- Create a table for experiments
CREATE TABLE Experiments (
ExperimentID INT AUTO_INCREMENT PRIMARY KEY,
Name VARCHAR(100) NOT NULL,
Date DATE,
Researcher VARCHAR(100)
);
-- Create a linking table for genes and experiments
CREATE TABLE GeneExperiments (
GeneID INT,
ExperimentID INT,
FOREIGN KEY (GeneID) REFERENCES Genes(GeneID),
FOREIGN KEY (ExperimentID) REFERENCES Experiments(ExperimentID),
PRIMARY KEY (GeneID, ExperimentID)
);
-- Create a linking table for proteins and experiments
CREATE TABLE ProteinExperiments (
ProteinID INT,
ExperimentID INT,
FOREIGN KEY (ProteinID) REFERENCES Proteins(ProteinID),
FOREIGN KEY (ExperimentID) REFERENCES Experiments(ExperimentID),
PRIMARY KEY (ProteinID, ExperimentID)
);
-- Create a table for genetic variants
CREATE TABLE Variants (
VariantID INT AUTO_INCREMENT PRIMARY KEY,
GeneID INT,
VariantType VARCHAR(50),
Description TEXT,
FOREIGN KEY (GeneID) REFERENCES Genes(GeneID)
);
-- Insert mock data into Organisms
INSERT INTO Organisms (Name, Taxonomy) VALUES
('Homo sapiens', 'Eukaryota; Metazoa; Chordata; Mammalia; Primates'),
('Escherichia coli', 'Bacteria; Proteobacteria; Gammaproteobacteria; Enterobacterales'),
('Saccharomyces cerevisiae', 'Eukaryota; Fungi; Ascomycota; Saccharomycotina; Saccharomycetes');
-- Insert mock data into Genes
INSERT INTO Genes (Name, OrganismID, Functions) VALUES
('BRCA1', 1, 'DNA repair'),
('lacZ', 2, 'Beta-galactosidase production'),
('ACT1', 3, 'Actin protein production'),
('TP53', 1, 'Tumor suppression');
-- Insert mock data into Proteins
INSERT INTO Proteins (Name, GeneID, Functions) VALUES
('BRCA1 Protein', 1, 'Tumor suppression'),
('Beta-galactosidase', 2, 'Lactose metabolism'),
('Actin', 3, 'Cell structure and movement'),
('p53 Protein', 4, 'Apoptosis regulation');
-- Insert mock data into Sequences
INSERT INTO Sequences (ProteinID, Sequence) VALUES
(1, 'MRTNPLHPPY... (truncated for brevity)'),
(2, 'MKPVTLYDVN... (truncated for brevity)'),
(3, 'MSKGEELFTG... (truncated for brevity)'),
(4, 'MADQLTEEQI... (truncated for brevity)');
-- Insert mock data into Diseases
INSERT INTO Diseases (Name, Description) VALUES
('Breast Cancer', 'A malignant tumor that starts in the cells of the breast.'),
('Lactose Intolerance', 'Inability to digest lactose, a sugar found in milk.'),
('Yeast Structural Defect', 'A defect in the cytoskeletal structure of yeast cells.');
-- Link Genes to Diseases
INSERT INTO GeneDiseases (GeneID, DiseaseID) VALUES
(1, 1),
(2, 2),
(3, 3);
-- Link Proteins to Diseases
INSERT INTO ProteinDiseases (ProteinID, DiseaseID) VALUES
(1, 1),
(2, 2),
(3, 3);
-- Insert mock data into Experiments
INSERT INTO Experiments (Name, Date, Researcher) VALUES
('BRCA1 Functional Analysis', '2025-01-15', 'Dr. Smith'),
('Lactose Operon Study', '2024-12-10', 'Dr. Johnson'),
('Yeast Cytoskeleton Dynamics', '2023-07-20', 'Dr. Lee');
-- Link Genes to Experiments
INSERT INTO GeneExperiments (GeneID, ExperimentID) VALUES
(1, 1),
(2, 2),
(3, 3);
-- Link Proteins to Experiments
INSERT INTO ProteinExperiments (ProteinID, ExperimentID) VALUES
(1, 1),
(2, 2),
(3, 3);
-- Insert mock data into Variants
INSERT INTO Variants (GeneID, VariantType, Description) VALUES
(1, 'SNP', 'Single nucleotide polymorphism in BRCA1 associated with breast cancer risk'),
(3, 'Deletion', 'Deletion in ACT1 gene leading to structural defects in yeast');