---------------------------------
--Create a new user
---------------------------------
Create user hahaya
Identified by hahaya
Default tablespace users
Temporary tablespace temp;
---------------------------------
--ToHahayaUser authorization
---------------------------------
Grant dba, sysdba to hahaya
With admin option;
---------------------------------
--Create a table
---------------------------------
Create table hahaya. book_book (
Book_id int not null,
Book_name varchar2 (200 ),
Book_price int,
Primary key (book_id)
);
-----------------------------------------------------
--Insert data to a table
--When using the second method, the value must be equal to the number of fields in the table.
------------------------------------------------------
Insert into hahaya. book_book (book_id, book_name, book_price) values (1, 'thinking in c ++ ', 80 );
Insert into hahaya. book_book values (2, The C ++ Programming Language, 100 );
-------------------------------------------------------
--Query table data
-------------------------------------------------------
Select * from hahaya. book_book;
-------------------------------------------------------
--Change the data of a row in a table
-------------------------------------------------------
Update hahaya. book_book set book_price = 90
Where book_id = 2;
Select * from hahaya. book_book;
-----------------------------------------------
--Delete a row of data in a table
-----------------------------------------------
Delete from hahaya. book_book where book_id = 2;
Select * from hahaya. book_book;