-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added documentation and script files
- Loading branch information
Showing
3 changed files
with
44 additions
and
0 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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> |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.