Search Header Logo

BDD 2023

Authored by NICOLAS Ternay

Science

KG - 1st Grade

Used 9+ times

BDD 2023
AI

AI Actions

Add similar questions

Adjust reading levels

Convert to real-world scenario

Translate activity

More...

    Content View

    Student View

42 questions

Show all answers

1.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Media Image

Which of the following word pairs are synonyms:

A) table and relation.

В) table and tuple.

C) column and tuple

D). Attribute and row

2.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Which of the following statements are true regarding the comparison between primary key and unique key?



HELP: https://www.shiksha.com/online-courses/articles/primary-key-vs-unique-key/#:~:text=The%20main%20difference%20between%20a,and%20can%20store%20NULL%20values.

A) unique key attribute can be null, a primary key attribute cannot

B) There can be more than one unique key in a table, but there can only be one primary key

C) A primary key attribute can be null, a unique key attribute cannot

D) That can be multiple primary keys in a table, but there can only be one unique key

3.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

4)

Wich of the following SQL statements allows you to drop table T?

A. drop table T

B. delete from T

C. delete from T where true

D. truncate table T

Answer explanation

The DROP TABLE statement is used to permanently delete a table from a database. It removes all data, indexes, triggers, and constraints associated with the table. Once a table is dropped, it cannot be recovered.

The other options are not correct:

  • DELETE FROM T deletes all rows from the table T, but the table itself remains.

  • DELETE FROM T WHERE TRUE is equivalent to DELETE FROM T, as the WHERE TRUE clause always evaluates to true.

  • TRUNCATE TABLE T deletes all rows from the table T, but the table itself remains and the table ID is reset to 0.

Therefore, the only statement that allows you to drop table T is DROP TABLE T.

4.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Consider table R(A, B, C). With (A,B) Primary Key The query "select A, B from R" returns the same result as:

A) select distinct A, B from R

B) select A, B from R where A <> null

C) select distinct A, B from R where B <> null

D) select A, B from R where A <> null and B <> null

Answer explanation

Media Image

SELECT Name, Family_Name FROM Students;

A) SELECT DISTINCT Name, Family_Name FROM Students;

B) SELECT Name, Family_Name FROM Students WHERE Name IS NOT NULL;

C) SELECT DISTINCT Name, Family_Name FROM Students WHERE Family_Name IS NOT NULL;

D) SELECT Name, Family_Name FROM Students WHERE Name IS NOT NULL AND Family_Name IS NOT NULL;

5.

MULTIPLE CHOICE QUESTION

30 sec • 1 pt

Consider the table T (A: int, B: int). Which query below can produce duplicates?

A) select * from T

B) select B from T

C) select * from T

Where A = 0

D) select * from T where B = 0

Answer explanation

Media Image

A) SELECT * FROM T;

B) SELECT B FROM T; ✅

C) SELECT * FROM T WHERE A = 0;

D) SELECT * FROM T WHERE B = 0;

B ) can produce duplicate

proof of answere D on the image, the rest is obviou

6.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Consider tables R(A, B) and S(B, C). The query "select A from R natural join S" returns the same result as:

A) select A from R cross join S

B) select A from R, S

D) select A from R, S where R.B = S.B

D)

select A from R cross join S where R.B = S.B

Answer explanation

Media Image

C) SELECT A FROM R, S WHERE R.B = S.B ✅

Explanation: This query performs an inner join between tables R and S based on the common column B (R.B = S.B). This is equivalent to the natural join condition, where the join is automatically performed based on common columns between the two tables.

D) La requête D utilise un cross join pour combiner toutes les lignes des tables R et S, puis utilise une clause WHERE pour filtrer les résultats pour n'inclure que les lignes où les valeurs des colonnes B sont égales.

7.

MULTIPLE SELECT QUESTION

45 sec • 1 pt

Consider tables R(A, B, C) and S(B, D). Then:

A) "R natural inner join S" contains more tuples than "R natural join S".

B) "R natural outer join S" contains at least as many tuples as "R natural join S".

C) "R natural outer join S" contains at least as many tuples as "R natural left outer join S"

D) "R natural left outer join S" contains at least as many tuples as "R natural right outer join S".

Answer explanation

Natural inner join combines two tables based on their common columns and includes only the rows where the values in the common columns match. In this case, the natural inner join of tables R and S would include only the rows where the values in column B of R match the values in column B of S.

Natural join also combines two tables based on their common columns but includes all rows from both tables, regardless of whether the values in the common columns match. This means that the natural join of tables R and S would include all rows from table R, along with all rows from table S that have a matching value in column B.

Natural outer join combines two tables based on their common columns and includes all rows from both tables, even if there is no matching value in the common columns. This means that the natural outer join of tables R and S would include all rows from table R, along with all rows from table S, regardless of whether the values in column B match.

Now, let's compare the statements:

A) "R natural inner join S" contains more tuplesthan "R natural join S".

This statement is incorrect because the natural inner join of two tables always contains fewer tuples or rows than the natural join of the same tables. The natural inner join only includes rows where the values in the common columns match, while the natural join includes all rows from both tables, regardless of whether the values in the common columns match.

B) "R natural outer join S" contains at least as many tuples as "R natural join S".

This statement is correct. The natural outer join of two tables always contains at least as many tuples or rows as the natural join of the same tables. The natural outer join includes all rows from both tables, regardless of whether the values in the common columns match, while the natural join only includes rows where the values in the common columns match.

C) "R natural outer join S" contains at least as many tuples as "R natural left outer join S"

This statement is also correct. The natural outer join of two tables always contains at least as many tuples or rows as the natural left outer join of the same tables. The natural outer join includes all rows from both tables, regardless of whether the values in the common columns match, while the natural left outer join only includes all rows from the left table and matching rows from the right table.

D. "R natural left outer join S" contains at least as many tuples as "R natural right outer join S".

This statement is incorrect because the natural left outer join of two tables always contains at least as many tuples or rows as the natural right outer join of the same tables. The natural left outer join includes all rows from the left table and matching rows from the right table, while the natural right outer join only includes matching rows from the left table and all rows from the right table.

Therefore, the correct statements are:

  • B) "R natural outer join S" contains at least as many tuples as "R natural join S".

  • C) "R natural outer join S" contains at least as many tuples as "R natural left outer join S".

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?