ตั้งชื่อตาราง
เช่นเดียวกับออบเจ็กต์ที่มีชื่อทุกประเภทใน PostgreSQL ชื่อตารางมีข้อจำกัดบางอย่างตามที่ได้กล่าวถึงในบทเรียนก่อนหน้า เพื่อหลีกเลี่ยงปัญหาในการสร้างตารางใหม่ ควรรู้จักรูปแบบการตั้งชื่อที่ไม่ได้รับอนุญาต
แบบฝึกหัดนี้เป็นส่วนหนึ่งของหลักสูตร
การสร้างฐานข้อมูล PostgreSQL
คำแนะนำการฝึกหัด
- ลบคำสั่ง
CREATE TABLEที่มีชื่อตารางไม่ถูกต้องออก
แบบฝึกหัดเชิงโต้ตอบแบบลงมือทำ
ลองทำแบบฝึกหัดนี้โดยเติมโค้ดตัวอย่างนี้ให้สมบูรณ์
-- Delete me and command below if this table name is invalid
CREATE TABLE 2for1 ();
-- Delete me and command below if this table name is invalid
CREATE TABLE customers ();
-- Delete me and command below if this table name is invalid
CREATE TABLE orders ();
-- Delete me and command below if this table name is invalid
CREATE TABLE service_rendered_by_other_provider ();