mssql_config.sql 867 Bytes
Newer Older
p's avatar
p committed
1
2
3
CREATE DATABASE bank_robbery;
USE bank_robbery;

psakac's avatar
psakac committed
4
5
6
7
8
9
CREATE TABLE [data] (
  id INT IDENTITY(1,1) NOT NULL,
  timestamp DATETIME NULL DEFAULT GETDATE(),
  phrase VARCHAR(64) NOT NULL,
  bank_robbery DECIMAL(5,2) NULL,
  PRIMARY KEY (id));
psakac's avatar
psakac committed
10
11
12
13
14
15

CREATE TABLE [bank_branch] (
  id INT IDENTITY(1,1) NOT NULL,
  address VARCHAR(64) NOT NULL,
  zip VARCHAR(64) NOT NULL,
  city VARCHAR(64) NOT NULL,
psakac's avatar
psakac committed
16
17
  lat VARCHAR(64) NOT NULL,
  lon VARCHAR(64) NOT NULL,
psakac's avatar
psakac committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
  PRIMARY KEY (id));

CREATE TABLE [robbery_event] (
  id INT IDENTITY(1,1) NOT NULL,
  id_bank_branch INT NOT NULL,
  timestamp DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
  rate INT NOT NULL,
  audio_match INT NOT NULL,
  video_match INT NOT NULL,
  audio_uri VARCHAR(128) NULL,
  video_uri VARCHAR(128) NULL,
  keywords VARCHAR(256) NULL,
  PRIMARY KEY (id),
  FOREIGN KEY (id_bank_branch) REFERENCES bank_branch(id)
);