0% found this document useful (0 votes)
19 views3 pages

Experiment #1 Basic ORACLE SQL Syntax: Statement 1

The document demonstrates basic SQL commands like creating a table, inserting data, selecting data, updating data, deleting data, altering a table, and dropping a table. It creates a Book table with 4 columns, inserts 3 books, performs queries to select, filter, and order the data, updates and deletes rows, adds a column, and counts and selects the data, and finally drops the table.

Uploaded by

RahulKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
19 views3 pages

Experiment #1 Basic ORACLE SQL Syntax: Statement 1

The document demonstrates basic SQL commands like creating a table, inserting data, selecting data, updating data, deleting data, altering a table, and dropping a table. It creates a Book table with 4 columns, inserts 3 books, performs queries to select, filter, and order the data, updates and deletes rows, adds a column, and counts and selects the data, and finally drops the table.

Uploaded by

RahulKumar
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

Experiment #1

Basic ORACLE SQL Syntax

Statement 1

CREATE TABLE Book( Book_ID NUMBER(5), Book_Name VARCHAR(20), Publisher_Name


VARCHAR(20))
Table created.

Statement 2

INSERT INTO Book VALUES(111,'Mastery', 'Unknown')


1 row(s) inserted.

Statement 3

INSERT INTO Book VALUES(123,'Concepts of Physics', 'Unknown')


1 row(s) inserted.

Statement 4

INSERT INTO Book VALUES(100,'Python Programming','O,Reilly')


1 row(s) inserted.

Statement 5

SELECT * FROM Book


BOOK_ID BOOK_NAME PUBLISHER_NAME

111 Mastery Unknown


123 Concepts of Physics Unknown
100 Python Programming O,Reilly

3 rows selected.

Statement 6

SELECT * FROM Book WHERE Publisher_Name = 'Unknown'


BOOK_ID BOOK_NAME PUBLISHER_NAME

111 Mastery Unknown


123 Concepts of Physics Unknown

2 rows selected.
Statement 7

SELECT * FROM Book WHERE Publisher_Name = 'Unknown' ORDER BY Book_ID DESC


BOOK_ID BOOK_NAME PUBLISHER_NAME

123 Concepts of Physics Unknown


111 Mastery Unknown

2 rows selected.

Statement 8

DELETE FROM Book WHERE Book_ID = 111


1 row(s) deleted.

Statement 9

SELECT * FROM Book

BOOK_ID BOOK_NAME PUBLISHER_NAME


123 Concepts of Physics Unknown
100 Python Programming O,Reilly

2 rows selected.

Statement 10

UPDATE Book SET Publisher_Name = 'Bharti Bhawan' WHERE Book_ID = 123


1 row(s) updated.

Statement 11

SELECT * FROM Book

BOOK_ID BOOK_NAME PUBLISHER_NAME


123 Concepts of Physics Bharti Bhawan
100 Python Programming O,Reilly

2 rows selected.

Statement 12

ALTER TABLE Book ADD (Author VARCHAR(20))


Table altered.
Statement 13

SELECT COUNT(*) FROM book

COUNT(*)
2

Statement 14

SELECT * FROM Book


BOOK_ID BOOK_NAME PUBLISHER_NAME AUTHOR

123 Concepts of Physics Bharti Bhawan -


100 Python Programming O,Reilly -

2 rows selected.
Statement 15

SELECT COUNT(*) FROM book


COUNT(*)

Statement 16

DROP TABLE Book


Table dropped.

You might also like