DMDB 4

DMDB 4

9th - 12th Grade

12 Qs

quiz-placeholder

Similar activities

Image segmentation

Image segmentation

12th Grade - University

11 Qs

#1 Word Window Basics

#1 Word Window Basics

8th - 12th Grade

13 Qs

Design Thinking Quiz

Design Thinking Quiz

9th Grade

13 Qs

instagram

instagram

KG - Professional Development

10 Qs

Editing with Snapseed

Editing with Snapseed

8th - 12th Grade

10 Qs

rubiks cube quiz

rubiks cube quiz

KG - Professional Development

13 Qs

Backup, Restore, and Recovery

Backup, Restore, and Recovery

9th Grade - University

7 Qs

Slither.io Quiz

Slither.io Quiz

4th Grade - Professional Development

9 Qs

DMDB 4

DMDB 4

Assessment

Quiz

Other

9th - 12th Grade

Practice Problem

Medium

Created by

qzzxfns95h aus

Used 32+ times

FREE Resource

AI

Enhance your content in a minute

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

12 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Relational algebra has Bag semantics

True

False

Answer explanation

Relational algebra has set semantics, while SQL has bag semantics. However, standard set operations like UNION follow set semantics in SQL.

2.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Assume |app| = 10. Then SELECT * FROM app, app as a has ... tuples

10

100

20

1000

Cannot be said unless the schema is known

Answer explanation

SELECT * FROM a,b in SQL behaves like the cross product in RA. Thus, you can just multiply the size of both tables (here it's just one of size 10. Thus we have 100 tuples).

3.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which of the following constraints are set for PRIMARY KEYs in SQL?

UNIQUE

NOT NULL

SERIAL

FOREIGN KEY

NONE

4.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

To load the file /tmp/users.csv into the users table, you need to execute...

COPY users FROM '/tmp/users.csv' USING FORMAT csv;

INSERT users FROM '/tmp/users.csv' USING FORMAT csv;

COPY users FROM '/tmp/users.csv' WITH FORMAT csv;

LOAD users FROM '/tmp/users.csv' WITH FORMAT csv;

Answer explanation

Media Image

5.

MULTIPLE SELECT QUESTION

30 sec • 1 pt

Which are reasons that creating views are beneficial?

Privacy

Usability

Performance

Cost

6.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

Media Image

How many tuples does the following query return:

SELECT * FROM app WHERE bytes_received < ALL (SELECT bytes_sent FROM app)?

0

2

7

10

Answer explanation

Media Image

We're interested in tuples, which have less bytes_received then all bytes_sent from the table. The smallest bytes_sent is 29. Thus, only the tuples with bytes_received = 10 are selected. NULL is excluded (since NULL < 29 is unknown).

7.

MULTIPLE CHOICE QUESTION

2 mins • 2 pts

Media Image

How many tuples does the following query return (empty entries are NULL) :

SELECT * FROM app WHERE bytes_received < ALL (SELECT bytes_received FROM app)

0

2

7

10

Answer explanation

First of all, we have a strict inequality --> nothing is smaller than the minimum in the first place. Only NULLs might matter however NULL < 10 is unknown which means that we also don't select the NULLs giving 0 tuples. Alternatively: You see that there are 3 groups: NULL, 30 and 10 - 10 is the smallest value. None of those groups has bytes_received < 10. Especially NULL < 10 is unknown.

Access all questions and much more by creating a free account

Create resources

Host any resource

Get auto-graded reports

Google

Continue with Google

Email

Continue with Email

Classlink

Continue with Classlink

Clever

Continue with Clever

or continue with

Microsoft

Microsoft

Apple

Apple

Others

Others

Already have an account?