You are on page 1of 4

Experiment no.

-3

Aim- write a SQL command to create student table with the following fields:
Registration_no

number(10)

Name

varchar2(15)

Branch

varchar2(5)

Age

number(2)

Address

varchar2(15)

1. Insert minimum 10 records.


2. List all student name having age 25 years and 23 years.
3. List all student name having age between 22 and 26 years.
4. List all student name starting with character p.
5. List all student name ending with character h.
6. List all student name having exactly 5 characters in the name.
7. List all student name having a in their name.

Steps-

1. Create a table student1 with fields registration_no, name, branch, age, address.
2. Use insert command to enter 10 entries in student1.
3. Select entries where age is 23 and 25 years.
4. Select all entries from table name where age between 22 and 26.
5. Select all entries from student 1 where name starts from p by using name like p%.
6. Select all entries from table where name ends with h by using name like %h.
7. Select all entries from table where name have exactly 5 characters by using name like
_____.
8. Select all entries from student1 where name have a in their name by using name like %a
%.

SQL Queries-

Result- all SQL queries executed successfully.

You might also like