Where are my SQL syntax errors?   MariaDB [(none)]> Drop database if exists moviedb; Query OK, 1 row affected (0.040 sec)   MariaDB [(none)]> MariaDB [(none)]> Create database moviedb; Query OK, 1 row affected (0.001 sec)   MariaDB [(none)]> MariaDB [(none)]> use moviedb; Database changed MariaDB [moviedb]> MariaDB [moviedb]> Create table customer -> ( -> ID varChar(30), -> Password varChar(20), -> Phone varChar(13), -> constraint customer_PK primary key (ID) -> ); Query OK, 0 rows affected, 1 warning (0.031 sec)   MariaDB [moviedb]> Create table Ticket -> ( -> ticketNum Number, -> MovieName varChar(30), -> Length Number, -> Director varChar(20), -> ShowTime varChar(30), -> -> constraint Ticket_PK primary key (ticketNum) -> constraint Ticket_FK foreign key (ShowTime) references ShowDate(ShowTime) -> ); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' MovieName varChar(30), Length Number, Director varChar(20), ...' at line 3 MariaDB [moviedb]> Create table purchase -> ( -> ID varChar(30), -> ticketNum Number, -> -> constraint purchase_PK primary key (ID,ticketNum), -> constraint purchase_FK foreign key(ID) references customer(ID), -> constraint purchase_FK foreign key(ticketNum) references Ticket(ticketNum) -> ); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '   constraint purchase_PK primary key (ID,ticketNum), constraint purchas...' at line 4 MariaDB [moviedb]> Create table ShowDate -> ( -> ShowTime varChar(30), -> seat varChar(5), -> price Number, -> constraint ShowDate_PK primary key(ShowTime) -> -> ); ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near ' constraint ShowDate_PK primary key(ShowTime)   )' at line 5

Computer Networking: A Top-Down Approach (7th Edition)
7th Edition
ISBN:9780133594140
Author:James Kurose, Keith Ross
Publisher:James Kurose, Keith Ross
Chapter1: Computer Networks And The Internet
Section: Chapter Questions
Problem R1RQ: What is the difference between a host and an end system? List several different types of end...
icon
Related questions
Question

Where are my SQL syntax errors?

 

MariaDB [(none)]> Drop database if exists moviedb;

Query OK, 1 row affected (0.040 sec)

 

MariaDB [(none)]>

MariaDB [(none)]> Create database moviedb;

Query OK, 1 row affected (0.001 sec)

 

MariaDB [(none)]>

MariaDB [(none)]> use moviedb;

Database changed

MariaDB [moviedb]>

MariaDB [moviedb]> Create table customer

-> (

-> ID varChar(30),

-> Password varChar(20),

-> Phone varChar(13),

-> constraint customer_PK primary key (ID)

-> );

Query OK, 0 rows affected, 1 warning (0.031 sec)

 

MariaDB [moviedb]> Create table Ticket

-> (

-> ticketNum Number,

-> MovieName varChar(30),

-> Length Number,

-> Director varChar(20),

-> ShowTime varChar(30),

->

-> constraint Ticket_PK primary key (ticketNum)

-> constraint Ticket_FK foreign key (ShowTime) references ShowDate(ShowTime)

-> );

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '

MovieName varChar(30),

Length Number,

Director varChar(20),

...' at line 3

MariaDB [moviedb]> Create table purchase

-> (

-> ID varChar(30),

-> ticketNum Number,

->

-> constraint purchase_PK primary key (ID,ticketNum),

-> constraint purchase_FK foreign key(ID) references customer(ID),

-> constraint purchase_FK foreign key(ticketNum) references Ticket(ticketNum)

-> );

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '

 

constraint purchase_PK primary key (ID,ticketNum),

constraint purchas...' at line 4

MariaDB [moviedb]> Create table ShowDate

-> (

-> ShowTime varChar(30),

-> seat varChar(5),

-> price Number,

-> constraint ShowDate_PK primary key(ShowTime)

->

-> );

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '

constraint ShowDate_PK primary key(ShowTime)

 

)' at line 5

 

 

Expert Solution
steps

Step by step

Solved in 3 steps with 1 images

Blurred answer
Recommended textbooks for you
Computer Networking: A Top-Down Approach (7th Edi…
Computer Networking: A Top-Down Approach (7th Edi…
Computer Engineering
ISBN:
9780133594140
Author:
James Kurose, Keith Ross
Publisher:
PEARSON
Computer Organization and Design MIPS Edition, Fi…
Computer Organization and Design MIPS Edition, Fi…
Computer Engineering
ISBN:
9780124077263
Author:
David A. Patterson, John L. Hennessy
Publisher:
Elsevier Science
Network+ Guide to Networks (MindTap Course List)
Network+ Guide to Networks (MindTap Course List)
Computer Engineering
ISBN:
9781337569330
Author:
Jill West, Tamara Dean, Jean Andrews
Publisher:
Cengage Learning
Concepts of Database Management
Concepts of Database Management
Computer Engineering
ISBN:
9781337093422
Author:
Joy L. Starks, Philip J. Pratt, Mary Z. Last
Publisher:
Cengage Learning
Prelude to Programming
Prelude to Programming
Computer Engineering
ISBN:
9780133750423
Author:
VENIT, Stewart
Publisher:
Pearson Education
Sc Business Data Communications and Networking, T…
Sc Business Data Communications and Networking, T…
Computer Engineering
ISBN:
9781119368830
Author:
FITZGERALD
Publisher:
WILEY