0% found this document useful (0 votes)
331 views25 pages

DBMS

Download as docx, pdf, or txt
Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1/ 25

1.a.

Data Definition Language(DDL)

Q1. Create a table called EMP with the following structure.

SQL> create table emply(sno int,empname varchar(40),job varchar(20),deptno int,


salary number(7));
Table created.

Q2: Add a column experience to the emp table. experience numeric null allowed.

SQL> alter table emp add(experience number(2));


Table altered.

Q3: Modify the column width of the job field of emp table.

SQL> alter table emp modify(job varchar2(12));


Table altered.

Q4: Create dept table with the following structure.

SQL> create table dept(deptno number(2) primary key,dname varchar2(10),loc


varchar2(10));
Table created.

Q5: create the emp1 table with ename and empno, add constraints to check the empno
value while entering (i.e) empno > 100.

SQL> create table emp1(ename varchar2(10),empno number(6) constraint ch


check(empno>100));
Table created.

Q6: drop a column experience to the emp table.

SQL> alter table emp drop column experience;


Table altered.

311118205301 Sathish Kumar.B


1.b.Data Manipulation Language(DML)

Q1: Insert a single record into dept table.

SQL> create table emply(sno int,empname varchar(15),job varchar(15),deptno int,s


alary number(7));
Table created.

SQL> desc emply;


Name Null? Type
----------------------------------------- -------- ----------------------------

SNO NUMBER(38)
EMPNAME VARCHAR2(15)
JOB VARCHAR2(15)
DEPTNO NUMBER(38)
SALARY NUMBER(7)

SQL> insert into emply values(1,'Thomas','HOD',2,150000);


1 row created.

Q2: Insert more than a record into emp table using a single insert command.

SQL> insert into emply values(&sno,'&empname','&job',&deptno,&salary);


Enter value for sno: 2
Enter value for empname: Revian
Enter value for job: Assist HOD
Enter value for deptno: 2
Enter value for salary: 130000
old 1: insert into emply values(&sno,'&empname','&job',&deptno,&salary)
new 1: insert into emply values(2,'Revian','Assist HOD',2,130000)

1 row created.

Q3: Update the emp table to set the salary of all employees to Rs15000/- who are
working as ASP

SQL> update emply set salary=15000 where job='ASP';


1 row updated

311118205301 Sathish Kumar.B


SQL> select * from emply;

SNO EMPNAME JOB DEPTNO SALARY


---------- --------------- --------------- ---------- ----------
1 Thomas HOD 2 150000
2 Revian Assist HOD 2 130000
3 vinrana lecturer 3 100000
4 Alya Professor 1 80000
5 Tanu professor 1 75000
6 Abhi ASP 7 15000
6 rows selected.

Q4: Create a pseudo table employee with the same structure as the table emp and insert
rows into the table using select clauses.

SQL> create table emply1 as select * from emply;


Table created.

SQL> select * from emply1;

SNO EMPNAME JOB DEPTNO SALARY


---------- --------------- --------------- ---------- ----------
1 Thomas HOD 2 150000
2 Revian Assist HOD 2 130000
3 vinrana lecturer 3 100000
4 Alya Professor 1 80000
5 Tanu professor 1 75000
6 Abhi ASP 7 15000
6 rows selected.

Q5: select employee name, job from the emp table

SQL> select empname,job from emply;

EMPNAME JOB
--------------- ---------------
Thomas HOD
Revian Assist HOD
vinrana lecturer
Alya Professor
Tanu professor
Abhi ASP

311118205301 Sathish Kumar.B


6 rows selected.
Q6: Delete only those who are working as lecturer

SQL> delete from emply where job='lecturer';


1 row deleted.

SQL> select * from emply;

SNO EMPNAME JOB DEPTNO SALARY


---------- --------------- --------------- ---------- ----------
1 Thomas HOD 2 150000
2 Revian Assist HOD 2 130000
4 Alya Professor 1 80000
5 Tanu professor 1 75000
6 Abhi ASP 7 15000

Q7: List the records in the emp table orderby salary in ascending order.

SQL> select * from emply order by salary;

SNO EMPNAME JOB DEPTNO SALARY


---------- --------------- --------------- ---------- ----------
6 Abhi ASP 7 15000
5 Tanu professor 1 75000
4 Alya Professor 1 80000
2 Revian Assist HOD 2 130000
1 Thomas HOD 2 150000

