Que# Question Text Correct Answer: English

You might also like

Download as pdf or txt
Download as pdf or txt
You are on page 1of 6

English

Que# Question Text Correct Answer


Identify the SQL query to add a new column as mobile in the table called alter table Employee add
1 Employee mobile int;
What is the output of below query<br> deletes the "City" column
from the "XploreNew"
2 ALTER TABLE XploreNew DROP COLUMN CITY; table:
You attempt to execute the following SQL statement:<br>
CREATE TABLE PRODUCT(PRODUCT_ID NUMBER,PRODUCT_NAME
VARCHAR2,STATUS CHAR)<br> The execution succeeds,
3 Which one of the following is true? and the table is created.

Which statement is used to delete all rows in a table without having the action
4 logged? TRUNCATE

Identify the correct SQL query to create an "employee" table having 2 fields : 'id'
and 'name' with following constraints/features : <br> CREATE TABLE employee
- 'id' is integer, primary key and should support automatically generated (id INTEGER
sequential values if user does not supply input for this during data insertion. <br> auto_increment, name
- 'name' is varchar(50) and should not allow duplicate values for different VARCHAR(50) UNIQUE
employees.<br> NOT NULL, PRIMARY
5 Also, it should not allow NULL values. KEY(id));

Page 1
English

update Employee set


designation='AST',location
Identify the sql query to update the designation as 'AST' and location as 'Chennai' ='Chennai' where
6 when salary >60000; salary>60000;
You want to delete all records from a particular table. Select the most appropriate
7 statement you need to use. TRUNCATE,DELETE
delete from Doctor where
8 Identify the SQL query to remove a row in Doctor table whose name is David name='David'
The below query when executed will throw error. True or False<br><br>
INSERT ALL<br>
INTO employee (empid,empname,salary,did) VALUES
(4444,'ramu',30000,201)<br>
INTO department VALUES(801,'Diploma')<br>
9 SELECT * FROM dual;<br> FALSE

Page 2
English

Consider the below table;<br><br>

Customers<br>
--------<br>

CustIdNameCityState <br>
10001Arun <br>
10002ResmiChennaiTN <br>
10003ShajuKochiKerala <br>
10004Kiran <br>
10005AjayTrivandrumKerala <br>
10006Naveen <br>
10007AnitaTrivandrumKerala<br><br> UPDATE Customers SET
city='Chennai' and
Identify the SQL query to update all customers whose city and state is empty as state='TN' WHERE city IS
10 'Chennai' and 'TN' respectively. NULL AND state IS NULL
SELECT * FROM hospital
Identify the correct SQL query to select all wards from hospital table where
WHERE population
population is in the range of 100 to 200.
11 BETWEEN 100 AND 200;
SELECT * FROM student
A student table has 3 columns : rollno, name and marks. Identify the correct SQL WHERE name LIKE 'S%'
query to select all students whose name start with 'S'. The data should be sorted ORDER BY name DESC ;
12 in descending order of name.

Page 3
English

A teacher table has 3 columns : teacher_id, teacher_name and department.


Identify the correct SQL query to get the number of unique departments from SELECT COUNT(DISTINCT d
13 teacher table. epartment) FROM teacher;
SELECT
sum(salary),dept_id from
An employee table has 4 columns : id, name, salary and dept_id. Identify the employee GROUP BY
14 correct SQL query to list the total salaries of employees of each dept_id dept_id;

Page 4
English

Consider the two tables below. Identify the SQL query to retrieve all types that were part of
Aurelia brand<br/>
Items Table<br/>
<pre>
IdType Brand<br/>
---------------------------------------<br/>
1Kurtas 2 <br/>
2Kur s1 <br/>
3Dupa as 3 <br/>
4Stals3 <br/>
5Shawls4 <br/>
6Pants4 <br/>
<pre>

BrandNew Table<br/>
<pre>
IdName <br/>
-----------------------<br/>
SELECT Items.Type FROM
1W <br/>
2Biba <br/>
Items JOIN BrandNew ON
3Aurelia <br/> Items.Brand =
4 Zara <br/> BrandNew.ID WHERE
15 <pre> Items.BRAND=3;

Page 5
English

A college wants a database to keep track of the students and their enrollment to
different courses. A student might enroll to many courses and one course might
be enrolled by many students. The enrollment date is also recorded. How many
tables do you need to create to store the data provided your tables are in 3rd
16 Normal Form? 3
17 Which of these is not an advantage of Normalization None of these
18 SQL Server has mainly how many types of views? two
19 Which column attribute provides unique numbers for identification? AUTO_INCREMENT
The value of recently generated sequence number can be obtained by
20 ____________ LAST_INSERT_ID()

Page 6

You might also like