-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcreatedb.sql
More file actions
executable file
·52 lines (47 loc) · 1.1 KB
/
Copy pathcreatedb.sql
File metadata and controls
executable file
·52 lines (47 loc) · 1.1 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
use database researchdb;
create table visitor (
id int primary key auto_increment,
visitorguid varchar (40),
datevisited timestamp,
)
create table grade (
id int primary key auto_increment,
grade varchar (255)
)
insert into grade (grade) values
('Pre-K'),('Kindergartten'),('1st Grade'),
('2nd Grade'),
('3rd Grade'),
('4th Grade'),
('5th Grade'),
('6th Grade'),
('7th Grade'),
('8th Grade'),
('9th Grade'),
('10th Grade'),
('11th Grade'),
('12th Grade'),
(13, 'Adult / Test');
create table visitorgradesearch (
id int primary key auto_increment,
query varchar (max),
searchuid varchar (50),
gradeid int,
foreign key (gradeid)
references grade(id),
visitorid int ,
foreign key (visitorid)
references visitor(id),
timesearched timestamp default current_timestamp
)
create table visitorlinks(
id int primary key auto_increment,
visitorid int,
searchid int,
linkclicked varchar (max),
timeclicked timestamp default current_timestamp,
foreign key (visitorid)
references visitor(id),
foreign key (searchid)
references visitorgradesearch (id)
)