Hi I'm creating a notification system which consists of only 3 data inputs 1. email - to which the notification should be sent 2. the notification message - varchar 3. status - sent or not (y or N)
--Note the final goal is club all notification to be sent to an email and send it as one email by a batch job
Help me choosing which design is better
Design -1 create table Notifications( notification_id integer auto_increment primary key, message varchar(100) not null );
create table Emails( email_id integer not null auto_increment primary key, email varchar(40) not null );
create table Email_notifications( email_id integer not null, notification_id integer , status varchar(5) not null,
foreign key(email_id) references Emails(email_id), foreign key(notification_id) references Notifications(notification_id), primary key(email_id, notification_id) );
Design-2:
create table batchnotifications( id integer not null auto_increment primary key, email varchar(40) not null, message varchar(100) not null, status varchar(5) not null default 'N' );
Since i'm going to use JDBC in it let me know in that perspective in terms of ease of api creation.