Week 2-3

Week 2-3

University

9 Qs

quiz-placeholder

Similar activities

Quiz3_DivideConquer_GreedyApproach

Quiz3_DivideConquer_GreedyApproach

University

10 Qs

SQLite - Writing Queries

SQLite - Writing Queries

University

9 Qs

ICT in Curriculum & Instructions

ICT in Curriculum & Instructions

University

10 Qs

2022-2023 Midterm Quiz PLD

2022-2023 Midterm Quiz PLD

University

10 Qs

CSS (background-position-list)

CSS (background-position-list)

1st Grade - University

10 Qs

Avaliação Laboratório de Software e WEB

Avaliação Laboratório de Software e WEB

University

10 Qs

Data Warehouse - Foundations

Data Warehouse - Foundations

University

10 Qs

Microsoft Access

Microsoft Access

10th Grade - Professional Development

10 Qs

Week 2-3

Week 2-3

Assessment

Quiz

Computers

University

Practice Problem

Medium

Created by

DBS Semester

Used 1+ times

FREE Resource

AI

Enhance your content in a minute

Add similar questions
Adjust reading levels
Convert to real-world scenario
Translate activity
More...

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%'