0% found this document useful (0 votes)
37 views

Lab Assignment

1. Log into Oracle database as system user and create a new user. 2. Grant privileges to the new user and connect as the new user. 3. Create a student table with columns for roll number, name, city, pincode, and age. 4. Insert data into the student table and write queries to retrieve specific records based on conditions.

Uploaded by

Nidhi Mehra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
37 views

Lab Assignment

1. Log into Oracle database as system user and create a new user. 2. Grant privileges to the new user and connect as the new user. 3. Create a student table with columns for roll number, name, city, pincode, and age. 4. Insert data into the student table and write queries to retrieve specific records based on conditions.

Uploaded by

Nidhi Mehra
Copyright
© Attribution Non-Commercial (BY-NC)
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 3

PRACTICAL LIST-1(ORACLE) SUBJECT CODE:PMC 303 1.Logon to Oracle by system/manager.

2.Create a user of your name & assign it a password. 3.Grant resource ,connect to a new user. 4.Disconnect from Oracle. 5.Connect as a new user. 6.See list of tables by usingTab / user_tables /cat tables. 7.View the user name from dual. 8.Clear the screen. 9.Perform some mathematical operations by using dual.(Addition,multiplication etc) 10.Create a table student with following attributes: Roll_No Name City Pincode Age number varchar varchar varchar number 6 15 12 8 2

11.Display the structure of table. 12.Insert the following data into the table.

Roll_no

Name

City

Pincode Age

1 2 3 4

Amit Kumar Kahitij Puneet

Delhi Bombay Madras Calcutta

214213 214101 110101 1010107

21 25 16 18

5 6 7 8 9 10 11

Rohit Karnal Shweta Mohit Pankaj Parul Rohit

Delhi Dehradun Dehradun Bombay Bombay Gwaliar Barodra

1102207 101301 98102 12434 98632 76312 12131

19 28 23 22 17 24 29

13.Write queries for the following outputs: Show all records. Show names of all students living in Delhi. Show record of all students whose name starts with A. Show record of all students whose name ends with it. Show records of all students having age greater than 25 & living in Dehradun. Show the names of all cities(names of cities should not be repeated). Show the names of students alphabetically in ascending order. Show the records of those students which are either less than 20 year or they are living in Bombay. Show records of all those students who are not living in Dehradun.

14.Insert the following data further into the same table. 12 NULL 14 15 Gaurav Manish Aviral NULL NULL NULL 29 25 Rampur NULL NULL Gwaliar 312125 314136 319143 313149

15.Write queries for the following: i)Assign Roll_no 13 to Manish. ii)Assign the name Abhijeet to Roll_no 15. iii)Set the cities of Roll_no.13 & 14 to Meerut. iv)Increase all age by 3 years. v)Set the age of all students living in Meerut to 25.

You might also like