Q8: List the records in the emp table orderby salary in descending order.

SQL> select * from emply order by salary desc;

SNO EMPNAME JOB DEPTNO SALARY


---------- --------------- --------------- ---------- ----------
1 Thomas HOD 2 150000
2 Revian Assist HOD 2 130000
4 Alya Professor 1 80000
5 Tanu professor 1 75000
6 Abhi ASP 7 15000

311118205301 Sathish Kumar.B


Q9: Display only those employees whose deptno is 1.

SQL> select * from emply where deptno=1;

SNO EMPNAME JOB DEPTNO SALARY


---------- --------------- --------------- ---------- ----------
4 Alya Professor 1 80000
5 Tanu professor 1 75000

Q10: Display deptno from the table employee avoiding the duplicated values.

SQL> select distinct deptno from emply;

DEPTNO
----------
1
2
7

311118205301 Sathish Kumar.B


1.c.Data Control Language(DCL)

Q1: Develop a query to grant all privileges of employees table into departments table

SQL> grant all on emp7 to it07;


Grant succeeded.

Q2: Develop a query to grant some privileges of employees table into departments table

SQL> grant select,update,insert on depart to it07;


Grant succeeded.

Q3: Develop a query to revoke all privileges of employees table from departments table

SQL> revoke all on emp7 from it07;


Revoke succeeded.

Q4: Develop a query to revoke some privileges of employees table from departments
Table

SQL> Revoke select,update,insert on depart from it07;


Revoke succeeded.

Q5: Write a query to implement the save point and rollback

SQL> select * from emp7;

EMP_ID EMP_NAME EMP_SALARY


---------- ---------- ----------
16 jenson 40000
15 paul 40000
13 santhosh 30000

SQL> savepoint s1;


Savepoint created.

SQL> insert into emp7 values(14,'ashraf','50000');


1 row created.

SQL> select * from emp7;

EMP_ID EMP_NAME EMP_SALARY

311118205301 Sathish Kumar.B


---------- ---------- ----------
16 jenson 40000
15 paul 40000
13 santhosh 30000
14 ashraf 50000

SQL> rollback;
Rollback complete.

SQL> select * from emp7;

EMP_ID EMP_NAME EMP_SALARY


---------- ---------- ----------
16 jenson 40000
15 paul 40000
13 santhosh 30000

Q6: Write a query to implement the commit

SQL> commit;
Commit complete.

311118205301 Sathish Kumar.B


1.d.In Built Functions

Q1: Display all the details of the records whose employee name starts with ‘A‘.

SQL> select * from empl where empy_name LIKE 'a%';

      S_NO EMPY_NAME                SALARY


---------- -------------------- ----------
         1 ash                      16000
         2 ashraf                   17000

Q2: Display all the details of the records whose employee name does not starts with ‗A‘.

SQL> select * from empl where empy_name NOT LIKE 'a%';

      S_NO EMPY_NAME                SALARY


---------- -------------------- ----------
         3 sandy                   16500
         4 paul                   53000
         5 maseh                     30000

Q3: Display the rows whose salary ranges from 15000 to 30000.

SQL> select * from empl where salary between 15000 and 30000;

      S_NO EMPY_NAME                SALARY


---------- -------------------- ----------
         1 ash                      16000
         2 ashraf                    17000
         3 sandy                   16500

Q4: Calculate the total and average salary amount of the emp table.

SQL> select sum(salary) from empl ;


SUM(SALARY)
-----------
      57800

SQL> select avg(salary) from empl ;


AVG(SALARY)
-----------
      11560

311118205301 Sathish Kumar.B


Q5: Count the total records in the emp table.

SQL> select count(*) from empl ;


COUNT(*)
----------
         5
Q6: Determine the max and min salary and rename the column as max_salary and
min_salary.

SQL> select max(salary) as max_salary from empl ;


MAX_SALARY
----------
    53000

SQL> select min(salary) as min_salary from empl ;


MIN_SALARY
----------
     15000

Q7: Display the month between ―1-jun-10‖and 1-aug-10 in full.

SQL> select months_between ("1-jun-2010","1-aug-2010") from dual;


2

Q8: Display the last day of that month in ―05-Oct 09

SQL>Select last_day (" 1-oct-2009 ") from dual;


31-oct-2009

Q9: Find how many job titles are available in employee table.

SQL>select count(titles) from emp;


