Untitled

mail@pastecode.io avatar
unknown
plain_text
9 days ago
1.0 kB
3
Indexable
Never
ALTER TABLE Customer1 ADD CONSTRAINT check_age CHECK (Age BETWEEN 18 AND 80);
ALTER TABLE Customer1 MODIFY LastName VARCHAR2(20) NULL;



CREATE TABLE Account1(Acc_no NUMBER(5) PRIMARY KEY,CustomerID NUMBER(5),Balance NUMBER(7),FOREIGN KEY (CustomerID) REFERENCES Customer1(CustomerID));
desc Account1
INSERT INTO Customer1 (CustomerID, CustomerName, LastName, Country, Age, Contact_no)
VALUES (1, 'John', 'Doe', 'India', 30, '1234567890');

INSERT INTO Customer1 (CustomerID, CustomerName, LastName, Country, Age, Contact_no)
VALUES (2, 'Alice', 'Smith', 'Canada', 25, '2345678901');

INSERT INTO Customer1 (CustomerID, CustomerName, LastName, Country, Age, Contact_no)
VALUES (3, 'Bob', 'Johnson', 'UK', 40, '3456789012');

INSERT INTO Customer1 (CustomerID, CustomerName, LastName, Country, Age, Contact_no)
VALUES (4, 'Ava', 'Brown', 'Australia', 35, '4567890123');

INSERT INTO Customer1 (CustomerID, CustomerName, LastName, Country, Age, Contact_no)
VALUES (5, 'Ethan', 'Williams', 'India', 29, '5678901234');
Leave a Comment