i clue how to start this in java
C SC 4 710/6 710 - M id te rm P ro je ct D escrip tio n ● D ue d ate : M arch 2 6 , 2 0 21 – 1 1:5 9 P M ● P le a se u p lo a d a ll y ou r d eli v era ble s t o t h e d esig n ate d i C olle g e f o ld er. I n t h e m id te rm p ro je ct, y o u a re a ssig ned t o im ple m en t a m in im al r e la tio nal m odel e m ula to r u sin g J ava p ro gra m min g la n g uag e t h at c a n p ro vid e b asic r e la tio nal m odel a n d a lg eb ra f u n ctio nalit ie s in -m em ory . T his m ea n s t h at y o ur e m ula to r w ill p erf o rm t h e o pera tio ns in t h e r u n t im e a n d d o n o t h ave t o a ctu ally s to re t h e d ata .A s u cce ssfu lly im ple m en te d e m ula to r w ill b e 1 a b le t o c re a te r e la tio nal m odel e le m en ts s u ch a s r e la tio ns, t u p le s, a n d a ttr ib ute s, c h eck t h e v a lid it y /c o nstra in ts o f t h e r e la tio n d esc rip tio ns a n d r e la tio n in sta n ce s, e n fo rc e t h o se c o nstra in ts , e n ab le d ata m odifi ca tio n a n d c e rta in r e tr ie va l o pera tio ns o utlin ed b elo w . Y o u w ill b e g iv e n a b ase R ela tio n im ple m en ta tio n ( S ee R ela tio n.ja va , T u p le .ja va , A ttr ib ute .ja va a lo ng w it h D riv e r.ja va f o r a s im ple e xa m ple ) a n d y o u a re r e q uir e d t o m odif y t h em a n d e n han ce t h eir f u n ctio nalit ie s w hen im ple m en tin g t h e f e a tu re s i n t h is p ro je ct. Y o u a re e xp ecte d t o u se s ta n d ard J ava lib ra rie s a n d n o t u tiliz e a d dit io nal l ib ra rie s t h at im ple m en t d ata f ra m es o r S Q L c o nnecto rs /e m ula to rs . T he p urp o se o f t h is p ro je ct i s t o g ain u n d ers ta n d in g o n h o w t h e r e la tio nal m odel f e a tu re s c a n b e im ple m en te d ; it is n o t u tiliz in g t h ir d p arty lib ra rie s in J ava . B elo w y o u w ill fi nd p ro je ct r e q uir e m en ts s p ecifi cs o n d ata d efi nit io n, m an ip ula tio n, a n d q uery in g f e a tu re s a lo ng w it h t h e d em o c a se d esc rip tio n. T here i s a ls o a g ra d in g r u b ric in t h e e n d o f t h is a ssig nm en t d esc rip tio n d o cu m en t t h at y o u c a n u se a s a c h ecklis t. D ata D efin it io n S pecif ic s A r e la tio n is a s e t o f t u p le s ( ro w s). E ach r e la tio n h as a s e t o f a ttr ib ute s ( c o lu m ns). A ll t u p le s in a r e la tio n h ave a s m an y v a lu es a s t h ere a re a ttr ib ute s i n t h at r e la tio n. T he d o m ain o f t h e a ttr ib ute s i n t h is m in im al im ple m en ta tio n w ill b e d efi ned m ere ly b y d ata t y p es. T he a llo w ed d ata t y p es a re I n te g er a n d S tr in g . T he r e la tio ns m ust c o nfo rm t o t h e im plic it a n d e xp lic it c o nstra in ts o f t h e r e la tio nal m odel. N am ely , - A r e la tio n d o es n o t h ave d up lic a te t u p le s - A r e la tio n is a s e t o f a ttr ib ute s a n d a s e t o f t u p le s - T he v a lu es in a r e la tio n a re a to m ic - T he v a lu es o f a p artic u la r a ttr ib ute in a t u p le c o m es f ro m t h e d o m ain o f t h e a ttr ib ute - E ve ry r e la tio n h as a k e y a ttr ib ute ( f o r s im plic it y , a ssu m e t h at y o u w ill n o t h ave c o m po sit e p rim ary k e ys ) - T he k e y o f a r e la tio n c a n no t b e n ull. - R ela tio ns im ple m en t r e fe re n tia l in te g rit y c o nstra in ts ; i . e ., t h e v a lu e in t h e f o re ig n k e y c o lu m n ( o r c o lu m ns) F K o f t h e r e fe re n cin g r e la tio n R 1 c a n b e e it h er: ( 1 ) a v a lu e o f a n e xis tin g p rim ary k e y v a lu e o f a c o rre sp o nd in g p rim ary k e y P K in t h e r e fe re n ce d r e la tio n R 2, o r ( 2 ) n ull. - A d ata b ase s c h em a is a s e t o f r e la tio ns a n d c o nstra in ts o n t h o se r e la tio ns. 1 A lt h o ug h it is n o t r e q uir e d in t h e s c o pe o f t h is p ro je ct, y o u c a n c re a te r e a d er a n d w rit e r m odule s f o r in te ra ctin g w it h t h e fi le s ys te m f o r p ers is te n ce .
Y o ur im ple m en ta tio n is a ls o r e q uir e d t o in clu d e a r e la tio nal s c h em a c la ss. R ela tio nal s c h em a is a s e t o f r e la tio ns a n d a s e t o f c o nstra in ts d efi nin g t h e in te rre la tio nsh ip s b etw een t h e r e la tio ns in t h e s c h em a.
D ata M an ip ula tio n S pecif ic s T here a re t h re e s p ecifi c d ata m an ip ula tio n o pera tio ns t h at n eed t o b e c o ve re d in y o ur i m ple m en ta tio n. F o r e a ch r e la tio n t h e e m ula to r is r e q uir e d t o b e c a p ab le o f in se rtin g n ew t u p le s, r e m ovin g e xis tin g t u p le s a n d u p d atin g v a lu es in o ne o r m ore t u p le s. Y o u w ill im ple m en t - I n se rt o pera tio n: t h is o pera tio n w ill in se rt a n ew t u p le a n d c h eck if c o nstra in ts a re v io la te d . - D ele te o pera tio n: t h is o pera tio n w ill d ele te o ne o r m ore t u p le s b ase d o n a c o nd it io n ( a B oole a n ). T he b o ole a n c o nd it io ns t h at y o u c a n u se a re lim it e d t o ‘e q uals ’, ‘l e ss t h an’ o r ‘ g re a te r t h an’. T he o pera n d s f o r b o ole a n c o nd it io ns c a n b e e it h er r e la tio n a ttr ib ute s o r l it e ra ls /v a lu es ( a S tr in g o r a n I n te g er) . - U pd ate o pera tio n: t h is o pera tio n m odifi es o ne a ttr ib ute ’s v a lu e o n a t u p le . T he u p d ate d t u p le s w ill b e d ete rm in ed b ase d o n a c o nd it io n s im ila r t o t h e d ele te o pera tio n. T he b o ole a n c o nd it io ns t h at y o u c a n u se a re lim it e d t o ‘ e q uals ’, ‘l e ss t h an’ o r ‘g re a te r t h an’. T he o pera n d s f o r b o ole a n c o nd it io ns c a n b e e it h er r e la tio n a ttr ib ute s o r lit e ra ls /v a lu es ( a S tr in g o r a n I n te g er) . A fte r e a ch m odifi ca tio n, y o u a re r e q uir e d t o c h eck t h e in te g rit y c o nstra in ts . N am ely , - A fte r in se rt o pera tio ns, y o u a re r e q uir e d t o c h eck i f d o m ain , k e y, r e fe re n tia l in te g rit y , a n d e n tit y in te g rit y c o nstra in ts a re v io la te d f o r t h e r e la tio nal s c h em a. - A fte r u p d ate o pera tio ns, y o u a re a g ain r e q uir e d t o c h eck if d o m ain , k e y, r e fe re n tia l i n te g rit y , a n d e n tit y in te g rit y c o nstra in ts a re v io la te d . - A fte r d ele te o pera tio ns, y o u a re r e q uir e d t o c h eck i f r e fe re n tia l in te g rit y c o nstra in ts a re v io la te d Y o u w ill u se d efa u lt t r ig gere d a ctio ns f o r e a ch d if fe re n t t y p e o f v io la tio n a n d o pera tio n. B elo w a re t h o se t r ig gere d a ctio ns: - I f a n in se rt o pera tio n v io la te s a n y o f t h e c o nstra in ts , t h e e m ula to r is r e q uir e d t o r e je ct it . T his m ea n s a n y in se rt t h at v io la te s t h e c o nstra in ts w ill n o t b e e xe cu te d . - I f a n u p d ate o pera tio n v io la te s d o m ain a n d e n tit y i n te g rit y c o nstra in ts , it n eed s t o b e r e je cte d ( s im ila r t o in se rt) . I f it v io la te s r e fe re n tia l i n te g rit y c o nstra in ts , t h e u p d ate s h o uld b e c a sc a d ed t o e a ch a ttr ib ute t h at r e fe re n ce s t h e m odifi ed v a lu e. T his m ea n s if a r e fe re n ce d p rim ary k e y v a lu e is c h an g ed , t h e r e fe re n cin g a ttr ib ute s w ho h ave t h e s a m e v a lu e w ill a ls o b e u p d ate d . - I f a d ele te o pera tio n v io la te s r e fe re n tia l in te g rit y c o nstra in ts , it s h o uld b e r e m ed ie d b y s e ttin g t h e v a lu es t o n ull. T his m ea n s t h at if t h e d ele te d t u p le s p rim ary k e y a ttr ib ute is r e fe re n ce d b y a n o th er a ttr ib ute , t h e r e fe re n cin g a ttr ib ute ’s v a lu e n eed s t o b e s e t t o n ull. Q uery in g S pecif ic s Y o ur e m ula to r im ple m en ta tio n w ill s u p po rt q uery in g f u n ctio nalit ie s w hic h a re b ase d o n s im ple r e la tio nal a lg eb ra o pera tio ns. T hese in clu d e u n ary , s e t-b ase d b in ary , jo in -r e la te d b in ary , a n d a g gre g ate o pera tio ns. N ote t h at a ll o f t h e r e la tio nal a lg eb ra o pera tio ns a re c lo se d . T his m ea n s t h at t h e o pera tio ns w ill r e tu rn a n o th er r e la tio n o bje ct a s a r e su lt . I n t h e f o llo w in g s u b se ctio ns, y o u w ill fi nd m ore in fo rm atio n o n e a ch t y p e o f q uery o pera tio ns. Unary Operations Y o u a re e xp ecte d t o im ple m en t t w o u n ary o pera tio ns w hic h a re : - P ro je ctio n ( v e rtic a l p artit io nin g b ase d o n a s e t o f a ttr ib ute s): T his o pera tio n w ill t a ke a l is t o f a ttr ib ute s a s in p ut. T he a ttr ib ute s m ust b e a s u b se t o f r e la tio n o r t h e q uery w ill r e tu rn a n e rro r. - S ele ctio n ( c o nd it io n b ase d t u p le s e le ctio n f ro m a r e la tio n): T his o pera tio n r e tu rn s a s u b se t o f t u p le s b ase d o n a b o ole a n c o nd it io n. T he b o ole a n c o nd it io ns t h at y o u c a n u se a re lim it e d t o ‘e q uals ’, ‘l e ss t h an’ o r ‘g re a te r t h an’. T he o pera n d s f o r b o ole a n c o nd it io ns c a n b e e it h er r e la tio n a ttr ib ute s o r lit e ra ls /v a lu es ( a S tr in g o r a n I n te g er lit e ra l) . Set-based Binary Operations Y o u a re a ls o e xp ecte d t o im ple m en t t h re e s e t-b ase d b in ary q uery in g o pera tio ns. T ho se a re - U nio n, - I n te rs e ctio n, a n d - S et d if fe re n ce . T hese a re r e la tiv e ly s im ple r o pera tio ns t o im ple m en t. F o r t h e s e t-b ase d b in ary o pera tio ns, y o u a re r e q uir e d t o m ake s u re t h e o pera n d s a re t y p e-c o m patib le .
Join-Related Binary Operations F o r jo in -r e la te d o pera tio ns, y o u w ill b e im ple m en tin g t h re e b in ary o pera tio ns w hic h a re : - C ro ss p ro duct - E q uijo in - N atu ra l jo in F o r n atu ra l jo in , y o u a re e xp ecte d t o d ete rm in e t h e a ttr ib ute s w it h t h e s a m e n am e a n d d o m ain t o p erf o rm t h e jo in o pera tio n a n d d ro p t h e d up lic a te a ttr ib ute s in t h e r e su lt in g r e la tio n. I f n o a ttr ib ute s a re s h are d , o r if t h e a ttr ib ute w it h t h e s a m e n am e h as a d if fe re n t d o m ain , t h en t h e o pera tio n n eed s t o b e r e je cte d . I n t h e c a se o f e q uijo in a n d c ro ss p ro duct o pera tio ns, u se t h e n am e o f t h e r e la tio n a s a s u ffi x t o o ne o f t h e c o lu m n n am es if c o lu m n n am es a re r e p ea te d . F o r t h e e q uijo in , t a ke t h e n am es o f t h e a ttr ib ute s ( o ne f ro m e a ch r e la tio n – w hic h a re r e q uir e d t o b e c o m pare d f o r p erf o rm in g t h e jo in o pera tio ns) a s t h e p ara m ete r. Aggregate Operations L a stly , y o u a re e xp ecte d t o im ple m en t fi ve a g gre g ate f u n ctio ns. T ho se a re - M in - M ax - A ve ra g e ( ro un d ed ) - S um - C oun t T he r e su lt o f s im ple a g gre g ate f u n ctio n q uerie s a re s till a r e la tio n, w it h o ne v a lu e ( o ne a ttr ib ute a n d o ne t u p le ). T he a ttr ib ute in t h e r e su lt in g r e la tio ns s h o uld b e n am ed u sin g t h e f o llo w in g f o rm at: [ f u n ctio n_n am e]_ [a ttr ib ute _n am e]. A ggre g ate o pera tio ns w ill t a ke o ne r e la tio n, o ne ( n um eric a l) a ttr ib ute , a n d o ne f u n ctio n a s a n a ttr ib ute . I f t h e c o lu m n is n o t n um eric a l, t h e o pera tio n w ill b e r e je cte d .
I n a d dit io n t o t h e a g gre g ate o pera tio ns, y o u a re a ls o r e q uir e d t o im ple m en t a g ro up -a g gre g ate o pera tio n. I n t h e g ro up -a g gre g ate o pera tio ns, t h e r e su lt -s e t w ill b e g ro up ed b y e xa ctly o ne c o lu m n a n d t h e a g gre g ate o pera tio ns w ill b e a p plie d t o a g ain o ne n um eric a l c o lu m n. T he g ro up -a g gre g ate o pera tio n a ls o n eed s t o s u p po rt t h ese fi ve a b o ve m en tio ned a g gre g ate f u n ctio ns. T he r e su lt o f a g ro up -a g gre g ate o pera tio n i s a ls o a r e la tio n w it h e xa ctly t w o a ttr ib ute s, w here o ne is t h e g ro up in g a ttr ib ute a n d t h e o th er is t h e a ttr ib ute t h e a g gre g ate f u n ctio n is a p plie d t o . P le a se f o llo w t h e s a m e n am in g c o nve n tio n f o r t h e a g gre g ate d a ttr ib ute ; i . e ., [ f u n ctio n_n am e]_ [a ttr ib ute _n am e].
D em o C ase a n d R ep ort I n t h e s e co nd w eek o f y o ur p ro je ct, y o u w ill b e g iv e n a d em o c a se ( a s e t o f t e xt fi le s a s r e la tio ns) a n d c o nstra in ts . Y o u w ill a ls o b e p ro vid ed w it h q uerie s. Y o u w ill b e a ske d t o c re a te a r e la tio nal s c h em a u sin g t h e r e la tio ns in t h is d em o c a se , d efi ne t h e c o nstra in ts a n d in se rt t h e t u p le s t o t h o se r e la tio ns. T hen , u sin g t h e p o pula te d r e la tio ns a n d im ple m en te d q uery in g c a p ab ilit ie s, y o u w ill im ple m en t t h e p ro vid ed q uerie s in y o ur e m ula to r. T he r e p o rt w ill in clu d e s h o rt d esc rip tio ns o f h o w y o u im ple m en te d t h e g iv e n r e la tio nal s c h em a a n d d em onstra te t h e s te p s y o u h ave t a ke n .
G ra d in g R ubric C ate g o ry I t e m /F ea tu re P erc e n ta g e D ata D efi nit io n I m ple m en t r e la tio nal s c h em a ( s e t o f r e la tio ns a n d c o nstra in ts ) 2 5% C heck t u p le d up lic a te s C heck d o m ain c o nstra in ts f o r a n a ttr ib ute o n a t u p le C heck e n tit y in te g rit y a n d p rim ary k e y c o nstra in ts ( e ve ry r e la tio n h as a P .K . a n d P .K . is u n iq ue a n d n o t n ull) I m ple m en t r e fe re n tia l in te g rit y c o nstra in ts C heck r e fe re n tia l in te g rit y c o nstra in ts in a r e la tio nal s c h em a ( re fe re n cin g a ttr ib ute e xis ts in r e fe rre d o r i t is n ull) D ata M an ip ula tio n I m ple m en t in se rt 2 5% I m ple m en t u p d ate I m ple m en t d ele te C heck if m odifi ca tio ns c a u se v io la tio ns I m ple m en t t r ig gere d a ctio ns ( c a sc a d e o n u p d ate , s e t n ull o n d ele te Q uery in g U nary O pera tio ns 1 0% [ 5 e a ch ] S et-b ase d B in ary o pera tio ns ( w it h t y p e c o m patib ilit y ) 9 % [ 3 e a ch ] J o in -r e la te d b in ary o pera tio ns 1 5% [ 5 e a ch ] A ggre g ate o pera tio ns 1 0% [ 2 e a ch ] G ro up a g gre g ate o pera tio ns 6 % D em o C re a te r e p o rt w it h d em o c a se 2 0%