PostgreSQL Quiz

>100 Views

September 11, 14

スライド概要

PostgreSQLに関するクイズを出題します。

@PostgreSQL Night 2014-09-12

profile-image

PostgreSQL committer, Database Technical Lead at NTT DATA, maybe good husband & father.

シェア

またはPlayer版

埋め込む »CMSなどでJSが使えない場合

関連スライド

各ページのテキスト
1.

PostgreSQL Quiz Fujii Masao (@fujii_masao) PostgreSQL Night 2014.09.11

2.

Q1. How many rows can this query return? =# SELECT * FROM hoge WHERE id = (random() * 100)::int % 2; Precondition: there is the following table "hoge" having two rows. =# SELECT * FROM hoge; id ---0 1 (2 rows) Please choose every possible answers! (A) (B) (C) (D) 0 row 1 row 2 rows 3 rows

3.
[beta]
Q1. How many rows can this query return?
=# SELECT * FROM hoge WHERE id = (random() * 100)::int % 2;
Precondition: there is the following table "hoge" having two rows.
=# SELECT * FROM hoge;
id
---0
1
(2 rows)

Please choose every possible answers!
(A)
(B)
(C)
(D)

0 row
1 row
2 rows
3 rows

Correct answers are (A), (B) and (C)

4.

Q2. Which queries can run successfully on PostgreSQL 9.4? Precondition: there is the following table "hoge" having two rows. =# SELECT * FROM hoge; id ---0 1 (2 rows) Please choose every possible answers! (A) SELECT; (B) SELECT hoge; (C) FROM hoge; (D) TABLE hoge;

5.

Q2. Which queries can run successfully on PostgreSQL 9.4? Precondition: there is the following table "hoge" having two rows. =# SELECT * FROM hoge; id ---0 1 (2 rows) Please choose every possible answers! (A) SELECT; (B) SELECT hoge; (C) FROM hoge; (D) TABLE hoge; Correct answers are (A) and (D)

6.

Thank you!