COMPUTER SCIENCE ENGINEERING

Second Year

Subject : Sql, Photoshop, Pagemaker

Paper - II

Time : 3 Hours Max. Marks : 50

1. (a) Write the SQL commands for creating a table named CSE with the following attributes.

StuRollno, Studentname,feespaid,dateofjoining.

StuRollno should be declared as unique.

Ans:

Query: create table cse(sturollno number(5),studentname varchar2(20),feespaid number(5),dateofjoining date);

Output:Table created.

Query:SQL> alter table cse add primary key(sturollno);

Output:Table altered.

(b) Insert Five records in the above table CSE.

Query:

SQL> insert into csevalues(001,'venkat',500,'11-apr-2013');

1 row created.

SQL>insert into csevalues(002,'Shiva',600,'15-apr-2013');

1 row created.

SQL> insert into csevalues(003,'Ganesh',650,'18-aug-2013');

1 row created.

SQL>insert into csevalues(004,'Gayathri',650,'19-aug-2013');

1 row created.

SQL> insert into csevalues(005,'Gowri',400,'20-aug-2013');

1 row created.

(c)Write a query to display the student rollno and date of joining.

SQL> select sturollno, studentname from cse;

OUTPUT

STUROLLNO STUDENTNAME

------

1 venkat

2 Shiva

3 Ganesh

4 Gayathri

5 Gowri

2. Write and demonstrate the following queries for the below table.

Table name :Emp

EmpnoEnameSalaryDepartment

1001Rahul6000Accounts

1002Salman8000I.T

1003Aziz12000Sales

1004Ravi9000I.T

1005Priyanka10000Sales

(a) Query to display records of employees working in I.T. department

Query:

SQL select * from emp where department='I.T.'

EMPNO ENAME SALARY DEPARTMENT

------

1002 Salman 8000 I.T.

1004 Ravi 9000 I.T.

(b) Query to display records of employees whose salary is greater than 8000.

Query:

SQL> select * from emp where salary>8000;

Output:

EMPNO ENAME SALARY DEPARTMENT

------

1003 Aziz 12000 Sales

1004 Ravi 9000 I.T.

1005 Priyanka 10000 Sales

(c) Query to display records of employees whose name is Rahul.

Query:

SQL> Select * from emp where ename='Rahul';

Output:

EMPNO ENAME SALARY DEPARTMENT

------

1001 Rahul 6000 Accounts

(d) Query to display records of employees working in I.T and Accounts department.

Query:

SQL> select * from empwhere(department='I.T.' or department='Accounts');

EMPNO ENAME SALARY DEPARTMENT

------

1001 Rahul 6000 Accounts

1002 Salman 8000 I.T.

1004 Ravi 9000 I.T.

(e) Query to display records of employees whose salary is between 4000 and 9000.

Query:SQL> select * from emp1 where(salary>=4000 and salary<=9000);

Output:

EMPNO ENAME SALARY DEPARTMENT

------

1001 Rahul 6000 Accounts

1002 Salman 8000 I.T.

1004 Ravi 9000 I.T.

3.Write and demonstrate the following SQL queries

(a) Query to display the date

Query:

SQL> select sysdate from dual;

Output:

SYSDATE

------

08-JAN-14

(b) Query to add two strings “Computer” and “Science”

Query:

SQL> select concat('Computer', 'Science')from dual;

CONCAT('COMPUTE

------

ComputerScience

c) Query to display the length of string “Computer Science Engineering”

Query:

SQL> select length('ComputerScienceEngineering') "Length" from dual;

Length

------

26

(d) Write the PL-SQL program to print sum of 1 to 100 numbers using loopand endloop.

:SQL> set serveroutput on

Program:

SQL> declare

a number (5)=0;

b number (5);

c number (5);

begin

c:=&c;

for b in 1...c loop

a:=a+b;

end loop;

dbms_output.put_line(a);

end ;

/

OUTPUT:

Enter value for c: 12

old 6: c:=&c;

new 6: c:=12;

78

Pl/sql procedure successfully complet

4. (a) Write the PL-SQL program for generating numbers between 1 and 100 using while loop.

DECLARE

Num NUMBER(3):= 1;

VarVARCHAR2(1000);

BEGIN

WHILE (Num<=100)

LOOP

Var :=Var||' '||Num;

Num:=Num+1;

END LOOP;

DBMS_OUTPUT.PUT_LINE(Var);

END;

Output:

(b) Write the PL-SQL program to accept two number A and B and print the sum of it.

(c) Query to display the string “Computer Science” in capital letters.

Query:SQL> select upper('Computer Science') from dual;

UPPER('COMPUTERS

------

COMPUTER SCIENCE

(d) Query to display the string “COMPUTER SCIENCE” in small letter.

Query:SQL> select lower('COMPUTER SCIENCE') "Lower" from dual;

Lower

------

computer science

(e) Query to display the square root of 25.

Query:SQL> select sqrt(25) "Square Root" from dual;

Square Root

------

5

5. (a) Write the SQL Command for creating the table student with following attributes.

Rollno, Studentname,Fathername,Address,Mobileno.

Mobile number should not be empty.

Query:SQL> create table student(rollno number(3),studentname varchar2(15),fathername varchar2(15),addressvarchar2(10),mobileno number(11));

Output:

Table created.

Query: SQL> alter table student add primary key(mobileno);

Output:Table altered.

(b) Insert five records in the above table.

SQL> insert into student values(1,'sindhu','satyanarayana','vanapalli',9703406063)

1 row created.

SQL> insert into student values(2,'lakshmi','srinivas','khandriga',9734062324);

1 row created.

SQL> insert into student values(3,'kalyani','sastry','kothapeta',9999999999);

1 row created.

SQL> insert into student values(4,'jitendra','prasad','mukkamala',8888888888);

1 row created.

SQL> insert into student values(5,'dharmendra','krishna','kothapeta',7777777777);

1 row created.

(c) Delete all the rows from the above table

SQL> delete from student where rollno=1;

1 row deleted.

SQL> delete from student where rollno=2;

1 row deleted.

SQL> delete from student where rollno=3 ;

1 row deleted.

SQL> delete from student where rollno=4;

1 row deleted.

SQL> delete from student where rollno=5;

1 row deleted.

(d) Delete the table student.

SQL> drop table student;

Table dropped.

6. Identify and demonstrate the following tool from Pagemaker.

(a)Use the Texttool to type, select and edit text.

(b)Use the Rotatingtool to select and rotate objects.

(c)Use the Croppingtool to trim imported graphics

(d)Use the Rectangletool to draw squares and rectangles.

(e)Use the Ellipsetool to draw circles and ellipses.

(f)Use the Zoomtool to magnify or reduce an area of the page.

(g)Use the Save to save the file.

(h)Use the Pointertool to select, move, and resize text objects and graphics.

7. Identify and Demonstrate the following tools from photoshop.

(a)CropClick the tool button, then click and drag the tool over the part of the image that you want to keep. Resize the selected area dragging the squares at the sides and corners. Click the Return/Enterkey when your crop box is sized correctly.

(b)TypeTypes text on a page. Every time you click the Type Toolon a new portion of the

page, a new layer will be created.

Select the type tool, click on the page and begin to type. You can specify the font and

size in the Options bar. You can also resize and transform the text box by dragging the

squares at the sides and corners. Use the Move Toolto move the text on the page.

(c)EraserRemoves part of an existing path or stroke. You can use the Erasetool on paths. Text can only be erased when rasterized.

Select the tool, click on the part of the image you wish to erase. Drag to erase pixels.

(d)Clone StampTakes a sample of an image and applies over another image, or a part of the

same image.

Select the tool. Hold down the ALTkey and left-click on a certain point of the document where you want to start your copy point. Then, put your mouse over whatever part of the new document you want the picture to go to. Hold down the left mouse button and drag the mouse across the page to copy the picture.

(e)LassoSelects an object by drawing a freehand border around it.

Click the tool button, drag to draw a freehand border around the are of the image you wish to select.

(f)MagnifyMagnifies or reduces the display of any area in your image window.

Select the tool, choose Zoom Inor Zoom Outin the Optionsbar, click on the area of the image you wish to magnify or reduce.

(g)MarqueeSelects an object by drawing a rectangle or an ellipse around it.

Click the tool button, choose a rectangular or an elliptical marquee. Drag the marquee over the area of the image you wish to select.

(h)

8. Write and Demonstrate the following commands in pagemaker

(a) To display the page numbers on all the pages

Adding Pages to the Publication:

– Go to the place where you would like to insert pages.

–From the Layout Menu choose Insert Pages.

– Type the number of pages that you would like to add.

– Click Insert.

(b) The use of Autoflow command

(c) Inserting the images in page maker.

Step 1: Open page maker window.

The page maker window contains the title bar, menu bar, tool bar, colors palette, tool box, Templates palette, picture palette and control palette.

Step 2: Select “new” from “File” menu to start the new publication

Step 3: Select “Place” option from “File” menu.

Step 4: Go to the location where the picture resides.

Step 5: Select the picture and select “open” button.

Step 6: Place the cursor where to place the picture.

Step 7: Press the “left click button” of the mouse.

(d) Enter the college name and change the following

Font size : 30

Font Name : Arial

Type Style:Bold

Step 1: Open pagemaker window.

The page maker window contains the title bar, menu bar, tool bar, colors palette, tool box, Templates palette, picture palette and control palette.

Step 2: Select “new” from “File” menu to start the new publication

Step 3: Select “Text” option from tool box to type the text.

Step 4: Type “College name” “Government Junior college, Kothapeta, E.G.Dt.”

Step 5: Select the text

Step 6: From control palette

(a) select font size “30”.

(b) Select font type “Arial”.

(c) Select “B” button from the Text Tool Bar for “Bold”.

(e) Add two images and demonstrate the Bring to Front and Send to Back command.

Step 1: Open Page maker

Step 2: Select “New” from “File” menu.

Step 3: Configure the publication and select “ok”.

Step 4: Select “Place” option from “File” menu.

Step 5: Goto the location and select the images and select “ok”.

Step 6: Select the image.

Step 7: Select “Arrange” option from “Element” menu of menu bar.

Step 8: Select “Send Backward” option

Result: This operation move the selected image file to the back of the another image.

Step 9: Select back image from the two images.

Step 10: Repeat Step 7 & 8.

Step 11: Select “Bring to Front” option.

Result: This operation moves the second image to the front.

(f) Cropping the Image

Step 1: Click the tool button.

Step 2:Click and drag the tool over the part of the image that you want to keep.

Step 3: Resize the selected area dragging the squares at the sides and corners.

Step 4: Click the Return/Enterkey when your crop box is sized correctly.

9. Write and Demonstrate the following in Photoshop

(a) Insert an image

Step 1: Select “open” option from “File” menu.

Step 2: Goto the location where the photo is saved.

Step 3: Select the image stored in the disk

Step 4: Select “Open” button from “Open” Dialog box.

(b) Increase the canvaz size to 15 cm width and 20 cm height

Step 1: Select “New” from file menu.

Step 2: Select “OK” button from the “New” dialog box.

Step 3 : Select “Canvas Size” option.From “Image” menu item.

Step 4: Provide measurements as

a) 15 in “width” and change measurements as “cm”