5

Q10: What is the difference between maximum and minimum salaries of employees in the
organization?

SQL> select max(salary)-min(salary) as difference from empl ;


DIFFERENCE
----------
    140000

311118205301 Sathish Kumar.B


2.a.NESTED QUERIES AND JOIN QUERIES

Q1: Display all employee names and salary whose salary is greater than minimum salary
of the company and job title starts with ‗M‘.

SQL> select ename,sal from emp where sal>(select min(sal) from emp where job like 'a%');

ENAME SAL
-------------------- ----------
Santhosh 15000
Ishant 15000
ken 30000
Ash 50000
Bharath 17500
Kevin 45000

Q2: Issue a query to find all the employees who work in the same job as Alex

SQL> select ename from emp where job=(select job from emp where ename='Alex');

ENAME
--------------------
Santhosh
Ishant
Anto
Alex

Q3: Issue a query to display information about employees who earn more than any
employee in dept 1.

SQL> select * from emp where sal>(select max(sal) from emp where empno=1);

EMPNO ENAME JOB DEPTNO SAL


---------- -------------------- ---------- ---------- ----------
5 ken prof 45 30000
14 Anto ap 4 50000
18 Bharath ap 1 17500
64 Kevin Bank 11 45000
87 Alex asp 82 15420

Q4: Display the employee details, departments that the departments are same in both the
emp and dept.

311118205301 Sathish Kumar.B


SQL> select * from emp,department where emp.deptno=department.deptno;

EMPNO ENAME JOB DEPTNO SAL DEPTNO


---------- -------------------- ---------- ---------- ---------- ----------
DEPTNAME ENO ENAME COMM
-------------------- ---------- -------------------- ----------
5 ken prof 45 30000 45
eee 4 Santhosh ok 66

Q5: Display the employee details, departments that the departments are not same in both
the emp and dept.

SQL> select * from emp,department where emp.deptno=department.deptno;

EMPNO ENAME JOB DEPTNO SAL DEPTNO


---------- -------------------- ---------- ---------- ---------- ----------
DEPTNAME ENO ENAME COMM
-------------------- ---------- -------------------- ----------
5 ken prof 45 30000 45
eee 4 Santhosh ok 66

SQL> select * from emp,department where emp.deptno!=department.deptno;

EMPNO ENAME JOB DEPTNO SAL DEPTNO


---------- -------------------- ---------- ---------- ---------- ----------
DEPTNAME ENO ENAME COMM
-------------------- ---------- -------------------- ----------
2 Santhosh asp 263 15000 205
it 23 vgh 45

1 Ishant asp 2089 15000 205


it 23 vgh 45

5 ken prof 45 30000 205


it 23 vgh 45

15 rows selected.

Q6: Display the Student name and grade by implementing a left outer join.

SQL> select stud1.name,gra from stud1 left outer join stud2 on stud1.name=stud2.
name;
NAME GRA
---------- -----

311118205301 Sathish Kumar.B


sandy a
joshin s
Sheffi
Rajan

Q7: Display the Student name, register no, and result by implementing a right outer join.

SQL> select stud1.name, regno, result from stud1 right outer join stud2 on stud1
.name = stud2.name;
NAME REGNO RESULT
---------- ---------- ----------
joshin 101 pass
sandy 104 pass

Q8: Display the Student name register no by implementing a full outer join.

SQL> select stud1.name, regno from stud1 full outer join stud2 on (stud1.name= s
tud2.name);
NAME REGNO
---------- ----------
saandy 104
joshin 101
Sheffi 103
Rajan 102

Q9: Write a query to display their employee names

SQL> select distinct empno from emp x,department y where x.deptno=y.deptno;

EMPNO
----------
5

Q10: Display the details of those who draw the salary greater than the average salary.

SQL> select distinct * from emp x where x.sal>=(select avg(sal) from emp);
EMPNO ENAME JOB DEPTNO SAL
------------ --------------------- ------------------- --------------
5 ken prof 45 30000
14 Anto ap 4 50000
64 Kevin Bank 11 45000

311118205301 Sathish Kumar.B


2.B SET OPERATORS

Q1: Display all the dept numbers available with the dept and emp tables
avoiding duplicates.

select deptno from emp5 union select salary from emp4;

DEPTNO
------
1314
1315
1316
1317
1415
1615

Q2: Display all the dept numbers available with the dept and emp tables.

