So, what's wrong with it? It is an outline constraint clause which has to follow certain syntax. OK now, your code: SQL> CREATE TABLE booking (Ģ Booking_ID int GENERATED BY DEFAULT AS IDENTITY NOT NULL,ĩ constraint GuestID_FK references guest(Guest_ID),ġ0 constraint RoomID_FK references room(Room_ID),ġ1 constraint EmployeeID_FK references employee(Employee_ID),Ĭonstraint GuestID_FK references guest(Guest_ID),Īha. SQL> create table employee (employee_id int primary key) SQL> create table room (room_id int primary key) It helps if you specify which error(s) you got when you ran this code.Īs table references some other tables, I'll first create them (so that foreign key constraints wouldn't fail because of that) I'll create dummy tables with only primary key columns: SQL> create table guest (guest_id int primary key)
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |