GATE 2004 Computer Science and Information Technology (CS) Questions with Solutions

GATE 2004

199 questions

MCQ 1991-mark 199

Questions 146–150 of 199

Q146File Systems1 markMCQ−0.33 if wrong
A unix-style I-node has 10 direct pointers and one single, one double and one triple indirect pointers. Disk block size is 1 Kbyte, disk block address is 32 bits, and 48-bit integers are used. What is the maximum possible file size?

Q147File Systems1 markMCQ−0.33 if wrong
Which of the following commands or sequences of commands will rename a file x to file y in a Unix system ?
I. mv y, x
II. mv x, y
III. cp y, x (rm x)
IV. cp x, y (rm x)

Q148Relational Algebra1 markMCQ−0.33 if wrong
Consider the relation Student (name‾\underline{name}, sex, marks), where the primary key is shown underlined, pertaining to students in a class that has at least one boy and one girl. What does the following relational algebra expression produce? (Note: ρ\rho is the rename operator).
πname{σsex=female(Student)}−πname(Student⋈(sex=female∧x=male∧marks≤m) ρn,x,m(Student))\pi_{name}\{\sigma_{sex=female}(\text{Student})\} - \pi_{name}(\text{Student} \bowtie_{(sex=female \wedge x=male \wedge marks \leq m)}\ \rho_{n,x,m}(\text{Student}))

Q149Relational Algebra1 markMCQ−0.33 if wrong
Let R1(A‾\underline{A},B,(C)) and R2(D‾\underline{D},E) be two relation schema, where the primary keys are shown underlined, and let C be a foreign key in R1 referring to R2 . Suppose there is no violation of the above referential integrity constraint in the corresponding relation instances r1 and r2 . Which one of the following relational algebra expressions would necessarily produce an empty relation?

Q150SQL1 markMCQ−0.33 if wrong
Consider two tables in a relational database with columns and rows as follows:

Roll_noNameDept_id1ABC12DEF13GHI24JKL3Table: StudentDept_idDept_name1A2B3CTable: Department\overset{\text{Table: Student}}{\begin{array}{|c|c|c|} \hline \textbf {Roll\_no} & \textbf{Name} & \textbf{Dept\_id} \\\hline 1& \text{ABC} & 1\\\hline 2& \text{DEF} & 1 \\\hline 3 & \text{GHI} & 2\\\hline 4 & \text{JKL} & 3\\\hline \end{array}} \qquad \overset{\text{Table: Department}}{\begin{array}{|c|c|c|} \hline \textbf {Dept\_id} & \textbf{Dept\_name} \\\hline 1& \text{A} \\\hline 2& \text{B} \\\hline 3 & \text{C} \\\hline \end{array}}

Roll_no is the primary key of the Student table, Dept_id is the primary key of the Department table and Student.Dept_id is a foreign key from Department.Dept_id

What will happen if we try to execute the following two SQL statements?
update Student set Dept_id = Null where Roll_on = 1
update Department set Dept_id = Null where Dept_id = 1