SQL> select deptno from emp5 union all select DEPT_NO from dept1;

DEPTNO
----------
1314
1315
1316
1317

1315
1316
1317
1314
13154
2

311118205301 Sathish Kumar.B


DEPTNO
----------
3

12 rows selected.

Q3: Display all the dept numbers available in emp and not in dept tables and vice versa.

SQL> select deptno from emp5 minus select deptno from dept3;

DEPTNO
----------
1314
1315
1316
13154

311118205301 Sathish Kumar.B


3.C BASIC QUERIES & NESTED QUERIES

1.Create the following tables with the mapping given below.


a. stu_details (reg_no, stu_name, DOB, address, city)
SQL> create table stu_details(reg_no number(6),stu_name varchar(9), DOB date, ad
dress varchar(10), city varchar(7));

Table created.
SQL> insert into stu_details values(123,'aakash raj',date'1999-06-12','chennai',
'chennai');

1 row created.

SQL> insert into stu_details values(124,'vidhya',date'1999-05-12','egmore','egmo


re');

1 row created.

SQL> insert into stu_details values(161,'arthi',date'1999-09-13','guindy','guind


y');

1 row created.

b. mark_details (reg_no, mark1, mark2, mark3, total)


SQL> create table mark_details(reg_no number(6),mark1 number(3),mark2 number(3),
mark3 number(3),total number(3));

Table created.

SQL> insert into mark_details values(123,100,100,100,300);

1 row created.

SQL> insert into mark_details values(124,80,80,100,260);

1 row created.

SQL> insert into mark_details values(124,80,80,80,240);

1 row created.

311118205301 Sathish Kumar.B


(i). Display only those rows whose total ranges between 250 and 300.
SQL> select * from mark_details where total between 250 and 300;

REG_NO MARK1 MARK2 MARK3 TOTAL


---------- ---------- ---------- ---------- ----------
123 100 100 100 300
124 80 80 100 260

(ii). Drop the table mark_details.


SQL> drop table mark_details;

Table dropped.

(iii). Delete the row whose reg_no=161.


SQL> delete from stu_details where reg_no=161;

1 row deleted.

(iv). Display all details whose names begins with 'a'.


SQL> select * from stu_details where stu_name like 'a%';

REG_NO STU_NAME DOB ADDRESS CITY


---------- ------------- --------- ---------- -------
123 aakash raj 12-JUN-99 chennai chennai

2.Create the following tables with the mapping given below.


a. emp_details (emp_no, emp_name, DOB, address, doj, mobile_no, dept_no, salary).

SQL> create table emp_details(emp_no number(4), emp_name varchar(13), DOB date,


address varchar(10), doj date, mobile_no number(10), dept_no int, salary number(
6));

Table created.

SQL> insert into emp_details values(123,'aakash raj',date'1999-06-12','chennai',


date'2017-09-13',6381052298,1,60000);

1 row created.

SQL> insert into emp_details values(124,'aakiee',date'1999-08-13','chennai',date


'2016-02-13',9940500972,2,35000);

1 row created.

c. dept_details (dept_no, dept_name, location).

311118205301 Sathish Kumar.B


SQL> create table dept_details(dept_no int,dept_name varchar(10),location varcha
r(10));

Table created.

SQL> insert into dept_details values(1,'IT','chennai');

1 row created.

SQL> insert into dept_details values(2,'ECE','chennai');


1 row created.

(i) Truncate the table dept_details.


SQL> truncate table dept_details;

Table truncated.

(ii) Display the structure of the table emp_details.

SQL> desc emp_details;


Name Null? Type
----------------------------------------- -------- ----------------------------

EMP_NO NUMBER(4)
EMP_NAME VARCHAR2(13)
DOB DATE
ADDRESS VARCHAR2(10)
DOJ DATE
MOBILE_NO NUMBER(10)
DEPT_NO NUMBER(38)
SALARY NUMBER(6)
(iii) Convert the first letter of emp_name into capitals.
SQL> select initcap(emp_name) from emp_details;

INITCAP(EMP_N
-------------
Aakash Raj
Aakiee

(iv) Display the emp_name getting highest salary.


SQL> select max(salary) from emp_details;
MAX(SALARY)
-----------
60000

311118205301 Sathish Kumar.B


3.Create the following tables with the mapping given below.
a. book (book_name,author,price,quantity).
SQL> create table book(book_name varchar(15),author
varchar(13),price number(6),
quantity number(3));

Table created.
SQL> insert into book values('twilight','meyer',1000,50);
1 row created.
SQL> insert into book values('little bee','chris',500,55);
1 row created.SQL> insert into book values('kim','kipling',200,55);1
row created.

SQL> insert into book values('bluest eye','tomi',230,25);

1 row created.

b. customer (Cust_id, Cust_name, Addr, ph_no,pan_no)


SQL> create table customer(cust_id number(5),cust_name varchar(13),addr varchar(
10),ph_no number(10),pan_no number(16));
Table created.
(i) Truncate the table customer.
SQL> truncate table customer;

Table truncated.

(ii) List the author of the book which one have the price of 200.
SQL> select * from book where author like 'k%';

BOOK_NAME AUTHOR PRICE QUANTITY


--------------- ------------- ---------- ----------
kim kipling 200 55

(iii).List the price of the book which one is between the price of 175 & 250.
SQL> select * from book where price between 175 and 250;

BOOK_NAME AUTHOR PRICE QUANTITY


--------------- ------------- ---------- ----------
kim kipling 200 55
bluest eye tomi 230 25

311118205301 Sathish Kumar.B


(iv).Retrieve all the details from the table book whose author name start with K
SQL> select author from book where price=200;

AUTHOR
-------------
kipling

4.Create the following tables with the mapping given below.


a. stu_details (reg_no, stu_name, DOB, address, city)
SQL> create table stu_details(reg_no number(6),stu_name varchar(9), DOB date, ad
dress varchar(10), city varchar(7));

Table created.
SQL> insert into stu_details values(123,'aakash raj',date'1999-06-12','chennai',
'chennai');

1 row created.

SQL> insert into stu_details values(124,'vidhya',date'1999-05-12','egmore','egmo


re');

1 row created.

SQL> insert into stu_details values(161,'arthi',date'1999-09-13','guindy','guind


y');

1 row created.

b. mark_details (reg_no, mark1, mark2, mark3, total)


SQL> create table mark_details(reg_no number(6),mark1 number(3),mark2 number(3),
mark3 number(3),total number(3));

Table created.
SQL> insert into mark_details values(123,100,100,100,300);

1 row created.

SQL> insert into mark_details values(124,80,80,100,260);

1 row created.

SQL> insert into mark_details values(124,80,80,80,240);

311118205301 Sathish Kumar.B


1 row created.

(i)Find out the name of all students.


SQL> select stu_name from stu_details;

STU_NAME
-------------
aakash raj
vidhya

(ii)List all the student detail that who are all located in
Chennai.
SQL> select * from stu_details where city='chennai';

REG_NO STU_NAME DOB ADDRESS CITY


---------- ------------- --------- ---------- -------
123 aakash raj 12-JUN-99 chennai chennai

(iii)Drop the table mark_details.


SQL> drop table mark_details;
Table dropped.

5.Create the following tables with the mapping given below.


a. Customer (Cust_id, Cust_name, Addr, ph_no,pan_no)
SQL> create table customer(cust_id number(5),cust_name varchar(13),addr varchar(
10),ph_no number(10),pan_no number(16));

Table created.
SQL> insert into customer values(124,'aakash
raj','chennai',6381052298,9876543210);
1 row created.

SQL> insert into customer


values(125,'raj','egmore',9025109654,3456789012);
1 row created.

SQL> insert into customer


values(126,'kavi','guindy',8489541337,87654328901);
1 row created.
SQL> insert into customer values(127,'leena','guindy',8489863937,87654367541);

1 row created.

311118205301 Sathish Kumar.B


b. Loan(Loan_id, Amount, Interest, Cust_id)
SQL> create table loan(loan_id number(5),amount number(7),interest int,cust_id n
umber(5));
Table created.
SQL> insert into loan values(456,60000,4,124);
1 row created.

SQL> insert into loan values(490,700000,7,125);


1 row created.

SQL> insert into loan values(478,340000,9,126);


1 row created.

SQL> insert into loan values(446,990000,15,127);


1 row created.

SQL> insert into loan values(447,990000,15,127);


1 row created.

(i)Display the Cust_name having both Loan and Account .


SQL> select cust_id from customer intersect select cust_id from loan;

CUST_ID
----------
124
125
126

(ii) Display number of Loans, the sum of Loan Amount of a


ParticularCustname(“LEENA”)
SQL> select count(loan_id),sum(amount) from loan where cust_id=(select cust_id f
rom customer where cust_name='leena');

COUNT(LOAN_ID) SUM(AMOUNT)
-------------- -----------
2 1980000
(iii)Display the Custname doesn‟thold any Account nor taken any Loan
SQL> select cust_name from customer where cust_id=0;

no rows selected

(iv)Add a column nol(number of loans)


SQL> alter table loan add(nol int);

Table altered.

311118205301 Sathish Kumar.B


6. Create the following tables with the mapping given below.
emp_details(emp_no, emp_name, DOB, address, doj, mobile_no, salary).

SQL> create table emp_details(emp_no number(4), emp_name varchar(13), DOB date,


address varchar(10), doj date, mobile_no number(10) , salary number(
6));

Table created.

SQL> insert into emp_details values(123,'aakash raj',date'1999-06-12','chennai',


date'2017-09-13',6381052298,60000);

1 row created.

SQL> insert into emp_details values(124,'aakiee',date'1999-08-13','chennai',date


'2016-02-13',9940500972,35000); 1 row created.

(i)Add a column dept_no(department number).


SQL> alter table emp_details add(dept_no int);

Table altered.
(ii)Drop the column salary by altering the table.
SQL> alter table emp_details drop(salary);
Table altered.
(iii)Rename the table as‟Employee‟.
SQL> alter table emp_details rename to Employee;

Table altered.
7.Create the following table with the mapping given below.
Customer (Cust_id, Cust_name, Addr, ph_no,pan_no).
SQL> create table customer(cust_id number(5),cust_name varchar(13),addr varchar(
10),ph_no number(10),pan_no number(16));
Table created.

SQL>insert into customer values


(124,'aakashraj','chennai',6381052298,9876543210);
1 row created.

SQL> insert into customer


values(125,'raj','egmore',9025109654,3456789012);
1 row created.

311118205301 Sathish Kumar.B


SQL> insert into customer
values(126,'kavi','guindy',8489541337,87654328901);
1 row created.
SQL> insert into customer values(127,'leena','guindy',8489863937,87654367541);
1 row created.
SQL> insert into customer
values(129,'nancy','vellore',9869541337,876454328901);
1 row created.

SQL> insert into customer


values(130,'mathik','theni',9869534537,875878328901);
1 row created.

SQL> insert into customer values(135,'lithuana','ney


york',6543534537,8758783765
41);
1 row created.

(i)Delete the row where cust_name=‟NANCY‟.


SQL> delete from customer where cust_name='nancy';
1 row deleted.

(ii)Update the addr where cust_name=‟MATHIK‟.


SQL> update customer set addr='chennai' where
cust_name='mathik';

1 row updated.

(iii)Display the details of a customer named “LITHUANA‟.


SQL> select * from customer where cust_name='lithuana';

CUST_ID CUST_NAME ADDR PH_NO


PAN_NO
---------- ------------- ---------- ---------- ----------
135 lithuana ney york 6543534537 8.7588E+11

311118205301 Sathish Kumar.B


8. Create the following table with the mapping given below.
book (book_name,author_name,price,quantity).
SQL> create table book(book_name varchar(15),author
varchar(13),price number(6),
quantity number(3));

Table created.

SQL> insert into book values('twilight','meyer',1000,50);

1 row created.

SQL> insert into book values('little bee','chris',500,55);

1 row created.

SQL> insert into book values('kim','kipling',200,55);

1 row created.

SQL> insert into book values('bluest eye','tomi',230,25);

1 row created.

(i) write a query to update the quantity by double in the


table book.
SQL> update book set quantity=2*quantity;

4 rows updated.

(ii)List all the book_name whose price is greater than


Rs.400.
SQL> select * from book where price>400;

BOOK_NAME AUTHOR PRICE QUANTITY


--------------- ------------- ---------- ----------
twilight meyer 1000 100
little bee chris 500 110

311118205301 Sathish Kumar.B


(iii)Retrieve the list of author_name whose first letter is ‟a‟ along with the book_name
and price.
SQL> select author,book_name,price from book where
author like 'a%';

no rows selected

SQL> select author,book_name,price from book where


author like 'k%';

AUTHOR BOOK_NAME PRICE


------------- --------------- ----------
kipling kim 200

311118205301 Sathish Kumar.B

You might also like