Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ORACLE
- use db;
- show databases;
- CREATE TABLE Customer(
- CustomerID INT,
- CustomerName VARCHAR(50),
- LastName VARCHAR(50),
- Country VARCHAR(50),
- Age INT,
- Phone VARCHAR(15)
- );
- DROP TABLE Customer;
- DESCRIBE Customer;
- INSERT INTO Customer(CustomerID, CustomerName, LastName, Country, Age, Phone)
- VALUES (1001, 'John', 'Doe', 'USA', 25, '9876543210');
- INSERT INTO Customer(CustomerID, CustomerName, LastName, Country, Age, Phone)
- VALUES (1002, 'Jane', 'Doe', 'USA', 28, '1234567890');
- INSERT INTO Customer(CustomerID, CustomerName, LastName, Country, Age, Phone)
- VALUES (1003, 'Alice', 'Johnson', 'Canada', 29, '0987654321');
- INSERT INTO Customer(CustomerID, CustomerName, LastName, Country, Age, Phone)
- VALUES (1004, 'Bob', 'Smith', 'UK', 32, '4567891234');
- INSERT INTO Customer(CustomerID, CustomerName, LastName, Country, Age, Phone)
- VALUES (1005, 'Charlie', 'Brown', 'Australia', 22, '6543210987');
- INSERT INTO Customer(CustomerID, CustomerName, LastName, Country, Age, Phone)
- VALUES (1006, 'David', 'Taylor', 'Germany', 30, '7894561230');
- INSERT INTO Customer(CustomerID, CustomerName, LastName, Country, Age, Phone)
- VALUES (1007, 'Emily', 'Davis', 'France', 27, '3216549870');
- INSERT INTO Customer(CustomerID, CustomerName, LastName, Country, Age, Phone)
- VALUES (1008, 'Fiona', 'Williams', 'Italy', 35, '1478523690');
- SELECT * FROM Customer;
- DELETE FROM Customer WHERE CUSTOMERID= 1005;
- UPDATE Customer SET CUSTOMERNAME= 'Fiona' WHERE CUSTOMERID= 1008;
- ALTER TABLE Customer RENAME TO CustInfo;
- CREATE USER user123 IDENTIFIED BY your_password;
- GRANT CREATE SESSION TO user123;
- GRANT SELECT, INSERT ON CustInfo TO user123;
- REVOKE INSERT ON CustInfo FROM user123;
Advertisement
Comments
-
- UPDATE Customer SET CUSTOMERNAME= 'new name' WHERE CUSTOMERID= 1008;
Add Comment
Please, Sign In to add comment
Advertisement