b) 20 in “Height” and change measurements as “cm”

Step 5: Select “ok” button.

(c) Demonstrate the Lasso tool

LassoSelects an object by drawing a freehand border around it.

Click the tool button, drag to draw a freehand border around the are of the image you wish to select.

(d) Demonstrate the Crop tool

CropClick the tool button, then click and drag the tool over the part of the image that you want to keep. Resize the selected area dragging the squares at the sides and corners. Click the Return/Enterkey when your crop box is sized correctly.

There are several ways to crop images in Adobe Photoshop:

1. Cropping with the Crop Tool

2. Cropping to a specific size

3. Cropping with the Marquee Tool

(e) Demonstrate the slice tool

10. Demonstrate the following

(a) Query in SQL to display the date

Query:

SQL> select sysdate from dual;

Output:

SYSDATE

------

08-JAN-14

(b) Write an PL-SQL program to display the odd numbers from 1 to 100.

Program:

BEGIN

FOR I IN 1..100

LOOP

IF MOD(I,2)!=0 THEN

DBMS_OUTPUT.PUT_LINE(I);

END IF;

END LOOP;

END;

Output:

1 3 5 7 9 … 93 95 97 99

(c) Demonstrate the use of Autoflow command in pagemaker.

(d) Change the back ground color of any layer in Photoshop.

The foreground color appears in the upper color selection box and represents a color that is currently active. The background color appears in the lower box and represents an inactive color in the tool box.

To change the background color,

Step 1: click the lower color selection box in the Toolbox.

Step 2: Select the color from the color picker dialogue box.

Step 3: Select “ok” button of color picker dialogue box.