Created
October 28, 2024 12:14
-
-
Save sujyrokimora/4b39bb0367f1743aba24799b87566645 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| CREATE TABLE Animal ( | |
| ID_Animal INT PRIMARY KEY, | |
| Animal_Type VARCHAR(50) NOT NULL, | |
| Breed VARCHAR(50) NOT NULL, | |
| Age INT NOT NULL, | |
| Weigth DECIMAL(10, 2) NOT NULL, | |
| Gender VARCHAR(10) NOT NULL | |
| ); | |
| CREATE TABLE Auction ( | |
| ID_Auction INT PRIMARY KEY, | |
| Date_Auction DATE NOT NULL, | |
| Location_Auction VARCHAR(100) NOT NULL, | |
| Num_Animals INT NOT NULL | |
| ); | |
| CREATE TABLE Sale ( | |
| ID_Sale INT PRIMARY KEY, | |
| ID_Auction INT NOT NULL, | |
| ID_Animal INT NOT NULL, | |
| Quantity INT NOT NULL, | |
| Total_Value DECIMAL(18, 2) NOT NULL, | |
| FOREIGN KEY (ID_Auction) REFERENCES Auction(ID_Auction), | |
| FOREIGN KEY (ID_Animal) REFERENCES Animal(ID_Animal) | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment