DMDB 4

DMDB 4

9th - 12th Grade

12 Qs

quiz-placeholder

Similar activities

ôn tập vật lí 9 sự phụ thuộc của điện trở

ôn tập vật lí 9 sự phụ thuộc của điện trở

9th Grade

13 Qs

Electronics Basics 1L Tech ED.

Electronics Basics 1L Tech ED.

12th Grade

11 Qs

TEKNIK ELEKTRONIKA DASAR

TEKNIK ELEKTRONIKA DASAR

10th Grade

15 Qs

Cultura do amendoim

Cultura do amendoim

9th - 12th Grade

10 Qs

Komponen Elektronika

Komponen Elektronika

11th Grade

15 Qs

Agrupamiento de resistencias

Agrupamiento de resistencias

11th Grade

9 Qs

Resistor Quiz

Resistor Quiz

10th - 12th Grade

10 Qs

test chapter 40

test chapter 40

9th - 12th Grade

10 Qs

DMDB 4

DMDB 4

Assessment

Quiz

Other

9th - 12th Grade

Medium

Created by

qzzxfns95h aus

Used 29+ times

FREE Resource

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.

Create a free account and access millions of resources

Create resources
Host any resource
Get auto-graded reports
or continue with
Microsoft
Apple
Others
By signing up, you agree to our Terms of Service & Privacy Policy
Already have an account?