Fakultet elektrotehnike, strojarstva i brodogradnje BAZE PODATAKA 2Također koristeći alias za tablicu NASTAVNIK koja je u dvostrukoj vezi sa tablicomNASTAVNI_PLAN napisati SELECT naredbu (za obraz. program 450 i šk. godinu 2008/09) kojadaje ovakav rezultat:……DODATAK 1:Using CONVERT:CONVERT ( data_type [ ( length ) ] , expression [ , style ] )Arguments:expressionIs any valid Microsoft® <strong>SQL</strong> <strong>Server</strong> expression.data_typeIs the target system-supplied data type.lengthIs an optional parameter of nchar, nvarchar, char, varchar, binary, or varbinary data types.styleIs the style of date format used to convert datetime or smalldatetime data to character data (nchar, nvarchar,char, varchar, nchar, or nvarchar data types), or the string format when converting float, real, money, orsmallmoney data to character data (nchar, nvarchar, char, varchar, nchar, or nvarchar data types).<strong>SQL</strong> <strong>Server</strong> supports the date format in Arabic style, using Kuwaiti algorithm.In the table, the two columns on the left represent the style values for datetime or smalldatetime conversion tocharacter data.Add 100 to a style value to get a four-place year that includes the century (yyyy).Without century (yy) With century (yyyy) Standard Input/Output- 0 or 100 (*) Default mon dd yyyy hh:miAM (orPM)1 101 USA mm/dd/yy2 102 ANSI yy.mm.dd3 103 British/French dd/mm/yy4 104 German dd.mm.yy5 105 Italian dd-mm-yy6 106 - dd mon yy.........622.11.2010
Fakultet elektrotehnike, strojarstva i brodogradnje BAZE PODATAKA 2DODATAK 2: Model baze podataka:Rješenja:1.a.select mjesto_id, ime_mjestafrom mjestowhere post_br IS NULL1.b.select ime + ', ' + ime_oca + ', '+ prezime as 'Ime, ime oca, prezime' ,CONVERT(varchar(10),dat_upisa, 104) as 'Upisan', matbr as 'Mat. broj'from student1.c.select ime + ', ' + ime_oca + ', ' + prezime, convert(varchar(10),dat_upisa,104), matbrfrom student1.d.select * from predmetwhere left(ime_predmeta,13) = 'programiranje'1.e.select * from predmetwhere not exists (select * from nastavni_planwhere nastavni_plan.predmet_id = predmet.predmet_id)722.11.2010