>100 Views
September 11, 14
スライド概要
PostgreSQLに関するクイズを出題します。
@PostgreSQL Night 2014-09-12
PostgreSQL committer, Database Technical Lead at NTT DATA, maybe good husband & father.
PostgreSQL Quiz Fujii Masao (@fujii_masao) PostgreSQL Night 2014.09.11
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
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)
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;
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)
Thank you!