Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- CREATE DATABASE GroceriesDB;
- GO
- USE GroceriesDB;
- GO
- CREATE TABLE Product(ProductID INT IDENTITY(1,1) PRIMARY KEY,
- ProductName NVARCHAR(50) NOT NULL,
- Price DECIMAL(20,5) NOT NULL
- );
- GO
- CREATE TABLE Grocery(GroceryID INT IDENTITY(1,1) PRIMARY KEY,
- TotalAmount DECIMAL(10,2) NOT NULL,
- GroceryDate DATETIME NOT NULL
- );
- GO
- INSERT INTO Product (ProductName, Price)
- VALUES
- ('Pommes', 2.50),
- ('Lait', 3.20),
- ('Céréales', 4.95);
- GO
- INSERT INTO Grocery(TotalAmount, GroceryDate)
- VALUES
- (12.65, '2024-05-14 09:30:45'),
- (15.75, '2024-05-13 17:30:27');
- GO
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement