Each owner owns one or more cats, and every cat has exactly one owner.

• The name and surname of each owner must be stored in the database.
• The name of each cat must be stored in the database.
• Each cat belongs to one specific breed, and many cats can belong to the same breed.
• The description of each breed must be stored in the database.
• A cat can enter many competitions, and many cats can enter the same competition.
• The description of each competition must be stored in the database.
Write the SQL code that will create the table structure for the table that stores
the cat details

CREATE TABLE CatDetails (

CatID INT NOT NULL PRIMARY KEY,
CatName VARCHAR(50) NOT NULL,
BreedID INT NOT NULL,
OwnerID INT NOT NULL,
FOREIGN KEY (BreedID) REFERENCES BreedDetails(BreedID),
FOREIGN KEY (OwnerID) REFERENCES OwnerDetails(OwnerID)
);

To create a table structure to store the cat details, including the owner, breed, and competition information, you can use the following SQL code:

```
CREATE TABLE owners (
owner_id INT PRIMARY KEY,
first_name VARCHAR(100),
last_name VARCHAR(100)
);

CREATE TABLE cats (
cat_id INT PRIMARY KEY,
name VARCHAR(100),
breed_id INT,
owner_id INT,
FOREIGN KEY (breed_id) REFERENCES breeds(breed_id),
FOREIGN KEY (owner_id) REFERENCES owners(owner_id)
);

CREATE TABLE breeds (
breed_id INT PRIMARY KEY,
description TEXT
);

CREATE TABLE competitions (
competition_id INT PRIMARY KEY,
description TEXT
);

CREATE TABLE cat_competitions (
cat_id INT,
competition_id INT,
PRIMARY KEY (cat_id, competition_id),
FOREIGN KEY (cat_id) REFERENCES cats(cat_id),
FOREIGN KEY (competition_id) REFERENCES competitions(competition_id)
);
```

In the above code, we have created four tables:
1. `owners`: to store the owner details.
2. `cats`: to store the cat details along with references to the owner and breed tables.
3. `breeds`: to store the breed details.
4. `competitions`: to store the competition details.

Additionally, we have created a fifth table `cat_competitions` to store the relationship between cats and competitions, with foreign key references to the `cats` and `competitions` tables.

Note: You may need to modify the data types and sizes of the columns based on your specific requirements.