mirror of
https://github.com/sharkdp/bat.git
synced 2025-02-02 10:59:15 +01:00
Add SQL syntax highlighting test
This commit is contained in:
parent
3609700b5e
commit
7a180e22ff
266
tests/syntax-tests/highlighted/SQL/ims.sql
Normal file
266
tests/syntax-tests/highlighted/SQL/ims.sql
Normal file
@ -0,0 +1,266 @@
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m interships[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46minterships[0m[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m(intership_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m intership_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mname [0m[3;38;2;102;217;239mvarchar2[0m[38;2;248;248;242m([0m[38;2;190;132;255m50[0m[38;2;248;248;242m),[0m
|
||||
[38;2;248;248;242mstart_date [0m[3;38;2;102;217;239mdate[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mend_date [0m[3;38;2;102;217;239mdate[0m[38;2;248;248;242m);[0m
|
||||
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m interships[0m
|
||||
[38;2;249;38;114mvalues[0m
|
||||
[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mLeaderator 2019[0m[38;2;230;219;116m'[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242m to_date([0m[38;2;230;219;116m'[0m[38;2;230;219;116m15/02/2019[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mDD/MM/YYYY[0m[38;2;230;219;116m'[0m[38;2;248;248;242m),[0m
|
||||
[38;2;248;248;242m to_date([0m[38;2;230;219;116m'[0m[38;2;230;219;116m01/09/2019[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mDD/MM/YYYY[0m[38;2;230;219;116m'[0m[38;2;248;248;242m));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m interships[0m
|
||||
[38;2;248;248;242m (intership_id, name, start_date)[0m
|
||||
[38;2;249;38;114mvalues[0m
|
||||
[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mLeaderator 2020[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, to_date([0m[38;2;230;219;116m'[0m[38;2;230;219;116m10/02/2019[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mDD/MM/YYYY[0m[38;2;230;219;116m'[0m[38;2;248;248;242m));[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m directions[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mdirections[0m[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m(direction_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m direction_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mname [0m[3;38;2;102;217;239mvarchar2[0m[38;2;248;248;242m([0m[38;2;190;132;255m50[0m[38;2;248;248;242m));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m directions [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mData Science[0m[38;2;230;219;116m'[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m directions [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mOracle Development[0m[38;2;230;219;116m'[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m participants[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mparticipants[0m[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m(participant_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m participant_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mfirst_name [0m[3;38;2;102;217;239mvarchar2[0m[38;2;248;248;242m([0m[38;2;190;132;255m25[0m[38;2;248;248;242m),[0m
|
||||
[38;2;248;248;242mlast_name [0m[3;38;2;102;217;239mvarchar2[0m[38;2;248;248;242m([0m[38;2;190;132;255m25[0m[38;2;248;248;242m),[0m
|
||||
[38;2;248;248;242mpersonal_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m11[0m[38;2;248;248;242m),[0m
|
||||
[38;2;248;248;242mintership_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m participant_inter_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m interships (intership_id),[0m
|
||||
[38;2;248;248;242mdirection_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m participant_direct_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m directions (direction_id),[0m
|
||||
[38;2;249;38;114mconstraint[0m[38;2;248;248;242m personal_id_unique unique (personal_id));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m participants[0m
|
||||
[38;2;249;38;114mvalues[0m
|
||||
[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mErekle[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mTvinadze[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;190;132;255m01011234567[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m participants[0m
|
||||
[38;2;249;38;114mvalues[0m
|
||||
[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mMariami[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mChakhvadze[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;190;132;255m01011234568[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m hiring_layer_types[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mhiring_layer_types[0m[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m(layer_type_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m layer_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mtype [0m[3;38;2;102;217;239mvarchar2[0m[38;2;248;248;242m([0m[38;2;190;132;255m50[0m[38;2;248;248;242m));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m hiring_layer_types [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mGMAT[0m[38;2;230;219;116m'[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m hiring_layer_types [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mAlgorithms[0m[38;2;230;219;116m'[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m hiring_layer_types [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m3[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mInterview[0m[38;2;230;219;116m'[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m hiring_layers[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mhiring_layers[0m
|
||||
[38;2;248;248;242m(layer_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m layer_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mlayer_type_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m layer_type_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m hiring_layer_types (layer_type_id),[0m
|
||||
[38;2;248;248;242mparticipant_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m participant_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m participants (participant_id),[0m
|
||||
[38;2;248;248;242mresult [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m3[0m[38;2;248;248;242m));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m hiring_layers [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m52[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m hiring_layers [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m80[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m hiring_layers [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m3[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m75[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m hiring_layers [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m4[0m[38;2;248;248;242m, [0m[38;2;190;132;255m3[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m100[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m subjects[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46msubjects[0m[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m(subject_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m subject_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mname [0m[3;38;2;102;217;239mvarchar2[0m[38;2;248;248;242m([0m[38;2;190;132;255m100[0m[38;2;248;248;242m),[0m
|
||||
[38;2;248;248;242mminimum_score [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m3[0m[38;2;248;248;242m));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m subjects [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mSQL[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;190;132;255m70[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m subjects [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mMachine Learning[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;190;132;255m70[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m direction_subjects[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mdirection_subjects[0m
|
||||
[38;2;248;248;242m(direction_subject_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m direct_sub_id [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mdirection_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m direct_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m directions (direction_id),[0m
|
||||
[38;2;248;248;242msubject_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m subject_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m subjects (subject_id));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m direction_subjects [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m direction_subjects [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m direction_subjects [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m3[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m component_types[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mcomponent_types[0m
|
||||
[38;2;248;248;242m(component_type_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m com_type_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mtype [0m[3;38;2;102;217;239mvarchar2[0m[38;2;248;248;242m([0m[38;2;190;132;255m50[0m[38;2;248;248;242m));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m component_types [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mHomework[0m[38;2;230;219;116m'[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m component_types [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mQuiz[0m[38;2;230;219;116m'[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m components[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mcomponents[0m
|
||||
[38;2;248;248;242m(component_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m component_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242msubject_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m sub_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m subjects (subject_id),[0m
|
||||
[38;2;248;248;242mminimum_score [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m3[0m[38;2;248;248;242m),[0m
|
||||
[38;2;248;248;242mcomponent_type_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m com_type_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m component_types (component_type_id),[0m
|
||||
[38;2;248;248;242mweight [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m3[0m[38;2;248;248;242m));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m components [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m60[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m20[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m components [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m65[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m50[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m results[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mresults[0m[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m(result_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m result_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242missue_date [0m[3;38;2;102;217;239mdate[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mgrade [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m3[0m[38;2;248;248;242m),[0m
|
||||
[38;2;248;248;242mparticipant_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m particip_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m participants (participant_id),[0m
|
||||
[38;2;248;248;242mcomponent_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m component_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m components (component_id));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m results[0m
|
||||
[38;2;249;38;114mvalues[0m
|
||||
[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, to_date([0m[38;2;230;219;116m'[0m[38;2;230;219;116m04/05/2020[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mDD/MM/YYYY[0m[38;2;230;219;116m'[0m[38;2;248;248;242m), [0m[38;2;190;132;255m87[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;190;132;255m2[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m learning_material_types[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mlearning_material_types[0m
|
||||
[38;2;248;248;242m(material_type_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m lear_material_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mtype [0m[3;38;2;102;217;239mvarchar[0m[38;2;248;248;242m([0m[38;2;190;132;255m50[0m[38;2;248;248;242m));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m learning_material_types [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mBook[0m[38;2;230;219;116m'[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m learning_material_types [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m2[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mPPT[0m[38;2;230;219;116m'[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m learning_material_types [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m3[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mYoutube Video[0m[38;2;230;219;116m'[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m learning_materials[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mlearning_materials[0m
|
||||
[38;2;248;248;242m(learning_material_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m),[0m
|
||||
[38;2;248;248;242murl [0m[3;38;2;102;217;239mvarchar2[0m[38;2;248;248;242m([0m[38;2;190;132;255m3000[0m[38;2;248;248;242m),[0m
|
||||
[38;2;248;248;242msubject_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m subj_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m subjects (subject_id),[0m
|
||||
[38;2;248;248;242mmaterial_type_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m material_type_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m learning_material_types (material_type_id));[0m
|
||||
|
||||
[38;2;249;38;114minsert into[0m[38;2;248;248;242m learning_materials [0m[38;2;249;38;114mvalues[0m[38;2;248;248;242m ([0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;230;219;116m'[0m[38;2;230;219;116mwww.youtube.com[0m[38;2;230;219;116m'[0m[38;2;248;248;242m, [0m[38;2;190;132;255m1[0m[38;2;248;248;242m, [0m[38;2;190;132;255m3[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;249;38;114mcommit[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m sessions[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46msessions[0m[38;2;248;248;242m [0m
|
||||
[38;2;248;248;242m(session_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m session_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mstart_date [0m[3;38;2;102;217;239mdate[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mend_date [0m[3;38;2;102;217;239mdate[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mintership_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m inter_idd_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m interships (intership_id),[0m
|
||||
[38;2;248;248;242mdirection_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m direct_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m directions (direction_id),[0m
|
||||
[38;2;248;248;242msubject_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m subject_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m subjects (subject_id));[0m
|
||||
|
||||
[38;2;117;113;94m--[0m[38;2;117;113;94m attendances[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mtable[0m[38;2;248;248;242m [0m[38;2;166;226;46mattendances[0m
|
||||
[38;2;248;248;242m(attendance_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m attend_id_pk [0m[38;2;249;38;114mprimary key[0m[38;2;248;248;242m,[0m
|
||||
[38;2;248;248;242mparticipant_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m participant_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m participants (participant_id),[0m
|
||||
[38;2;248;248;242msession_id [0m[3;38;2;102;217;239mnumber[0m[38;2;248;248;242m([0m[38;2;190;132;255m7[0m[38;2;248;248;242m) [0m[38;2;249;38;114mconstraint[0m[38;2;248;248;242m session_id_fk [0m[38;2;249;38;114mreferences[0m[38;2;248;248;242m sessions (session_id),[0m
|
||||
[38;2;248;248;242mstatus [0m[3;38;2;102;217;239mvarchar2[0m[38;2;248;248;242m([0m[38;2;190;132;255m25[0m[38;2;248;248;242m));[0m
|
||||
|
||||
|
||||
[38;2;117;113;94m/*[0m
|
||||
[38;2;117;113;94mშექმენით view სადაც იქნება სტაჟირების შესახებ ინფორმაცია:[0m
|
||||
[38;2;117;113;94mსახელი,[0m
|
||||
[38;2;117;113;94mდაწყების თარიღი,[0m
|
||||
[38;2;117;113;94mდასრულების თარიღი,[0m
|
||||
[38;2;117;113;94mმონაწილეების რაოდენობა.[0m
|
||||
[38;2;117;113;94m*/[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mview[0m[38;2;248;248;242m [0m[38;2;166;226;46mintership_info[0m
|
||||
[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;190;132;255mi[0m[38;2;248;248;242m.[0m[38;2;190;132;255mname[0m[38;2;248;248;242m, [0m[38;2;190;132;255mi[0m[38;2;248;248;242m.[0m[38;2;190;132;255mstart_date[0m[38;2;248;248;242m, [0m[38;2;190;132;255mi[0m[38;2;248;248;242m.[0m[38;2;190;132;255mend_date[0m[38;2;248;248;242m, ([0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;102;217;239mcount[0m[38;2;248;248;242m(participant_id) [0m[38;2;249;38;114mfrom[0m[38;2;248;248;242m participants p [0m[38;2;249;38;114mwhere[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mintership_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mi[0m[38;2;248;248;242m.[0m[38;2;190;132;255mintership_id[0m[38;2;248;248;242m) number_of_participants[0m
|
||||
[38;2;249;38;114mfrom[0m[38;2;248;248;242m interships i;[0m
|
||||
|
||||
[38;2;117;113;94m/*[0m
|
||||
[38;2;117;113;94mშექმენით view სადაც იქნება მონაწილეებზე ინფორმაცია:[0m
|
||||
[38;2;117;113;94mსტაჟირების სახელი,[0m
|
||||
[38;2;117;113;94mმონაწილის სახელი,[0m
|
||||
[38;2;117;113;94mმიმართულება,[0m
|
||||
[38;2;117;113;94mშერჩევის რამდენი ეტაპი გაიარა,[0m
|
||||
[38;2;117;113;94mსტაჟირების სტატუსი(გაიარა, ვერ გაიარა, მიმდინარე,ვერ მოხვდა სტაჟირებაზე)[0m
|
||||
[38;2;117;113;94m*/[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mview[0m[38;2;248;248;242m [0m[38;2;166;226;46mparticipant_info[0m
|
||||
[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;190;132;255mi[0m[38;2;248;248;242m.[0m[38;2;190;132;255mname[0m[38;2;248;248;242m intership, [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mfirst_name[0m[38;2;248;248;242m, [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mlast_name[0m[38;2;248;248;242m, [0m[38;2;190;132;255md[0m[38;2;248;248;242m.[0m[38;2;190;132;255mname[0m[38;2;248;248;242m direction, [0m
|
||||
[38;2;248;248;242m([0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;102;217;239mcount[0m[38;2;248;248;242m([0m[38;2;190;132;255mh2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m[38;2;248;248;242m) [0m[38;2;249;38;114mfrom[0m[38;2;248;248;242m hiring_layers h2 [0m[38;2;249;38;114mwhere[0m[38;2;248;248;242m [0m[38;2;190;132;255mh2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m[38;2;248;248;242m) number_of_layers,[0m
|
||||
[38;2;249;38;114mcase[0m[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mdirection_id[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;190;132;255mnull[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mRejected[0m[38;2;230;219;116m'[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m [0m[38;2;190;132;255mi[0m[38;2;248;248;242m.[0m[38;2;190;132;255mend_date[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;190;132;255mnull[0m[38;2;248;248;242m [0m[38;2;249;38;114mthen[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mPresent[0m[38;2;230;219;116m'[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mwhen[0m[38;2;248;248;242m ([0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;190;132;255mh2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mresult[0m[38;2;248;248;242m [0m[38;2;249;38;114mfrom[0m[38;2;248;248;242m hiring_layers h2 [0m[38;2;249;38;114mjoin[0m[38;2;248;248;242m hiring_layer_types l on [0m[38;2;190;132;255mh2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mlayer_type_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255ml[0m[38;2;248;248;242m.[0m[38;2;190;132;255mlayer_type_id[0m[38;2;248;248;242m [0m[38;2;249;38;114mwhere[0m[38;2;248;248;242m [0m[38;2;190;132;255mh2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m[38;2;248;248;242m [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;190;132;255ml[0m[38;2;248;248;242m.[0m[38;2;190;132;255mtype[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mIntership[0m[38;2;230;219;116m'[0m[38;2;248;248;242m) [0m[38;2;249;38;114m>[0m[38;2;248;248;242m ([0m[38;2;249;38;114mselect[0m[38;2;248;248;242m minimum_score [0m[38;2;249;38;114mfrom[0m[38;2;248;248;242m subjects) [0m[38;2;249;38;114mthen[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mPassed[0m[38;2;230;219;116m'[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114melse[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mFailed[0m[38;2;230;219;116m'[0m
|
||||
[38;2;248;248;242m [0m[38;2;249;38;114mend[0m[38;2;248;248;242m status[0m
|
||||
[38;2;249;38;114mfrom[0m[38;2;248;248;242m interships i,[0m
|
||||
[38;2;248;248;242mparticipants p,[0m
|
||||
[38;2;248;248;242mdirections d[0m
|
||||
[38;2;249;38;114mwhere[0m[38;2;248;248;242m [0m[38;2;190;132;255mi[0m[38;2;248;248;242m.[0m[38;2;190;132;255mintership_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mintership_id[0m
|
||||
[38;2;249;38;114mand[0m[38;2;248;248;242m ([0m[38;2;190;132;255md[0m[38;2;248;248;242m.[0m[38;2;190;132;255mdirection_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mdirection_id[0m[38;2;248;248;242m [0m[38;2;249;38;114mor[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mdirection_id[0m[38;2;248;248;242m [0m[38;2;249;38;114mis[0m[38;2;248;248;242m [0m[38;2;190;132;255mnull[0m[38;2;248;248;242m);[0m
|
||||
|
||||
[38;2;117;113;94m/*[0m
|
||||
[38;2;117;113;94mშექნენით view სადაც იქნება მიმართულებებზე ინფორმაცია:[0m
|
||||
[38;2;117;113;94mმიმართულების სახელი,[0m
|
||||
[38;2;117;113;94mრა საგნები ისწავლება[0m
|
||||
[38;2;117;113;94m*/[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mview[0m[38;2;248;248;242m [0m[38;2;166;226;46mdirection_info[0m
|
||||
[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;190;132;255md[0m[38;2;248;248;242m.[0m[38;2;190;132;255mname[0m[38;2;248;248;242m direction, [0m[38;2;190;132;255ms[0m[38;2;248;248;242m.[0m[38;2;190;132;255mname[0m[38;2;248;248;242m subject[0m
|
||||
[38;2;249;38;114mfrom[0m[38;2;248;248;242m directions d,[0m
|
||||
[38;2;248;248;242mdirection_subjects ds,[0m
|
||||
[38;2;248;248;242msubjects s[0m
|
||||
[38;2;249;38;114mwhere[0m[38;2;248;248;242m [0m[38;2;190;132;255md[0m[38;2;248;248;242m.[0m[38;2;190;132;255mdirection_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mds[0m[38;2;248;248;242m.[0m[38;2;190;132;255mdirection_id[0m
|
||||
[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;190;132;255mds[0m[38;2;248;248;242m.[0m[38;2;190;132;255msubject_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255ms[0m[38;2;248;248;242m.[0m[38;2;190;132;255msubject_id[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m/*[0m
|
||||
[38;2;117;113;94mშექმენით view სადც იქნება საგნების ინფორმაცია:[0m
|
||||
[38;2;117;113;94mსაგნის სახელი,[0m
|
||||
[38;2;117;113;94mსაგნის ზღვარი,[0m
|
||||
[38;2;117;113;94mშეფასების კომპონენტები(სახელი, ზღვარი , წონა).[0m
|
||||
[38;2;117;113;94m*/[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mview[0m[38;2;248;248;242m [0m[38;2;166;226;46msubject_info[0m
|
||||
[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;190;132;255ms[0m[38;2;248;248;242m.[0m[38;2;190;132;255mname[0m[38;2;248;248;242m, [0m[38;2;190;132;255ms[0m[38;2;248;248;242m.[0m[38;2;190;132;255mminimum_score[0m[38;2;248;248;242m subject_min_score, [0m[38;2;190;132;255mct[0m[38;2;248;248;242m.[0m[38;2;190;132;255mtype[0m[38;2;248;248;242m, [0m[38;2;190;132;255mc[0m[38;2;248;248;242m.[0m[38;2;190;132;255mminimum_score[0m[38;2;248;248;242m component_min_score, [0m[38;2;190;132;255mc[0m[38;2;248;248;242m.[0m[38;2;190;132;255mweight[0m
|
||||
[38;2;249;38;114mfrom[0m[38;2;248;248;242m subjects s,[0m
|
||||
[38;2;248;248;242mcomponent_types ct,[0m
|
||||
[38;2;248;248;242mcomponents c[0m
|
||||
[38;2;249;38;114mwhere[0m[38;2;248;248;242m [0m[38;2;190;132;255ms[0m[38;2;248;248;242m.[0m[38;2;190;132;255msubject_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mc[0m[38;2;248;248;242m.[0m[38;2;190;132;255msubject_id[0m[38;2;248;248;242m [0m
|
||||
[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;190;132;255mc[0m[38;2;248;248;242m.[0m[38;2;190;132;255mcomponent_type_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mct[0m[38;2;248;248;242m.[0m[38;2;190;132;255mcomponent_type_id[0m[38;2;248;248;242m;[0m
|
||||
|
||||
[38;2;117;113;94m/*[0m
|
||||
[38;2;117;113;94mშექმენით view დასწრების აღრიცხვა მონაწილეების მიხედვით:[0m
|
||||
[38;2;117;113;94mსტაჟირებაზე მიმართულების მიხედვით:[0m
|
||||
[38;2;117;113;94mრამდენი ჩატარდა,[0m
|
||||
[38;2;117;113;94mრამდენს დაესწრო,[0m
|
||||
[38;2;117;113;94mრამდენს არ დაესწრო.[0m
|
||||
[38;2;117;113;94m*/[0m
|
||||
[38;2;249;38;114mcreate[0m[38;2;248;248;242m [0m[38;2;249;38;114mview[0m[38;2;248;248;242m [0m[38;2;166;226;46mattendance_info[0m
|
||||
[38;2;249;38;114mas[0m[38;2;248;248;242m [0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mfirst_name[0m[38;2;248;248;242m, [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mlast_name[0m[38;2;248;248;242m, [0m
|
||||
[38;2;248;248;242m([0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;102;217;239mcount[0m[38;2;248;248;242m([0m[38;2;190;132;255ms2[0m[38;2;248;248;242m.[0m[38;2;190;132;255msession_id[0m[38;2;248;248;242m) [0m[38;2;249;38;114mfrom[0m[38;2;248;248;242m sessions s2 [0m[38;2;249;38;114mwhere[0m[38;2;248;248;242m [0m[38;2;190;132;255ms2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mdirection_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mdirection_id[0m[38;2;248;248;242m) lectures,[0m
|
||||
[38;2;248;248;242m([0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;102;217;239mcount[0m[38;2;248;248;242m([0m[38;2;190;132;255ma2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mattendance_id[0m[38;2;248;248;242m) [0m[38;2;249;38;114mfrom[0m[38;2;248;248;242m attendances a2 [0m[38;2;249;38;114mwhere[0m[38;2;248;248;242m [0m[38;2;190;132;255ma2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m[38;2;248;248;242m [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;190;132;255ma2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mstatus[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mPresent[0m[38;2;230;219;116m'[0m[38;2;248;248;242m) present,[0m
|
||||
[38;2;248;248;242m([0m[38;2;249;38;114mselect[0m[38;2;248;248;242m [0m[38;2;102;217;239mcount[0m[38;2;248;248;242m([0m[38;2;190;132;255ma2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mattendance_id[0m[38;2;248;248;242m) [0m[38;2;249;38;114mfrom[0m[38;2;248;248;242m attendances a2 [0m[38;2;249;38;114mwhere[0m[38;2;248;248;242m [0m[38;2;190;132;255ma2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m[38;2;248;248;242m [0m[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;190;132;255ma2[0m[38;2;248;248;242m.[0m[38;2;190;132;255mstatus[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;230;219;116m'[0m[38;2;230;219;116mAbsent[0m[38;2;230;219;116m'[0m[38;2;248;248;242m) absent[0m
|
||||
[38;2;249;38;114mfrom[0m[38;2;248;248;242m participants p,[0m
|
||||
[38;2;248;248;242mattendances a,[0m
|
||||
[38;2;248;248;242msessions s[0m
|
||||
[38;2;249;38;114mwhere[0m[38;2;248;248;242m [0m[38;2;190;132;255mp[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255ma[0m[38;2;248;248;242m.[0m[38;2;190;132;255mparticipant_id[0m
|
||||
[38;2;249;38;114mand[0m[38;2;248;248;242m [0m[38;2;190;132;255ma[0m[38;2;248;248;242m.[0m[38;2;190;132;255msession_id[0m[38;2;248;248;242m [0m[38;2;249;38;114m=[0m[38;2;248;248;242m [0m[38;2;190;132;255ms[0m[38;2;248;248;242m.[0m[38;2;190;132;255msession_id[0m[38;2;248;248;242m;[0m
|
266
tests/syntax-tests/source/SQL/ims.sql
Normal file
266
tests/syntax-tests/source/SQL/ims.sql
Normal file
@ -0,0 +1,266 @@
|
||||
-- interships
|
||||
create table interships
|
||||
(intership_id number(7) constraint intership_id_pk primary key,
|
||||
name varchar2(50),
|
||||
start_date date,
|
||||
end_date date);
|
||||
|
||||
|
||||
insert into interships
|
||||
values
|
||||
(1,
|
||||
'Leaderator 2019',
|
||||
to_date('15/02/2019', 'DD/MM/YYYY'),
|
||||
to_date('01/09/2019', 'DD/MM/YYYY'));
|
||||
|
||||
insert into interships
|
||||
(intership_id, name, start_date)
|
||||
values
|
||||
(2, 'Leaderator 2020', to_date('10/02/2019', 'DD/MM/YYYY'));
|
||||
|
||||
commit;
|
||||
|
||||
-- directions
|
||||
create table directions
|
||||
(direction_id number(7) constraint direction_id_pk primary key,
|
||||
name varchar2(50));
|
||||
|
||||
insert into directions values (1, 'Data Science');
|
||||
|
||||
insert into directions values (2, 'Oracle Development');
|
||||
|
||||
commit;
|
||||
|
||||
-- participants
|
||||
create table participants
|
||||
(participant_id number(7) constraint participant_id_pk primary key,
|
||||
first_name varchar2(25),
|
||||
last_name varchar2(25),
|
||||
personal_id number(11),
|
||||
intership_id number(7) constraint participant_inter_id_fk references interships (intership_id),
|
||||
direction_id number(7) constraint participant_direct_id_fk references directions (direction_id),
|
||||
constraint personal_id_unique unique (personal_id));
|
||||
|
||||
insert into participants
|
||||
values
|
||||
(1, 'Erekle', 'Tvinadze', 01011234567, 1, 1);
|
||||
|
||||
insert into participants
|
||||
values
|
||||
(2, 'Mariami', 'Chakhvadze', 01011234568, 2, 2);
|
||||
|
||||
commit;
|
||||
|
||||
-- hiring_layer_types
|
||||
create table hiring_layer_types
|
||||
(layer_type_id number(7) constraint layer_id_pk primary key,
|
||||
type varchar2(50));
|
||||
|
||||
insert into hiring_layer_types values (1, 'GMAT');
|
||||
|
||||
insert into hiring_layer_types values (2, 'Algorithms');
|
||||
|
||||
insert into hiring_layer_types values (3, 'Interview');
|
||||
|
||||
commit;
|
||||
|
||||
-- hiring_layers
|
||||
create table hiring_layers
|
||||
(layer_id number(7) constraint layer_pk primary key,
|
||||
layer_type_id number(7) constraint layer_type_fk references hiring_layer_types (layer_type_id),
|
||||
participant_id number(7) constraint participant_id_fk references participants (participant_id),
|
||||
result number(3));
|
||||
|
||||
insert into hiring_layers values (1, 1, 1, 52);
|
||||
|
||||
insert into hiring_layers values (2, 1, 2, 80);
|
||||
|
||||
insert into hiring_layers values (3, 2, 2, 75);
|
||||
|
||||
insert into hiring_layers values (4, 3, 2, 100);
|
||||
|
||||
commit;
|
||||
|
||||
-- subjects
|
||||
create table subjects
|
||||
(subject_id number(7) constraint subject_id_pk primary key,
|
||||
name varchar2(100),
|
||||
minimum_score number(3));
|
||||
|
||||
insert into subjects values (1, 'SQL', 70);
|
||||
|
||||
insert into subjects values (2, 'Machine Learning', 70);
|
||||
|
||||
commit;
|
||||
|
||||
-- direction_subjects
|
||||
create table direction_subjects
|
||||
(direction_subject_id number(7) constraint direct_sub_id primary key,
|
||||
direction_id number(7) constraint direct_id_fk references directions (direction_id),
|
||||
subject_id number(7) constraint subject_id_fk references subjects (subject_id));
|
||||
|
||||
insert into direction_subjects values (1, 2, 1);
|
||||
|
||||
insert into direction_subjects values (2, 1, 1);
|
||||
|
||||
insert into direction_subjects values (3, 1, 2);
|
||||
|
||||
commit;
|
||||
|
||||
-- component_types
|
||||
create table component_types
|
||||
(component_type_id number(7) constraint com_type_id_pk primary key,
|
||||
type varchar2(50));
|
||||
|
||||
insert into component_types values (1, 'Homework');
|
||||
|
||||
insert into component_types values (2, 'Quiz');
|
||||
|
||||
commit;
|
||||
|
||||
-- components
|
||||
create table components
|
||||
(component_id number(7) constraint component_id_pk primary key,
|
||||
subject_id number(7) constraint sub_id_fk references subjects (subject_id),
|
||||
minimum_score number(3),
|
||||
component_type_id number(7) constraint com_type_id_fk references component_types (component_type_id),
|
||||
weight number(3));
|
||||
|
||||
insert into components values (1, 1, 60, 1, 20);
|
||||
|
||||
insert into components values (2, 2, 65, 2, 50);
|
||||
|
||||
commit;
|
||||
|
||||
-- results
|
||||
create table results
|
||||
(result_id number(7) constraint result_id_pk primary key,
|
||||
issue_date date,
|
||||
grade number(3),
|
||||
participant_id number(7) constraint particip_id_fk references participants (participant_id),
|
||||
component_id number(7) constraint component_id_fk references components (component_id));
|
||||
|
||||
insert into results
|
||||
values
|
||||
(1, to_date('04/05/2020', 'DD/MM/YYYY'), 87, 2, 2);
|
||||
|
||||
commit;
|
||||
|
||||
-- learning_material_types
|
||||
create table learning_material_types
|
||||
(material_type_id number(7) constraint lear_material_id_pk primary key,
|
||||
type varchar(50));
|
||||
|
||||
insert into learning_material_types values (1, 'Book');
|
||||
|
||||
insert into learning_material_types values (2, 'PPT');
|
||||
|
||||
insert into learning_material_types values (3, 'Youtube Video');
|
||||
|
||||
commit;
|
||||
|
||||
-- learning_materials
|
||||
create table learning_materials
|
||||
(learning_material_id number(7),
|
||||
url varchar2(3000),
|
||||
subject_id number(7) constraint subj_id_fk references subjects (subject_id),
|
||||
material_type_id number(7) constraint material_type_id_fk references learning_material_types (material_type_id));
|
||||
|
||||
insert into learning_materials values (1, 'www.youtube.com', 1, 3);
|
||||
|
||||
commit;
|
||||
|
||||
-- sessions
|
||||
create table sessions
|
||||
(session_id number(7) constraint session_id_pk primary key,
|
||||
start_date date,
|
||||
end_date date,
|
||||
intership_id number(7) constraint inter_idd_fk references interships (intership_id),
|
||||
direction_id number(7) constraint direct_fk references directions (direction_id),
|
||||
subject_id number(7) constraint subject_fk references subjects (subject_id));
|
||||
|
||||
-- attendances
|
||||
create table attendances
|
||||
(attendance_id number(7) constraint attend_id_pk primary key,
|
||||
participant_id number(7) constraint participant_fk references participants (participant_id),
|
||||
session_id number(7) constraint session_id_fk references sessions (session_id),
|
||||
status varchar2(25));
|
||||
|
||||
|
||||
/*
|
||||
შექმენით view სადაც იქნება სტაჟირების შესახებ ინფორმაცია:
|
||||
სახელი,
|
||||
დაწყების თარიღი,
|
||||
დასრულების თარიღი,
|
||||
მონაწილეების რაოდენობა.
|
||||
*/
|
||||
create view intership_info
|
||||
as select i.name, i.start_date, i.end_date, (select count(participant_id) from participants p where p.intership_id = i.intership_id) number_of_participants
|
||||
from interships i;
|
||||
|
||||
/*
|
||||
შექმენით view სადაც იქნება მონაწილეებზე ინფორმაცია:
|
||||
სტაჟირების სახელი,
|
||||
მონაწილის სახელი,
|
||||
მიმართულება,
|
||||
შერჩევის რამდენი ეტაპი გაიარა,
|
||||
სტაჟირების სტატუსი(გაიარა, ვერ გაიარა, მიმდინარე,ვერ მოხვდა სტაჟირებაზე)
|
||||
*/
|
||||
create view participant_info
|
||||
as select i.name intership, p.first_name, p.last_name, d.name direction,
|
||||
(select count(h2.participant_id) from hiring_layers h2 where h2.participant_id = p.participant_id) number_of_layers,
|
||||
case when p.direction_id is null then 'Rejected'
|
||||
when i.end_date is null then 'Present'
|
||||
when (select h2.result from hiring_layers h2 join hiring_layer_types l on h2.layer_type_id = l.layer_type_id where h2.participant_id = p.participant_id and l.type = 'Intership') > (select minimum_score from subjects) then 'Passed'
|
||||
else 'Failed'
|
||||
end status
|
||||
from interships i,
|
||||
participants p,
|
||||
directions d
|
||||
where i.intership_id = p.intership_id
|
||||
and (d.direction_id = p.direction_id or p.direction_id is null);
|
||||
|
||||
/*
|
||||
შექნენით view სადაც იქნება მიმართულებებზე ინფორმაცია:
|
||||
მიმართულების სახელი,
|
||||
რა საგნები ისწავლება
|
||||
*/
|
||||
create view direction_info
|
||||
as select d.name direction, s.name subject
|
||||
from directions d,
|
||||
direction_subjects ds,
|
||||
subjects s
|
||||
where d.direction_id = ds.direction_id
|
||||
and ds.subject_id = s.subject_id;
|
||||
|
||||
/*
|
||||
შექმენით view სადც იქნება საგნების ინფორმაცია:
|
||||
საგნის სახელი,
|
||||
საგნის ზღვარი,
|
||||
შეფასების კომპონენტები(სახელი, ზღვარი , წონა).
|
||||
*/
|
||||
create view subject_info
|
||||
as select s.name, s.minimum_score subject_min_score, ct.type, c.minimum_score component_min_score, c.weight
|
||||
from subjects s,
|
||||
component_types ct,
|
||||
components c
|
||||
where s.subject_id = c.subject_id
|
||||
and c.component_type_id = ct.component_type_id;
|
||||
|
||||
/*
|
||||
შექმენით view დასწრების აღრიცხვა მონაწილეების მიხედვით:
|
||||
სტაჟირებაზე მიმართულების მიხედვით:
|
||||
რამდენი ჩატარდა,
|
||||
რამდენს დაესწრო,
|
||||
რამდენს არ დაესწრო.
|
||||
*/
|
||||
create view attendance_info
|
||||
as select p.first_name, p.last_name,
|
||||
(select count(s2.session_id) from sessions s2 where s2.direction_id = p.direction_id) lectures,
|
||||
(select count(a2.attendance_id) from attendances a2 where a2.participant_id = p.participant_id and a2.status = 'Present') present,
|
||||
(select count(a2.attendance_id) from attendances a2 where a2.participant_id = p.participant_id and a2.status = 'Absent') absent
|
||||
from participants p,
|
||||
attendances a,
|
||||
sessions s
|
||||
where p.participant_id = a.participant_id
|
||||
and a.session_id = s.session_id;
|
Loading…
Reference in New Issue
Block a user