RDBMS and HTML Mock Test 1546944945554
RDBMS and HTML Mock Test 1546944945554
Question-wise Details
Section #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 UPDATE TO
tio
ProductsInfo;
ca
ALTER TABLE RENAME Products TO
ProductsInfo; du
ALTER TABLE Products RENAME TO
ProductsInfo;
4E
Question 2:
ut
Which is the CORRECT DML statement to update the job band of all employees to NULL? Choose most appropriate option.
Shout4Education
2 / 18
Shout4Education
Consider table Product(productId, price). Identify the appropriate SQL statement to display all products whose price range is
2500 and 5000(exclusive 2500 and 5000). Choose two most appropriate options.
n
SELECT * FROM Product WHERE
price>=2500 AND price<=5000;
tio
SELECT * FROM Product WHERE
ca
price BETWEEN 2501 AND 4999;
Candidate responses were captured before updation of the question with restrictions on maximum responses.
du
4E
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.
o
Sh
Shout4Education
3 / 18
Shout4Education
Consider table Register(registerId VARCHAR2(10), dateOfRegistration DATE).
Note: There are no constraints added to any columns and table has no records. Which of the following SQL statements
executes successfully on Register table.
n
tio
ca
choose most appropriate option. du
Options Response Answer
only a
4E
only b
ut
both a and b
o
neither a nor b
Sh
Consider table Students(sid NUMBER(3), sname VARCHAR2(10), scontact NUMBER(10) ) is already created in the database.
It is required to change the data type of the column "scontact" to VARCHAR2(15). Which of the following is Correct for the
above requirement?
Shout4Education
4 / 18
Shout4Education
Options Response Answer
n
tio
Question 7: Time: 33 Sec
ca
Marks: 1/ 1
du
Identify the CORRECT statements with respect to constraints.
4E
only (i)
only (ii)
Shout4Education
5 / 18
Shout4Education
Consider table Product(pid, ptype). Identify the appropriate SQL statement to display the product type and count of products in
each product type only if there are more than two products. Choose most appropriate option.
n
SELECT ptype, COUNT(pid) FROM
tio
Product HAVING COUNT(pid)>2
GROUP BY ptype;
ca
du
Question 9: Time: 1 Min 48 Sec Marks: 1/ 1
4E
Consider table Employee(EmpId, EmpName,salary,deptNo). Which is the CORRECT SQL statement to list employees whose
salary is more than their department's average salary? The result should be in ascending order of department number. Choose
ut
Shout4Education
6 / 18
Shout4Education
Options Response Answer
n
e1.salary,e1.deptNo FROM employee
tio
e1 WHERE avg(e1.salary) > (SELECT
e2.salary FROM employee e2 WHERE
ca
e2.deptNo = e1.deptNo) ORDER BY
e1.deptNo; du
SELECT e1.empId, e1.empName,
e1.salary,e1.deptNo FROM employee
e1 WHERE e1.salary > (SELECT
4E
Consider the below tables are created and has some records. Account(accountId,accountType,balance)
Transaction(transactionId,accountId,transactionType,amount)
AccountId in transaction table is a foreign key referring to accountId of account table. Which is the CORRECT SQL statement to
retrieve accountId and accountType for which more than three transactions are recorded?
Shout4Education
7 / 18
Shout4Education
Options Response Answer
SELECT accountId,accountType
FROM account WHERE accountid IN(
SELECT COUNT(transactionid) FROM
transaction GROUP BY accountid
HAVING COUNT(transactionid)>3);
SELECT accountId,accountType
FROM account WHERE accountid IN(
SELECT accountid FROM transaction
GROUP BY accountid HAVING
COUNT(transactionid)>3);
SELECT accountId,accountType
FROM account WHERE accountid IN(
n
SELECT accountid FROM transaction
tio
WHERE COUNT(transactionid)>3
GROUP BY accountid );
ca
SELECT accountId,accountType
FROM account GROUP BY accountId
du
HAVING COUNT(accountId)=(
SELECT COUNT(accountid)FROM
transaction GROUP BY accountid
4E
HAVING COUNT(transactionid)>3);
ut
Marks: 0/ 1
Sh
Shout4Education
8 / 18
Shout4Education
Consider the tables given below.
Customer(customerId,customerName)
Book(bookId, bookName)
bookId and customerId in purchase table are foreign keys referring to Book and Customer tables respectively. Which is the
CORRECT SQL statement to retrieve customer name and book name for all books purchased by customers?
n
tio
Choose most appropriate option.
ca
SELECT
c.customerName,b.bookName FROM
du
customer c INNER JOIN purchase p
ON c.customerId=p.customerId SELF
4E
SELECT
ut
c.customerName,b.bookName FROM
customer c INNER JOIN purchase p
o
c.customerId=p.customerId;
SELECT
c.customerName,b.bookName FROM
customer c INNER JOIN purchase p
ON c.customerId=p.customerId INNER
JOIN book b ON b.bookid=p.bookid;
SELECT
c.customerName,b.bookName FROM
customer c INNER JOIN purchase p
ON c.customerId=p.customerId;
Shout4Education
9 / 18
Shout4Education
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.
n
runs_scored>( SELECT
tio
AVG(runs_scored) FROM player);
ca
p1.runs_scored FROM player p1
WHERE p1.runs_scored>( SELECT
p2.runs_scored FROM player p2
du
GROUP BY p2.playergroup HAVING
p2.runs_scored>AVG(p2.runs_scored))
4E
WHERE
p1.playergroup=p2.playergroup);
Shout4Education
10 / 18
Shout4Education
Which of the following is/are the inline html elements?
(i) <i>
(ii) <h6>
(iii) <a>
n
Choose most appropriate option.
tio
Options Response Answer
ca
(i) and (iii)
a) Element Selector
b) Form Selector
c) Class Selector
Shout4Education
11 / 18
Shout4Education
Options Response Answer
a and b
a and c
b and c
a, b and c
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
Shout4Education
12 / 18
Shout4Education
Refer the incomplete HTML Code given below
1 <html>
2 <body>
3 <form action="abc.html" _____> <!--Line1-->
4 First Name: <input type="text" name="f1"/>
5 <br/>
6 Last Name: <input type="text" name="l1"/>
7 <br/>
8 Password: <input type="password" name="p1"/>
9 <br/>
10 <input type="submit" value="Submit"/> </form>
11 </body>
12 </html>
13
n
tio
ca
Assume abc.html is existing and a valid HTML page. Identify the appropriate option to be placed at Line1 so that values entered
in the text boxes are not appended to URL while submitting to abc.html . Choose most appropriate option.
du
Options Response Answer
4E
method="GET"
ut
method="POST"
submit="GET"
o
Sh
submit="POST"
Shout4Education
13 / 18
Shout4Education
What would be the Output of the below java script Code?
1 <html>
2 <body>
3 <script>
4 var x = 5;
5 var d = (x != "5");
6 document.write(d +"--");
7 d = (x === "5");
8 document.write(d);
9 </script>
10 </body>
11 </html>
12
tio
ca
Choose most appropriate option.
du
Options Response Answer
false--false
4E
false--true
ut
true--false
true--true
o
Sh
Shout4Education
14 / 18
Shout4Education
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>
13 </head>
14 <body>
15 </body>
16 </html>
n
17
tio
ca
du
Choose most appropriate option.
4E
100
200
o
Sh
210
110
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