Database Management Systems (3130703) MCQs

MCQs of SQL Concepts

Showing 1 to 10 out of 68 Questions
1.

Write SQL statements (Query) for following tables:

Student (StudentId, Name, Enrollmentno, Division, Semester, BirthDate, Email, ContactNo)

DISPLAY ALL STUDENT DETAILS WHO BELONGS TO ‘BCX-3’ DIVISION.

(a)

Select * From Student Where Division IS 'BCX-3'

(b)

Select * From Student Where Division IS equal 'BCX-3'

(c)

Select * From Student Where Division = 'BCX-3'

(d)

Select * From Student Where Division == 'BCX-3'

Answer:

Option (c)

2.

Write SQL statements (Query) for following tables:

Student (StudentId, Name, Enrollmentno, Division, Semester, BirthDate, Email, ContactNo)

DISPLAY NAME OF STUDENT WHO BELONGS TO EITHER SEMESTER 3 OR 5.

(a)

Select Name From Student Where Semester = 3 OR Semester = 5

(b)

Select Name From Student Where Semester = 3 OR 5

(c)

Select Name From Student Where Semester is either 3 OR Semester = 5

(d)

Select Name From Student Where Semester is either 3 OR 5

Answer:

Option (a)

3.

Write SQL statements (Query) for following tables:

Student (StudentId, Name, Enrollmentno, Division, Semester, BirthDate, Email, ContactNo)

FIND ALL STUDENTS WHOSE NAME DOES NOT STARTS WITH ‘V’.

 

(a)

Select * From Student Where Name Not Like '%V'

(b)

Select * From Student Where Name Not Like '%V%'

(c)

Select * From Student Where Name Not Like 'V_'

(d)

Select * From Student Where Name Not Like 'V%'

Answer:

Option (d)

4.

Write SQL statements (Query) for following tables:

Student (StudentId, Name, Enrollmentno, Division, Semester, BirthDate, Email, ContactNo)

DISPLAY ALL THE DETAILS OF FIRST THREE STUDENTS.

(a)

Select First 3 * From Student

(b)

Select First 3 From Student

(c)

Select Top 3 * From Student

(d)

Select Top 3 From Student

Answer:

Option (c)

5.

Write SQL statements (Query) for following tables:

Student (StudentId, Name, Enrollmentno, Division, Semester, BirthDate, Email, ContactNo)

DISPLAY UNIQUE SEMESTERS.

(a)

Select All Unique Semester From Student

(b)

Select All Distinct Semester From Student

(c)

Select Distinct Semester From Student

(d)

Select Unique Semester From Student

Answer:

Option (c)

6.

Write SQL statements (Query) for following tables:

Student (StudentId, Name, Enrollmentno, Division, Semester, BirthDate, Email, ContactNo)

DISPLAY NAME, ENROLLMENTNO OF FIRST 30% STUDENTS WHO’S CONTACT NUMBER ENDS WITH 7.

(a)

Select Top 30% Name, EnrollmentNo From Student Where ContactNo Like '7%'

(b)

Select Top 30 Percent Name, EnrollmentNo From Student Where ContactNo Like '%7'

(c)

Select Top 30% Name, EnrollmentNo From Student Where ContactNo Like '%7%'

(d)

Select Top 30% Name, EnrollmentNo From Student Where ContactNo Like '%7'

Answer:

Option (b)

7.

Write SQL statements (Query) for following tables:

Student (StudentId, Name, Enrollmentno, Division, Semester, BirthDate, Email, ContactNo)

FIND ALL STUDETNS IN WHICH EMAIL CONTAINS ‘3@G’ & ONLY SIX CHARACTERS.

 

(a)

Select * From Student Where Email Like '%3@g%' AND Email Like'______'

(b)

Select * From Student Where Email Like '%%3@g%%' AND Email Like'%______'

(c)

Select * From Student Where Email Like '%%3@g%%' AND Email Like'______%'

(d)

Select * From Student Where Email Like '%%3@g%%' AND Email Like'______'

Answer:

Option (a)

8.

Write SQL statements (Query) for following tables:

Student (StudentId, Name, Enrollmentno, Division, Semester, BirthDate, Email, ContactNo)

DISPLAY STUDENTID, NAME & EMAIL OF ALL STUDENTS.

(a)

Select StudentID, Name and Email From Student

(b)

Select * From Student

(c)

Select StudentID, Name, Email From Student

(d)

Select StudentID or Name or Email From Student

Answer:

Option (c)

9.

Write SQL statements (Query) for following tables:

Student (StudentId, Name, Enrollmentno, Division, Semester, BirthDate, Email, ContactNo)

FIND STUDENTS AFTER BORN DATE 01-01-1990.

(a)

Select * From Student Where BirthDate < '1990-01-01'

(b)

Select * From Student Where BirthDate = '1990-01-01'

(c)

Select * From Student Where BirthDate >= '1990-01-01'

(d)

Select * From Student Where BirthDate > '1990-01-01'

Answer:

Option (d)

10.

Write SQL statements (Query) for following tables:

Student (StudentId, Name, Enrollmentno, Division, Semester, BirthDate, Email, ContactNo)

DISPLAY STUDENT NAME IN WHICH STUDENT BELONGS TO SEMESTER 3 & CONTACT NUMBER DOES NOT CONTAINS 8 & 9.

(a)

Select Name From Student Where Sem = 3 AND ContactNo Not Like '%%8%%' AND ContactNo Not Like '%_9_%'

(b)

Select Name From Student Where Sem = 3 AND ContactNo Not Like '%%8%%' AND ContactNo Not Like '%%9%%'

(c)

Select Name From Student Where Sem = 3 AND ContactNo Not Like '%%8%%' AND ContactNo Not Like '%9%'

(d)

Select Name From Student Where Sem = 3 AND ContactNo Not Like '%8%' AND ContactNo Not Like '%9%'

Answer:

Option (d)

Showing 1 to 10 out of 68 Questions