SJU-CS330-S18 / E-Backpack

eBackpack is a app focused on making organization easier for student by digitizing the common student backpack. Thus relieving the strain on their back a backpack full or folders, textbooks, and notebooks can inflict, and centralizes a students school supplies.
2 stars 6 forks source link

8.2 Notebook and Notes Tables into Database #122

Open CHarvey820 opened 6 years ago

CHarvey820 commented 6 years ago

57 As a developer, I want to insert a notebook and note tables in the database so that the team can be on the same page about notebook and note attributes.

CHarvey820 commented 6 years ago

Definition of Done:

kalilamoua commented 6 years ago

Two tables created in Oracle SQL Database: Please note: isRetired is a char check instead of boolean -cannot be boolean in Oracle SQL Read more here: https://stackoverflow.com/questions/3726758/is-there-a-boolean-type-in-oracle-databases

CREATE TABLE Notebook( courseTitle varchar(50), isRetired char check (isRetired in ('Y' , 'N')), stuUsername varchar(25), primary key(courseTitle), constraint FK_notebook foreign key(stuUsername) references Student (username) );

CREATE TABLE Note( noteDate date not null, noteTitle varchar(50), noteText varchar(500), courseTitle varchar(50), primary key(noteTitle), constraint FK_note foreign key(courseTitle) references Notebook (courseTitle) );

kalilamoua commented 6 years ago

Tasks:

  1. Create notebook and note in oracle sql database connection (DONE)
kalilamoua commented 6 years ago

Fix: Added in student username as foreign key (fk) to student username in database. In addition I dropped Note and re-created the table.

CREATE TABLE Note( stuUsername varchar(25), noteDate date not null, noteTitle varchar(50), noteText varchar(500), courseTitle varchar(50), primary key(noteTitle), constraint FK_note foreign key(courseTitle) references Notebook (courseTitle), constraint FK_studentRef foreign key(stuUsername) references Student (username) );

Y1cao commented 6 years ago

Database review of notebooks and notes are done by me. --Yang