Week 2-3

Week 2-3

University

9 Qs

quiz-placeholder

Similar activities

MULTIMEDIA ANIMATION

MULTIMEDIA ANIMATION

University

13 Qs

Quiz CodeIgniter 4

Quiz CodeIgniter 4

University

10 Qs

Computer Basics Quiz

Computer Basics Quiz

8th Grade - University

10 Qs

Structured Cabling

Structured Cabling

University

10 Qs

استعني علي الشقا بالله

استعني علي الشقا بالله

University

10 Qs

SQL

SQL

University

10 Qs

Tableau

Tableau

University

10 Qs

ECM3434 Business Analysis 1 - Data Modelling

ECM3434 Business Analysis 1 - Data Modelling

University

10 Qs

Week 2-3

Week 2-3

Assessment

Quiz

Computers

University

Medium

Created by

DBS Semester

Used 1+ times

FREE Resource

9 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

The following queries trying to find out average marks in 2 different ways yield the same answer in every case:

(a) sum(marks)/count(*)

(b) average(marks)

True

False

2.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Which of the following is a correct manner to convert an “NULLIF(a,b)” to an equivalent “IF(x,y,z)” expression?

IF(a == null, b, a)

Cannot convert an nullif() statement to an if() statement

IF(a=b, NULL, a)

IF(a is null, a, b)

3.

FILL IN THE BLANK QUESTION

1 min • 1 pt

Media Image

Find the number of rows in the following relations for T1(ID, name) and T2(grades, name) as shown. SELECT * FROM T1 NATURAL JOIN T2;

4.

MULTIPLE SELECT QUESTION

1 min • 1 pt

Find the error(s) (if any) in the following query:

SELECT * FROM table1 a NATURAL JOIN table2 b

ON a.ID=b.ID;

No errors, query is correct

Wrong aliasing

ON condition must be omitted

Should be a.ID==b.ID

5.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Choose what would be seen on running this query on MySQL Workbench:

select coalesce(1.0/0.0, NULL," ","DBS");

NULL

1.0/0.0

DBS

6.

FILL IN THE BLANK QUESTION

3 mins • 2 pts

Find the average length of movies belonging to each rental_rate category. Output the rental_rate and the corresponding average length. Write an SQL query for the same. (table name: film)

PS: No need to alias tables/columns. Retain the underscores. All lowercase

7.

DRAG AND DROP QUESTION

1 min • 1 pt

How will you output the top 3 students according to marks?

select * from students

order by marks

​ (a)   ​ (b)   ;

desc
limit 3
inc
limit
dec
3
asc

8.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

What is returned when the following query is executed?

select COALESCE(1/0,NULL,1/0,NULL);

Error, as there is no non-NULL value

1/0

NULL

9.

MULTIPLE CHOICE QUESTION

1 min • 1 pt

Choose the correct alternative:

If we want to return all names having 'a' in their first position and 'e' in their fifth:

select * from table

where name <?>;

= 'a__%e%'

= 'a___e%'

like 'a%e_'

like 'a___e%'