Bird
0
0

A student tries to create a table for an entity Course(course_id, title) but writes: CREATE TABLE Course course_id INT PRIMARY KEY, title VARCHAR(100); What is the error?

medium📝 Debug Q6 of 15
SQL - Table Relationships
A student tries to create a table for an entity Course(course_id, title) but writes: CREATE TABLE Course course_id INT PRIMARY KEY, title VARCHAR(100); What is the error?
AMissing parentheses around column definitions
BIncorrect data type for course_id
CPRIMARY KEY cannot be used in CREATE TABLE
DTable name should be in quotes
Step-by-Step Solution
Solution:
  1. Step 1: Review correct CREATE TABLE syntax

    Column definitions must be enclosed in parentheses after table name.
  2. Step 2: Identify missing parentheses in given statement

    The statement lacks parentheses around columns, causing syntax error.
  3. Final Answer:

    Missing parentheses around column definitions -> Option A
  4. Quick Check:

    CREATE TABLE needs parentheses [OK]
Quick Trick: Always use parentheses for columns in CREATE TABLE [OK]
Common Mistakes:
MISTAKES
  • Omitting parentheses
  • Misplacing PRIMARY KEY keyword
  • Using wrong data types

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More SQL Quizzes