Answered step by step
Verified Expert Solution
Question
1 Approved Answer
I'm trying to create that table, but I'm getting syntax errors. Could you explain what my error is? Table property for rent CREATE TABLE IF
I'm trying to create that table, but I'm getting syntax errors. Could you explain what my error is?
Table property for rent CREATE TABLE IF NOT EXISTS property_for_rent ( property_no VARCHAR(5) NOT NULL, address_id INT NOT NULL, prop_type VARCHAR(45), rooms VARCHAR(45), rent INT NOT NULL, staff_no VARCHAR(5), client_no VARHCAR(5), branch_no VARCHAR(5), PRIMARY KEY (property_no), INDEX FK_PROPERTY_FOR_RENT_ADDRESS_IDX (address_id ASC), INDEX fk_PROPERTY_FOR_RENT_STAFF_idx (staff_no ASC), INDEX fk_PROPERTY_FOR_RENT_CLIENT_idx (client_no ASC), INDEX fk_PROPERTY_FOR_RENT_branch1_idx (branch_no ASC), CONSTRAINT fk_PROPERTY_FOR_RENT_ADDRESS FOREIGN KEY (address_id) REFERENCES address (address_id) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_PROPERTY_FOR_RENT_STAFF FOREIGN KEY (staff_no) REFERENCES staff (staff_no) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_PROPERTY_FOR_RENT_CLIENT FOREIGN KEY (client_no) REFERENCES client (client_no) ON DELETE NO ACTION ON UPDATE NO ACTION, CONSTRAINT fk_PROPERTY_FOR_RENT_branch1 FOREIGN KEY (branch_no) REFERENCES branch (branch_no) ON DELETE NO ACTION ON UPDATE NO ACTION) ENGINE = InnoDB; Query OK, o rows affected (0.000 sec) "Query OK, o rows affected (0.000 sec) Query OK, o rows affected (0.000 sec) ilQuery OK, o rows affected, 1 warning (0.000 sec) "Query OK, o rows affected, 1 warning (0.000 sec) Query OK, o rows affected, 1 warning (0.000 sec) Query OK, o rows affected, 1 warning (0.000 sec) Query OK, o rows affected, 1 warning (0.000 sec) Query OK, o rows affected, 1 warning (0.000 sec) ERROR 1964 (42000) at line 130 in file: '\Users\Dariel Eusebio\Downloads\A1_Tables (2). sql': You have an error in your so L syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near '(5), branch_no VARCHAR(5), PRIMARY KEY (property_no), INDEX FK_PROPERTY... at line 8 Query OK, o rows affected (0.000 sec) Query OK, o rows affected (0.000 sec) Query OK, o rows affected (0.000 sec) Marian Iri54951>Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started