This content has been marked as final. Show 1 reply
Welcome to the forum!
You have posted to the wrong forum. This is the sql developer forum and your question has nothing to do with sql developer.
Please mark this question ANSWERED and report it in the sql and pl/sql forum
PL/SQL and SQL
Hi, this is my first DB project and all I'm trying to do is create a few tables with relationships so I can insert some data. The concept of foreign keys is a little confusing and I know there is one small logical error in my 'Booking' table in terms of a PK/FK violation(perhaps) but I can't work it out.
When you post in the other forum be sure to include your 4 digit Oracle version (result of SELECT * FROM V$VERSION).
You should also mention what you think the 'logical' error is and what you have tried. Just saying "I can't work it out" doesn't help anyone know what you might have tried to work it out.
For information about foreign keys, what they are and what they are used for see 'Foreign Key Constraints' in the Database Concepts doc
I don't see anything 'logical' problem but normally ALL columns used in a primary would be defined as NOT NULL. In the booking table the ROOM_NO column is nullable.
Also, the model does violate two best practices. One best practice is to use VARCHAR2, not CHAR, for storage. You are using CHAR. THe other best practice is to name columns appropriately and to use the proper datatypes for the data that wil be stored. You have columns with '_NO' in the name (HOTEL_NO, ROOM_NO, GUEST_NO). Will those columns hold numeric data or characater data? If numeric data the datatype should be numeric.
If the above does not answer you question repost it in the proper forum. In any event mark the question ANSWERED to sql developer volunteers won't waste their time on it.