RDBMS and HTML Mock Test - 1549089885404
RDBMS and HTML Mock Test - 1549089885404
Question-wise Details
Section #1
Consider the table Employee(empId,empName,jobBand). Which is the CORRECT SQL statement to retrieve all UNIQUE
jobBand from Employee table ? Choose most appropriate option.
n
SELECT DISTINCT jobBand,empId
tio
from Employee;
ca
SELECT DISTINCT(jobBand) from
Employee; du
SELECT DISTINCT jobBand from
Employee;
4E
Question 2:
ut
Consider table Department(deptId,deptName). Which of the following query is used to display the department details whose
Sh
deptname has second letter as 'a' and second last letter as 'e'? Choose most appropriate option.
Shout4Education
2 / 18
Shout4Education
Question 3: Time: 48 Sec Marks: 0/ 1
Consider the table Products(pid,pname,pcost). Identify the appropriate SQL statement to rename the table to ProductsInfo .
Choose most appropriate option.
n
ALTER TABLE Products RENAME TO
tio
ProductsInfo;
ca
Question 4:
du Time: 47 Sec Marks: 0/ 1
4E
Which is the CORRECT DML statement to update the job band of all employees to NULL? Choose most appropriate option.
o
Shout4Education
3 / 18
Shout4Education
Identify the CORRECT statements with respect to constraints.
only (i)
only (ii)
n
tio
both (i) and (ii)
ca
du
Question 6: Time: 35 Sec Marks: 1/ 1
4E
o
Sh
(c) A TABLE can have more than one PRIMARY KEY column
(d) FOREIGN KEY column can refer to PRIMARY KEY column of same table only
a and b
a and d
b and c
a, b and d
Consider the table Project(ProjectId, ProjectName, ProjectType) is created without any constraint and has the records as per
n
the attachment.
tio
ca
du
4E
o ut
Sh
Identify the ALTER statement which executes successfully on project table. Choose most appropriate option.
Shout4Education
5 / 18
Shout4Education
Options Response Answer
n
CHECK(ProjectType IN('A1','A2'));
tio
ca
Question 8: du Time: 1 Min 28 Sec Marks: 0/ 1
Consider table Students(studentId, branchid). Identify the CORRECT SQL statement to retrieve the branches which has more
than 3 students. Choose most appropriate option.
4E
branchid;
Sh
Shout4Education
6 / 18
Shout4Education
Consider the table Account (accid, balance, accountType). The following constraints to be enforced.
2. Account type should be 'C' or 'S'. Balance should be greater than 1000 and 3000 for account type 'C' and 'S' respectively
Identify the CORRECT SQL statement to create the Account table with the above mentioned constraints. Choose most
appropriate option.
n
tio
ca
du
4E
o ut
Sh
Shout4Education
7 / 18
Shout4Education
Options Response Answer
n
CHECK(balance>1000 OR balance
>3000), accountType CHAR
tio
CONSTRAINT acc_chk CHECK
(accountType='S' OR accounTtype='C')
ca
);
Shout4Education
8 / 18
Shout4Education
You are suppose to create a table "ExamResult" with the following description. studentId NUMBER(4), courseId
VARCHAR2(10), mark NUMBER(3) There should not be duplicate combination of studentId and courseId in any record. Identify
the correct DDL statement to create ExamResult table. Choose the most apprpriate option.
n
PRIMARY KEY, mark NUMBER(3));
tio
CREATE TABLE ExamResult(
(studentId NUMBER(4), courseId
ca
VARCHAR2(10) ) CONSTRAINT er_pk
PRIMARY KEY), mark NUMBER(3));
du
CREATE TABLE ExamResult(
studentId NUMBER(4), courseId
4E
Consider table player(playerid, playername, runs_scored, playergroup). Identify the CORRECT SQL statement to retrieve the
details of players who have scored runs which is greater than the average of runs scored by all players in his player group.
Choose most appropriate option.
Shout4Education
9 / 18
Shout4Education
Options Response Answer
n
WHERE p1.runs_scored>( SELECT
tio
p2.runs_scored FROM player p2
GROUP BY p2.playergroup HAVING
ca
p2.runs_scored>AVG(p2.runs_scored))
; du
SELECT p1.playerid, p1.playername,
p1.runs_scored FROM player p1
WHERE p1.runs_scored>( SELECT
4E
Shout4Education
10 / 18
Shout4Education
Consider the Tables given below:
Product(productId,productName)
ProductOrder(orderId,productId,quantity)
productId column of ProductOrder is a Foreign key reffering to Product Table. Identify the appropriate SQL statement which will
fetch the ProductId,ProductName,OrderId for all the Product ordered and display 'Yet to be Ordered' if a product has not been
ordered till now.
n
tio
Options Response Answer
SELECT
ca
p1.productId,p1.productName,NVL(p2.
orderId,'Yet to be Ordered') FROM
Product p1 INNER JOIN ProductOrder
du
p2 ON p1.productId=p2.productId;
SELECT
4E
p1.productId,p1.productName,NVL(p2.
orderId,'Yet to be Ordered') FROM
ut
p1.productId=p2.productId;
Sh
SELECT
p1.productId,p1.productName,NVL(p2.
orderId,'Yet to be Ordered') FROM
Product p1 RIGHT OUTER JOIN
ProductOrder p2 ON
p1.productId=p2.productId;
SELECT
p1.productId,p1.productName,NVL('Yet
to be Ordered',p2.orderId) FROM
Product p1 LEFT OUTER JOIN
ProductOrder p2 ON
p1.productId=p2.productId;
Shout4Education
11 / 18
Shout4Education
Question 13: Time: 18 Sec Marks: 1/ 1
1 <!DOCTYPE html>
2 <html>
3 <body>
4 <script>
5 var x = (3 + 3) + 4 + "6";
6 alert(x); //line 1
7 </script>
8 </body>
9 </html>
10
n
tio
What will be printed in alert box in line 1? Choose most appropriate option.
ca
Options Response du Answer
3346
646
4E
106
ut
16
o
Sh
1 <html>
2 <head>
3 <script>
4 var data=10;
5 document.write(typeof(data));
6 </script>
7 </head>
8 </html>
9
Shout4Education
12 / 18
Shout4Education
Options Response Answer
int
number
integer
numberType
Which of the following is the correct html form element to create the checkbox in a web page? Choose most appropriate option.
n
Options Response Answer
tio
<checkbox>
ca
<input=checkbox> du
<input type="checkbox">
<input checkbox>
4E
ut
Which is the correct CSS code to display the text "Accenture" in light grey back ground? Choose most appropriate option.
Sh
<h2 background-color :
lightgrey>Accenture</h2>
Shout4Education
13 / 18
Shout4Education
Question 17: Time: 2 Min 4 Sec Marks: 0/ 1
What would be the output of the java script code given below?
1 <html>
2 <head>
3 <script>
4 var data1=100;
5 function test()
6 {
7 var data1=200;
8 window.data1=data1+10;
9 }
10 test();
11 document.write(data1);
12 </script>
n
13 </head>
14 <body>
tio
15 </body>
16 </html>
17
ca
du
4E
100
Sh
200
210
110
Shout4Education
14 / 18
Shout4Education
Which of the following are CSS selectors?
n
tio
(i) and (iii) only
ca
du
Question 19: Time: 19 Sec Marks: 1/ 1
4E
o ut
Sh
Shout4Education
15 / 18
Shout4Education
Refer the HTML code given below.
1 <html>
2 <body>
3 <table border="1">
4 <tr>
5 <th>A</th>
6 <th colspan="2">B</th>
7 </tr>
8 <tr>
9 <th rowspan="3">C</th>
10 <th>D</th>
11 <th>E</th>
12 </tr>
13 <tr>
14 <th>A</th>
15 <th>B</th>
16 </tr>
n
17 <tr>
18 <th>D</th>
tio
19 <th>E</th>
20 </tr>
21 </table>
22 </body>
ca
23 </html>
24 du
4E
ut
How many cells will be displayed when the page is displayed on the browser? Choose most appropriate option.
o
11
10
Shout4Education
16 / 18
Shout4Education
Refer the HTMLcode given below.
1 <html> <body>
2 <table border="1">
3 <tr><th>A</th>
4 <th colspan="2">B</th>
5 </tr>
6 <tr> <th rowspan="3">C</th>
7 <th>D</th>
8 <th>E</th>
9 </tr>
10 <tr>
11 <th>A</th>
12 <th rowspan="2">B</th>
13 </tr>
14 <tr>
n
15 <th>D</th>
16 </tr>
tio
17 </table>
18 </body>
19 </html>
20
ca
du
4E
ut
How many cells will be displayed when the page is displayed on the browser? Choose most appropriate option.
o
Sh
10
Shout4Education
17 / 18
Shout4Education
n
tio
ca
du
4E
ut
o
Sh
Shout4Education
18 / 18