Professional Documents
Culture Documents
HTML/JS/RDBMS/SQL
1) Which of the following is correct way to declare variable
x=10
var x=10
2) Consider a table named Employee with columns EmployeeId, EmployeeName
and DepartmentCode. Display EmployeeId and EmployeeName of
department 10 or 20.
SELECT EmployeeId, EmployeeName FROM Employee WHERE
DepartmentCode=10 OR DepartmentCode=20;
SELECT EmployeeId, EmployeeName FROM Employee IN (10,20);
3) Consider the following Code:
<table>
<tr> <th colspan=3> Employee Details </th> </tr>
<tr> <th> Employee Name</th> <th> Details
</th></tr>
<tr> <td> Jack </td> <td> LKM </td> </tr>
<tr> <td> Ace </td> <td rowspan=2> Delivery</td>
</tr>
<tr> <td> Justin </td> </tr>
</table>
How many cells are present in the table?
8
4) Consider two tables. Account (AccNo [Primary key], AccOpenDate, Balance)
and Transaction(TranId[Primary key], AccNo[Foreign key], TranDate,
TranAmount, TranType).
Display values with transaction Not after 31st December,2016.
SELECT * FROM Account WHERE AccNo NOT IN (SELECT AccNo FROM
Transaction Where TranDate>31/12/2016 );
5) Consider a table which has a constraint COMPOSITE PRIMARY KEY. Choose the
correct syntax to assign the constraint.
CREATE TABLE table_name (column1, column2,, CONSTRAINT CR_PKEY
PRIMARY KEY(column1,column2));
*composite primary key Constraint declaration should always be at
the end*
6) Consider two tables Employee(EmpNo, EmpName, Salary, DeptCode) and
Department(DeptCode, DeptName). Display Employee Name and Department
Name.
SELECT e.EmpName, d.DeptName FROM Employee e INNER JOIN
Department d ON e.DeptCode=d.DeptCode;
11)
Choose the true statement(s):
(i)
Checkbox can multiselect options.
(ii)
Get method is default form of Submission method.
Both (i) and (ii)
12)
(i)
(ii)
14)
To only delete all rows from table EMP, which of the following
statement(s) are to be used?
(i)
DROP TABLE EMP
(ii)
DELETE TABLE EMP
(iii) TRUNCATE TABLE EMP
Only (ii) and (iii)
15)
What is the correct syntax to call an external CSS file?
<link rel=stylesheet type=text/css href=MyFile.css>
16)
What is the correct syntax to add a column to existing table?
ALTER TABLE table_name ADD column_name datatype;
17)
Consider table Student(StudentId, Name, Email, UniversityCode) of
which StudentId is a primary key of the table Student, Name column has a
NOT Null constraint, Email is a unique key and UniversityCode is a foreign key
to an already existing table University. Which of these columns will accept
Null values?
Email and UniversityCode
18)
Display a name from table Emp having only 3 letters starting from A
and ending in e.
SELECT Name FROM Emp LIKE A_e;
19)
Which is a correct ALERT statement?
alert(This is an Alert);
20)
Consider a table Emp with attributes as EmpNo, EmpName, Salary and
DeptCode. Display Average of salary of each department.