Archive Pages Design$type=blogging

MCQ of Structured Query Language(SQL) With Answer Set -2

1. Which of the following query is correct for using comparison operators in SQL ? A) SELECT sname, coursename FROM studentinfo WHERE age...


1. Which of the following query is correct for using comparison operators in SQL?

A) SELECT sname, coursename FROM studentinfo WHERE age>50 and <80;

B) SELECT sname, coursename FROM studentinfo WHERE age>50 and age <80;

C) SELECT sname, coursename FROM studentinfo WHERE age>50 and WHERE age<80;

D) None of the above



2.How to select all data from studentinfo table starting the name from letter 'r'?

A) SELECT * FROM studentinfo WHERE sname LIKE 'r%';

B) SELECT * FROM studentinfo WHERE sname LIKE '%r%';

C) SELECT * FROM studentinfo WHERE sname LIKE '%r';

D) SELECT * FROM studentinfo WHERE sname LIKE '_r%';



3. Which of the following SQL query is correct for selecting the name of staffs from 'tblstaff' table where salary is 15,000 or 25,000?

A) SELECT sname from tblstaff WHERE salary IN (15000, 25000);

B) SELECT sname from tblstaff WHERE salary BETWEEN 15000 AND 25000;

C) Both A and B

D) None of the above



4. The SELECT statement, that retrieves all the columns from empinfo table name starting with d to p is ..........................

A) SELECT ALL FROM empinfo WHERE ename like '[d-p]%';

B) SELECT * FROM empinfo WHERE ename is '[d-p]%';

C) SELECT * FROM empinfo WHERE ename like '[p-d]%';

D) SELECT * FROM empinfo WHERE ename like '[d-p]%';



5. Select a query that retrieves all of the unique countries from the student table?

A) SELECT DISTINCT coursename FROM studentinfo;

B) SELECT UNIQUE coursename FROM studentinfo;

C) SELECT DISTINCT coursename FROM TABLE studentinfo;

D) SELECT INDIVIDUAL coursename FROM studentinfo;



6. Which query is used for sorting data that retrieves the all the fields from empinfo table and listed them in the ascending order?

A) SELECT * FROM empinfo ORDER BY age;

B) SELECT * FROM empinfo ORDER age;

C) SELECT * FROM empinfo ORDER BY COLUMN age;

D) SELECT * FROM empinfo SORT BY age;



7. Select the right statement to insert values to the stdinfo table.

A) INSERT VALUES ("15", "Hari Thapa", 45, 5000) INTO stdinfo;

B) INSERT VALUES INTO stdinfo ("15", "Hari Thapa", 45, 5000);

C) INSERT stdinfo VALUES ("15", "Hari Thapa", 45, 5000);

D) INSERT INTO stdinfo VALUES ("15", "Hari Thapa", 45, 5000);



8. How to Delete records from studentinfo table with name of student 'Hari Prasad'?

A) DELETE FROM TABLE studentinfo WHERE sname='Hari Prasad';

B) DELETE FROM studentinfo WHERE sname='Hari Prasad';

C) DELETE FROM studentinfo WHERE COLUMN sname='Hari Prasad';

D) DELETE FROM studentinfo WHERE sname LIKE 'Hari Prasad';



9. Constraint checking can be disabled in existing ............. and .............. constraints so that any data you modify or add to the table is not checked against the constraint.

A) CHECK, FOREIGN KEY

B) DELETE, FOREIGN KEY

C) CHECK, PRIMARY KEY

D) PRIMARY KEY, FOREIGN KEY



10. ..................... joins two or more tables based on a specified column value not equaling a specified column value in another table.

A) OUTER JOIN

B) NATURAL JOIN

C) NON-EQUIJOIN

D) EQUIJOIN


Answers:

1.  B) SELECT sname, coursename FROM studentinfo WHERE age>50 and age <80;
2.  A) SELECT * FROM  studentinfo WHERE sname LIKE 'r%';
3.  A) SELECT sname from tblstaff WHERE salary IN (15000, 25000);
4.  D) SELECT * FROM empinfo WHERE ename like '[d-p]%';
5.  A) SELECT DISTINCT coursename FROM studentinfo;
6.  A) SELECT * FROM  empinfo ORDER BY age;
7.  D) INSERT INTO stdinfo VALUES ("15", "Hari Thapa", 45, 5000);
8.  B) DELETE FROM studentinfo WHERE sname='Hari Prasad';
9. A) CHECK, FOREIGN KEY
10.C) NON-EQUIJOIN

You Might also view the following Related Posts

تعليقات

الاسم

Artificial Intelligence(AI) Backlinking Basic IT Best List Blogging Tips C C# C++ Computer Architecture Computer Fundamental Computer Security Computer/IT Officer Exam CSS Data Mining and Warehousing Data Recovery Tools Data Structure Database Management System E-commerce E-government Internet & Web Designing IT Law IT Tips and Tricks IT Tutorials Java JavaScript Keyword Research Tools MIS Multiple Choice Question (MCQ) Networking Online Earning Online IT Jobs Operating System Oracle Forms and Reports Programming Guide Programming Language SEO Social Networking Sites Software Download Software Engineering System Analysis and Design Top List VB.Net
false
rtl
item
Max6: MCQ of Structured Query Language(SQL) With Answer Set -2
MCQ of Structured Query Language(SQL) With Answer Set -2
Max6
https://maxs29.blogspot.com/2013/05/mcq-of-structured-query-languagesql.html
https://maxs29.blogspot.com/
http://maxs29.blogspot.com/
http://maxs29.blogspot.com/2013/05/mcq-of-structured-query-languagesql.html
true
4303790511137642940
UTF-8
لم يتم العثور على اى مواضيع شاهد الكل اقرأ المزيد رد احذف الرد حذف بواسطة الرئيسية صفحات مواضيع شاهد الكل نوصى لك التسميات الارشيف بحث لم يتم العثور على ماتبحث عنه عودة للرئيسية الاحد الاثنين الثلاثاء الاربعاء الخميس الجمعة السبت الاحد الاثنين الثلاثاء الاربعاء الخميس الجمعة السبت يناير فبراير مارس ابريل مايو يونيو يوليو اغسطس سبتمبر اكتوبر نوفمبر ديسمبر يناير فبراير مارس ابريل مايو يونيو يوليو اغسطس سبتمبر اكتوبر نوفمبر ديسمبر just now 1 دقيقة مضت $$1$$ دقيقة مضت 1 hour ago $$1$$ ساعة مضت الامس $$1$$ يوم مضى $$1$$ اسبوع مضى اكثر من 5 اسابيع مضت