Skip to content

Commit

Permalink
added documentation and script files
Browse files Browse the repository at this point in the history
  • Loading branch information
Gahyvb committed Oct 31, 2016
1 parent 49c5c19 commit 4c96a5c
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
Binary file added sprint1/DBselect.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
44 changes: 44 additions & 0 deletions sprint1/script documentation.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*scripts*/

use SEFinalProject;

/*table creation*/
CREATE TABLE user (
ID int NOT NULL AUTO_INCREMENT,
last_name varchar(255),
first_name varchar(255),
email varchar(255),
permission_level int,
PRIMARY KEY (ID));

CREATE TABLE manifest(
manifest_id int NOT NULL AUTO_INCREMENT,
version int, category VARCHAR(255),
last_edit DATE, upload_date DATE,
title VARCHAR(255),
ownerID int NOT NULL,
PRIMARY KEY (manifest_id),
FOREIGN KEY (ownerID) REFERENCES user(ID),
data BLOB NOT NULL);

/*constraints*/

ALTER TABLE user ADD CONSTRAINT
permission_constraint CHECK (permission_level = '0' OR permission_level = '1');

/*inserting data into user table*/
INSERT INTO user (ID, last_name, first_name, email, permission_level)
VALUES ('<int>', '<varchar>', '<varchar>', '<varchar>', '<int>');


/*deleting data from user table. delete by ID*/

DELETE FROM user WHERE ID = <int>

/*insert data into manifest*/
insert into manifest (manifest_id, version, category, last_edit, upload_date, title, ownerID, data)
VALUES ('2', '1', 'test', '2016-10-31', '2016-10-31', 'test2', '1', 'this is also a test');

/*delete manifest. delete by manifest_id*/

DELETE FROM manifest WHERE manifest_id = <int>
Binary file added sprint1/tabledesc.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 4c96a5c

Please sign in to comment.