You are on page 1of 22

Q.1 Create table student information like name, age, add, phone, class, college, etc.

Ans

Q. 2 Create table command.

Ans Create table table name(column1 data type(size)constraint, column2 data


type(size)constraint, . . . . . );
Q. 03 Insert data into tables using both types of insert commands.

Ans

01

02
Q.04 Add another column into
to dat
database using alter command.

Ans Old table

New table after modification


Q. 05 Select particular type off data using select command using like, functions
ons etc.
e

Ans
Q.6 Create anothertable
ble from old table.

ANS
Q .7 Run commands like
ike D
DROP TABLE, ROLLBACK, EDIT, DESC,
DES etc.

ANS DROP TABLE

ROLLBACK
DESCRIBE
Q.8 Apply nested queries
ries by Joining two tables & Select particular
par
data item from both
th ttables.
Q.09 Arrange columns data items in ascending or descending
ing order
o
ANS Before

After change descendin


ending

After change ascending


nding
Q.10 Create view & Index
dexes on tables.

ANS Create View


Create index
Q.12 Create client table with follo
following fields-cid, cname, cadd, city, state and
nd insert
in 10
records

ANS CREATE

INSERT DATA
Q.13 Create customerr tab
table with following fields- cust_id,
d, cust_name,
cu
cust_add, city, state and
nd iinsert 10 records and apply the following
foll
constraints *NOT NULL,*P
LL,*PRIMERY KEY,*CHECK
CONSTRAINTS,*UNIQUE. UE.

ANS Create table custo


ustomer and apply PRIMERY KEY & UNIQUE
UN
CONSTRAINTS
Create table customer apply NOT NULL & CHECK CONSTRAINTS

Syntax Create table customer (cust_id varchar(10) not null,


cust_name varchar(30) check (cust_name=upper(name)), cust_add
varchar(50), city varchar(10) check(city in
(‘Mumbai’,’Delhi’,’Kolkata’,’Chennai’)) state varchar(20));
Q. 14 Select two fields from the table using following clauses (1)) Ord
Order by,
(2) Distinct.
ANS Use Distinct or order
er by command.
Q.15 Select fields from the table and aapply ORACLE functions like *AVG(), *MAX(),
AX(), *MIN(),
*MI
*COUNT(), *ABS(), *POWER(), (), *ROUN
*ROUND().

ANS APPLY ‘’AVG’’ FUNCTION

APPLY ‘’MAX” FUNCTION


APPLY “MIN”FUNCTION

APPLY “COUNT” FUNCTION


APPLY “ABS” FUNCTION

APPLY “POWER” FUNCTION

APPLY “ROUND” FUNCTION


Q.16 Apply the WHEREE cl clause on Client (cid, cname, salary,
ary, cadd,
c city,
state) table with (1) Selec
elect (2) Delete (3)To insert data into
to some
s other
table.

ANS (1) Select

(2)Delete
Insert data into som
some other table
Q. 17 Create a table and app
apply ALTER TABLE command on the table.
ble.

ANS Create table

• Alter table Add anot


another column mphone

• Alter table modify


ify ccolumn size
Q.18 Retrieve client infor
nformation like cust-id, cust-name,, city for
customer where field City
City= Delhi or Baroda.

Q. 19 Create tabless and relate them by using foreign


ign key
k and
reference table.
Primary key

Foreign key & refere


ference

You might also like