RDBMS and HTML Mock Test - 1549084911357
RDBMS and HTML Mock Test - 1549084911357
RDBMS and HTML Mock Test - 1549084911357
Question-wise Details
Section #1
n
tio
B1 JAVA 0
B2 4
ca
du
B3 ORACLE 2
4E
ut
Shout4Education
2 / 21
Shout4Education
Options Response Answer
Consider the table Products(pid,pname,pcost). Identify the appropriate SQL statement to rename the table to ProductsInfo .
n
Choose most appropriate option.
tio
Options Response Answer
ca
ALTER TABLE Products RENAME
ProductsInfo; du
ALTER TABLE Products UPDATE TO
ProductsInfo;
4E
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.
Shout4Education
3 / 21
Shout4Education
Options Response Answer
Candidate responses were captured before updation of the question with restrictions on maximum responses.
n
tio
Question 4: Time: 16 Sec Marks: 1/ 1
ca
Consider table Department(deptId,deptName). Which of the following query is used to display the department details whose
deptname has second letter as 'a' and second last letter as 'e'? Choose most appropriate option.
du
Options Response Answer
4E
Consider table Account(accId, acctype, balance). Identify the appropriate SQL statement to display account details in the
ascending order of balance and in the descending order of accId if the balance is same. choose most appropriate option.
Shout4Education
4 / 21
Shout4Education
Options Response Answer
n
Question 6: Time: 49 Sec Marks: 1/ 1
tio
Consider table Students(sid NUMBER(3), sname VARCHAR2(10), scontact NUMBER(10) ) is already created in the database.
ca
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?
du
Note: sid column is primary key.
4E
Shout4Education
5 / 21
Shout4Education
Question 7: Time: 18 Sec Marks: 1/ 1
n
only (i)
tio
only (ii)
ca
both (i) and (ii)
Consider table Item(itemId, category, unitprice). Identify the appropriate SQL statement to display the category and count of
items in each category in the ascending order of item count. It should display the item details only if the count of item is greater
o
than 1.
Sh
Shout4Education
6 / 21
Shout4Education
Options Response Answer
n
SELECT category,count(itemId) FROM
tio
item GROUP BY category HAVING
Count(itemId)>1 ORDER BY itemId;
ca
du
Question 9: Time: 11 Sec Marks: 1/ 1
4E
Product(productId,productName)
o
Sh
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.
Shout4Education
7 / 21
Shout4Education
Options Response Answer
SELECT
p1.productId,p1.productName,NVL(p2.
orderId,'Yet to be Ordered') FROM
Product p1 INNER JOIN ProductOrder
p2 ON p1.productId=p2.productId;
SELECT
p1.productId,p1.productName,NVL(p2.
orderId,'Yet to be Ordered') FROM
Product p1 LEFT OUTER JOIN
ProductOrder p2 ON
p1.productId=p2.productId;
SELECT
n
p1.productId,p1.productName,NVL(p2.
tio
orderId,'Yet to be Ordered') FROM
Product p1 RIGHT OUTER JOIN
ca
ProductOrder p2 ON
p1.productId=p2.productId; du
SELECT
p1.productId,p1.productName,NVL('Yet
to be Ordered',p2.orderId) FROM
4E
Shout4Education
8 / 21
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 / 21
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
10 / 21
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
11 / 21
Shout4Education
Consider the below tables.
Which is the CORRECT SQL statement to retrieve customerId, customerName, accountId and balance for all customers. It
should also display the details of the customers who are not having any account.
n
tio
Options Response Answer
SELECT
ca
c.customerId,c.customerName,a.accou
ntId,a.balance FROM customer c
RIGHT OUTER JOIN account a ON
du
c.customerId=a.customerId;
SELECT
4E
c.customerId,c.customerName,a.accou
ntId,a.balance FROM account a LEFT
ut
SELECT
Sh
c.customerId,c.customerName,a.accou
ntId,a.balance FROM customer c
INNER JOIN account a ON
c.customerId=a.customerId;
SELECT
c.customerId,c.customerName,a.accou
ntId,a.balance FROM account a RIGHT
OUTER JOIN customer c ON
c.customerId=a.customerId;
Shout4Education
12 / 21
Shout4Education
Which of the following are the CSS selectors?
a) Element Selector
b) Form Selector
c) Class Selector
n
a and b
tio
a and c
ca
b and c
a, b and c
du
4E
Identify the appropriate HTML code to Use the Style given Above. Choose most appropriate option.
Shout4Education
13 / 21
Shout4Education
Options Response Answer
<h1 id="myclass">Welcome to My
Homepage</h1>
<h1 style="myclass">Welcome to My
Homepage</h1>
n
tio
<h1 class="myclass">Welcome to My
ca
Homepage</h1>
du
<h1 class=".myclass">Welcome to My
4E
Homepage</h1>
o ut
Sh
Shout4Education
14 / 21
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)
Shout4Education
15 / 21
Shout4Education
What would be displayed in alert box while executing the below code?
1 <html>
2 <head>
3 <script>
4 var data1=100;
5 var data2="100";
6 if(data1==data2)
7 { // Line - X
8 alert(data1+data2);
9 }
10 else
11 {
12 alert("not equal");
13 }
14 </script>
15 </head>
16 <body>
n
17 </body>
18 </html>
tio
19
ca
du
Choose most appropriate option.
4E
100100
o
200
Sh
not equal
Shout4Education
16 / 21
Shout4Education
Which of the following are CORRECT statement?
n
Choose most appropriate option.
tio
Options Response Answer
ca
a and c
only a
du
b and c
4E
a and b
ut
Shout4Education
17 / 21
Shout4Education
What would be the color of the text "Bengaluru" and "India" while executing the below html and css code? Assume that "Black"
is the default color if there is no style applied.
<html>
<head>
n
tio
</head>
ca
<body>
du
<p> Bengaluru </p>
4E
</body>
o
Sh
</html>
Shout4Education
18 / 21
Shout4Education
Options Response Answer
Condsider the javascript code given below. What would be the print values from line 1 and line 2 on execution?
n
tio
1 <html>
ca
2 <body>
3 <p id="id1"></p><!-- line 1-->
4 <p id="id2"></p><!-- line 2-->
5 <script>
du
6 var y=10;
7 myFunction();
8 document.getElementById("id1").innerHTML = y;
4E
9 document.getElementById("id2").innerHTML = window.y;
10 function myFunction()
11 {
12 y=20;
13 y=y+window.y
ut
14 }
15 </script>
16 </body>
o
17 </html>
Sh
18
Shout4Education
19 / 21
Shout4Education
Options Response Answer
10 30
10 40
10 10
40 40
n
tio
ca
1 <html> <body>
2 <table border="1">
3 <tr><th>A</th>
du
4 <th colspan="2">B</th>
5 </tr>
6 <tr> <th rowspan="3">C</th>
7 <th>D</th>
4E
8 <th>E</th>
9 </tr>
10 <tr>
11 <th>A</th>
ut
12 <th rowspan="2">B</th>
13 </tr>
14 <tr>
o
15 <th>D</th>
16 </tr>
Sh
17 </table>
18 </body>
19 </html>
20
How many cells will be displayed when the page is displayed on the browser? Choose most appropriate option.
Shout4Education
20 / 21
Shout4Education
Options Response Answer
10
n
tio
ca
du
4E
ut
o
Sh
Shout4Education
21 / 21