Download as pdf or txt
Download as pdf or txt
You are on page 1of 63

Macro Vision Academy

Practical Assignments
Class-X (IT-402)

Practical Assignment
On
DIGITAL DOCUMENTATION (ADVANCED)
(OPEN OFFICE WRITER):

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 1: Identify the components of the
following open office writer screen:

There are many menus and toolbars that make up the interface of OpenOffice
components:
• Title Bar
• Menu Bar
• Standard Toolbar
• Formatting Toolbar
• Rulers
• Text Area / Document Area S
• Scroll bars
• Drawing Toolbar
• Status Bar

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 2: Column and Column Format

1. Create a new text Document and type the following text as shown below:

Computer programming language, any of various languages for expressing a set of


detailed instructions for a digital computer. Such instructions can be executed directly
when they are in the computer manufacturer-specific numerical form known as machine
language, after a simple substitution process when expressed in a
corresponding assembly language, or after translation from some “higher-level” language.
Although there are many computer languages, relatively few are widely used.

Machine and assembly languages are “low-level,” requiring a programmer to manage


explicitly all of a computer’s idiosyncratic features of data storage and operation. In
contrast, high-level languages shield a programmer from worrying about such
considerations and provide a notation that is more easily written and read by
programmers.

Language types
Machine and assembly languages
A machine language consists of the numeric codes for the operations that a particular
computer can execute directly. The codes are strings of 0s and 1s, or binary digits (“bits”),
which are frequently converted both from and to hexadecimal (base 16) for human viewing
and modification. Machine language instructions typically use some bits to represent
operations, such as addition, and some to represent operands, or perhaps the location of
the next instruction. Machine language is difficult to read and write, since it does not
resemble conventional mathematical notation or human language, and its codes vary from
computer to computer.

2. Click Format>>Page. In Page Style dialog box, click Page tab and set the
bottom margin as 6.0”.
3. Click Format>>Column and choose a three column format. Set the Spacing
between columns as: 0.49”.
4. Click Insert>> Header. Type PROGRAMMING LANGUAGE. Align the header
as centered.
5. Save the file as Programming Language.odt. Notice that your writer screen
looks as given below:

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 3: Mail Merge

A Document containing letter for all friends about Diwali festival.


A data source file containing your best 10 friends’ names and addresses
spreadsheet.

Creating a Data Source


1. Open OpenOffice.Org Writer
2. Start a New Text Document.
3. Click File Ò Wizards Ò Address Data Source (Notice that the Data Source
Wizard window appears)
4. Select the appropriate type of external address book- in this case , other
external data source.
5. Click Next. On the next page of the Wizard.
6. Click Settings. Notice that database type window appears as shown below:
7. In the Data Source Properties dialog , select the Database type (in this case ,
spreadsheet)
8. Click Next.
9. In the next dialog, click Browse and navigate to the spreadsheet that contains
the address information.)
10. Select the spreadsheet (address)
11. Click open which returns you to the Connection setting window.
12. Click Finish.
13. In the following dialog click next. Do not click field assignment because this
is a spreadsheet.
14. Finally, click Finish button to complete the database connection wizard. The
data source is now registered.
Creating a Form Letter:

To

I am glad to inform you that I am going to celebrate my 14th


birthday on 25-10-2021. I may kindly invite you to celebrate
with my family and me.
Yours truly,

Pyare Mohan Awasthi

Note: Write down all practical only in Practical File with proper indexing.
To merge the fields into form letter,
1. Click View->Data source or click F4 key.
2. Noticed that the form letter appears with Data source on the top of the form
letter as shown in figure.
3. Click the Address database and Sheet1 as shown in figure
4. Click just below of To in form letter.
5. Click and drag the Name field header into the Form letter. Notice that the
Name field is inserted in the Form letter as shown in figure.
6. Press Enter key to move next line.
7. Click and drag the address field header. Similarly insert remaining fields as
shown in figure
8. Finally, you will see the complete Form letter with data fields as shown figure
Where you will find the document is now ready to be printed.

Using the Mail Merge Wizard


This feature to merge data with form letter. To merge through Mail Merge Wizard.
1. Open the previous Fletter.odt file which contains the merged fields of
Address spreadsheet database.
2. click Tools -> Mail Merge Wizard.
The Merge Wizard option as shown:
The wizard gives us eight steps to perform MAIL MERGE. Out of all steps,
you may escape some of the steps to perform mail merge.
The wizard gives various options to select your starting document:
• Use the current document.
• Create a new document.
• Use a template.
• Use an existing document.
• Select Use the current document and click Next.
3. Select Letter and click Next which will open the Insert address block window
as shown in fig.
4. click Next.
5. Click Next to skip create salutation step.
6. Click next
7. Click Next
8. Click next
9. click next. You have now completed the mail merge process.

10. Finally click Finish button. You will notice that the merged document is
created with all data sources containing four letters in four different pages.

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 4: Template

Prepare a Sports certificate document of your school by using the certificate


template provided by the word processing document.

Ø Selecting a template:
1. Go to File> New. You will be displayed with different types of templates.
2. Select the Certificates option. You will be displayed with a list
of Certificate templates.
3. Now select any of the templates by double-clicking on it.
4. Now you can use this template and customize the contents by replacing
the school name, student name, etc

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 5: Types of Style

Q1. Explain the styles given in the Styles and Formatting Window for writer
and paste the screen shot of the window also.

Ans. OpenOffice.org supports the following types of styles:


1. Page styles
2. Paragraph styles
3. Character styles
4. Frame styles
5. Numbering styles
6. Cell styles
7. Graphics styles
8. Presentation Styles

Lab Work 6: create NEW STYLE in Open Office


Writer.

Write the steps to create new style in Open Office Writer.

Ans. We can create New (Custom) Styles in following ways

1. Creating a new style from a selection:

1. Open the Styles and Formatting window and choose the type of
style you want to create.
2. In the document, select the item you want to save as a style.
3. In the Styles and Formatting window, click on the New Style
from Selection icon.
4. After Clicking on New Style from Selection, create style dialog
box appear.
5. Write the name for the new style and click on OK.

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 7: 0n Understanding and use of
table of various commands

1. Insert a row above the first row and merge all cells and write
heading: Inter-House Cricket final Score Board – Blue House.
2. Insert an image in front of heading and split merged cells into two
columns and one row
3. Align the text and image properly
4. Insert a row below the second row and insert data: 3, Akashay, Not
Out, 85, 53, 6, 3
5. Delete a row 5 having data of Nirbhay
6. Insert columns after 6s column and give the heading strike rate and
calculate the strike rate manually and write it accordingly
7. Insert row below the last row for a total

Note: Write down all practical only in Practical File with proper indexing.
Practical Assignment
On
ELECTRONIC SPREADSHEET ADVANCED
(OPEN OFFICE CALC):

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 1: Components of a OpenOffice Calc
Window

Open OpenOffice Calc. Click on Start button-> OpenOffice Calc->


Spreadsheet.
OpenOffice Calc screen appears with blank sheet
Open a worksheet and try to identify its components.
components of a OpenOffice Calc window shown below:

• Title Bar
• Menu Bar
• Standard toolbar
• Formula bar
• Scroll bars
• Active Cell
• Row header
• Sheet tab
• Formatting toolbar
• Column header
• Sidebar
• Status bar
• Create worksheet

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 2: On Create Worksheet,
Rename a Worksheet,
Add a new worksheet,
Remove a worksheet:

Create worksheet, and perform the following


1. Rename a worksheet:
Worksheet in the Calc workbook are named as Sheet1, Sheet2 and so
on
a. Right click on the sheet name in the sheet tab and choose Rename
Sheet from the the shortcut menu.
b. Give a suitable name and press Enter to change the name.
2. Add a new worksheet:
Follow the given steps to add a new worksheet.
a. Click Insert Menu-> Sheet option.
OR
Right click on the sheet tab and select Insert Sheet.
The Insert Sheet dialog box appears
b. Select the position and number of sheets and click OK.
3. Remove a worksheet:
You can remove an unwanted worksheet from the workbook. Follow
the given steps to remove a worksheet:
a. Right click on the desired sheet tab and select Delete Sheet option.
b. Click Yes for the confirmation. The selected sheet will be deleted.

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 3: Components of Charts

Charts:
Charts are pictorial or graphical representation of mathematical
information in a worksheet.
Components of a chart:
Before we start creating a chart, it is important to know the various
components that constitute a chart.
Fig. Also

The various components of a chart are:


• Chart Area
• Plot Area
• X-axis
• Y-axis
• Data Series
• Chart Title
• Axes Titles
• Legend
• Data Labels
• Gridlines

Note: Write down all practical only in Practical File with proper indexing.
Inserting Charts:
Method 1: Calc can figure out an appropriate chart for you on its own.
1. Select the data to be included in the chart.
2. Click the Chart icon on the standard toolbar. The Chart Wizard dialog
box appears.
3. Select the required chart type and click on Finish button.
Method 2:
To create a chart of your choice, follow the given steps:
1. Select the cells that contain the data to be included in the chart. If the
required data is not in consecutive columns, then select the columns
you want by keeping the Ctrl key pressed while selecting the cells or
range of cells.
2. Click on Insert->Chart. This opens the Chart Wizard dialog box.
3. Choose the required chart type and click on Finish button.
This creates the desired chart for you on the current worksheet.

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 4: CONSOLIDATED DATA

1. Creating a spreadsheet having different worksheets whose data you


want to consolidate. In this example, following worksheets are created.
• Consolidated
• North
• South
Consolidated sheet will sum the sales from North, South, sheets. The
Consolidated sheet as shown below:

fig. Consolidated Sheet


2. The worksheet North and South are as follows:

Note: Write down all practical only in Practical File with proper indexing.
fig. North India Sales Sheet

fig. South India Sales Sheet

3. Define the ranges of all the sheets. Select the ranges of cells of
consolidated sheet where you want to have the result of addition of
data. Name this ranges as Con21 in name box as shown below:

Note: Write down all practical only in Practical File with proper indexing.
4. Similarly select the data in North and South sheets and give range
name as North21 and South21 as shown below:

5. Place the cursor in Consolidated Sheet C5 cell and the click Data->
Consolidate option to open the Consolidate dialog box

Note: Write down all practical only in Practical File with proper indexing.
fig. Click Consolidate Option
6. Consolidate dialog box appears as shown below. Click the drop-down
list under the label Function and select Sum.

fig. Selecting SUM function

7. Click Source Data Range drop-down menu and select North21 and
click Add option as shown below:

Note: Write down all practical only in Practical File with proper indexing.
fig. Adding ranges
8. Similarly select the ranges name for South. Consolidated ranges appear
as shown below:

fig. Adding ranges

9. Now specify where you want to consolidate this data. This can be done
using specifying range of the consolidated sheet where you want to
consolidate the data. Select Con21 of the consolidate sheet to
consolidate the data in that sheet as shown below

Note: Write down all practical only in Practical File with proper indexing.
10. Consolidate dialog box specifies source range and target range as
shown below.

11. click OK. Data will be consolidated to the consolidated sheet as shown
below

fig.: Output of Data Consolidation

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 5: SUBTOTALS

1. Create a spreadsheet having sales data of a company for different years.


The aim is to find the subtotal of the sales of the company year wise.

Fig.: Spreadsheet with Sales Data


2. Select the range of cells for which you want to find subtotal as shown
below:

fig.: Selecting range of cells

Note: Write down all practical only in Practical File with proper indexing.
3. Click Data->subtotal option

4. Subtotal window appears on the screen as shown below.


5. In the Group by list , select the column by which the subtotals needed
to be grouped. A subtotal will be calculated for each distinct value in
this column.
6. In the Group by list, select Year to to group by year. In the calculate
subtotals, click Sales to find subtotals of sales year wise.
7. In user function option, click sum to find sum of sales year-wise as
shown below.

Note: Write down all practical only in Practical File with proper indexing.
8. Click OK. Subtotals corresponding to years is obtained as shown below.

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 6: On SCENARIO

1. Create a scenario with sales of cars as shown:

Fig. Best Case Scenario

2. Select the No. of cars column of the sheet.

Fig. Selecting Columns


3. Click Tools ->Scenario option to create a scenario.

Note: Write down all practical only in Practical File with proper indexing.
Fig. Creating Scenario
4. Create Scenario window appears on the screen as shown below. Enter
Scenario Name under Name of Scenario and uncheck Copy back
Option. Click OK

Fig. Creating Scenario

5. Best scenario is created and you can check it by clicking on the arrow
on the top of selected column.

Note: Write down all practical only in Practical File with proper indexing.
6. Now change the number of cars to minimum number so as to create
worst sale number as shown below:

Note: Write down all practical only in Practical File with proper indexing.
7. Select the No. of cars columns and Click Tools-> Scenario option to
create a new scenario as shown below. Name it as Worst case.

Fig. Creating Worst Case Scenario


8. Now two different scenario are created. Same way you can create more
scenarios and by clicking on any scenario you can select that scenario
as shown below. You can create several scenarios for any given range
of cells.

Fig. Selecting Scenario

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 7: GOAL SEEK

You can use Goal Seek to find out how many marks you need in the
class test to pass the class.

Fig. Marks in Different tests

In the above example, the goal is to find the marks in test 5 so that
the overall marks in all tests are 350. The four inputs are given and
output needed is 350. The goal is to find how much marks are needed
to get overall score of 350.
The steps to do goal seek are as follows:

1. Select the cell containing the value that you want to change i.e. cell
containing the formula i.e. overall marks as shown below:

Note: Write down all practical only in Practical File with proper indexing.
2. Click Tools->Goal Seek option as shown below:

Fig. Starting Goal Seek

Note: Write down all practical only in Practical File with proper indexing.
3. Goal seek window appears on the screen as shown below:

Fig. Goal Seek Window

4. In the goal seek window, the various options are as follows:


Formula Cell: is the target cell where you want to have the desired
value. In our case we want to have value of 350. This cell contains
address of cell where value of 350 is to be achieved.
Target value: it displays the target value i.e. 350
Variable Cell: variable cell contains address of cell whose value will
change to achieve target value i.e. address of Test 5 cell.
5. Enter address and values and click Ok. Goal Seek successful window
appears on the screen. Click Yes.

6. The result will appear in the specified cell as shown below. In our
example, Goal Seek calculated the marks in Test 5 to obtain overall
350 marks.

Note: Write down all practical only in Practical File with proper indexing.
Fig. Goal Seek determined Value

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 8: CREATING REFERENCE TO OTHER
SHEETS

Using multiple workbooks and linking cells is used to calculate data


across multiple worksheets. The steps to create multiple sheets are as
follows:
1. Create a worksheet with multiple workbooks as shown below:
• Detailed
• Maths
• English
• Science

Fig.a Detailed Workbook

Note: Write down all practical only in Practical File with proper indexing.
Fig.b Maths Workbook

Fig.c English Workbook

Note: Write down all practical only in Practical File with proper indexing.
Fig.d Science Workbook

2. Select the total column of the Maths workbook. Right click mouse
button and click copy on popup menu as shown below:

Fig.e Copying Data

3. Move to Detailed worksheet and click in the Maths columns and


then right click mouse button. Pop up menu appears on the screen
and click Paste Special option as shown below:

Note: Write down all practical only in Practical File with proper indexing.
fig f: Pasting data
4. Paste Special window appears on the screen. Select Link Option and
press OK.

fig g: Linking data

5. Data from Maths workbook is pasted on the Detailed workbook as


shown below:

Note: Write down all practical only in Practical File with proper indexing.
fig h: Data after pasting(1)

6. If you make any change in the data in maths workbook, the data gets
automatically updated in detailed workbook. Data from maths
workbook gets linked to maths columns of detailed workbook.
7. Similarly link (copy and Paste) the data from English and Science
workbook.

fig h: Data after pasting(1a)

8. Apply the sum formula and find the sum of marks in detailed
workbook. Output is obtained as follows

fig: output after linking data


Note: Write down all practical only in Practical File with proper indexing.
Lab Work 9: CREATING A MACRO

1. Open a new spreadsheet.


2. Enter the following numbers in spreadsheet as shown below.

Fig. Data in Spreadsheet

Note: Write down all practical only in Practical File with proper indexing.
3. Click in Cell A2 which contains value 4 and right click the mouse
button. Popup menu appears and select copy option. Value 4 is copied
to the clip board.

Note: Write down all practical only in Practical File with proper indexing.
4. Select the cells in the range A1:C3.

Note: Write down all practical only in Practical File with proper indexing.
5. Click Tools->Macro->Record Macro to start the macro recorder.

6. The Record Macro dialog box is displayed with a stop recording button
as shown below.
7. Click Edit->Paste Special to open the Paste Special dialog box

Note: Write down all practical only in Practical File with proper indexing.
Note: Write down all practical only in Practical File with proper indexing.
8. Select the operation to Multiply and click OK. The cells are now
multiplied by 4.

Note: Write down all practical only in Practical File with proper indexing.
9. Click Stop Recording to stop the macro recorder. The Open Office.org
Basic Macro dialog box appears as shown below:

10. Select the current saved document (simple macro.ods) and write the
name of macro (Multiply) and click Save.
11. New Module dialog box appears with name of module. Click OK.

12. Macro Multiply is now created. after you have recorded a macro. You
can execute it.

Note: Write down all practical only in Practical File with proper indexing.
EXECUTING THE MACRO:
When you execute the macro, it performs the same steps that you
performed during the record operation. To execute the macro, use the
following steps:
a. Select cell A1.
b. Click Tools-> Macro-> Run Macro to run the macro.

Note: Write down all practical only in Practical File with proper indexing.
c. The Macro Selector Window displays as follows

d. Select the macro and click Run.

Note: Write down all practical only in Practical File with proper indexing.
e. Cells A1 to C3 are multiplied by 4. Output is displayed as
follows:

Note: Write down all practical only in Practical File with proper indexing.
Practical Assignment
On
DATA BASE MANAGEMENT SYSTEM
(ADVANCED)

Lab Work 1: On create table with minimum five


fields on an entity "STUDENT" in design view

Write the steps to create table with minimum five fields on an entity
"STUDENT" in design view.
We will design the following table

Field Name Data Type Constraint


ID Integer Primary Key
Name Varchar
Address Varchar
Phone Varchar
DOB Date

Note: Write down all practical only in Practical File with proper indexing.
1. Click on Create Table in Design View… option available under Tasks
and a Table Design window appears as shown below.

2. Specify the field name and data type of the field to be created as
shown below.

3. In the gray box at the left of the line, right-click and select
Primary Key, bringing up a key icon in the box

4. Save the table (File > Save)

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 2: Create a database for Employee &
execute the queries

Create a database for Employee & execute the queries.


EmpDetails(E_Id, E_name, City, Account_no, Salary)

a. Enter any five employee details.


b. Display all details from the Employee table.
c. Display all employees in sorting order based on
salaries.
Procedure:
Ø Create a database object: Employee
§ Double-click on the OpenOffice.org shortcut on the desktop.
§ Select the option Database to launch the base application.
§ A dialog box will be opened. Select ‘Create a new database’
§ Click Finish.
§ The Save As dialog box appears.
§ Specify a name „Employee‟ for the database in the File name:
field and click Save.

Ø Create a Table: EmpDetails


Tables are the basic building blocks of a database. You store the data
in the database in the form of tables.
Steps:
1) Click on Create Table in Design View…option available
under tasks and a Table Design window appears.
2) Specify the field name and data type of the field to be created
by selecting the appropriate type available under Field type
dropdown list.
3) Set the Primary key for e_id.
4) Save the table design.
5) Select the Table EmpDetails displayed in the Tables list.
6) Enter the required data.

Note: Write down all practical only in Practical File with proper indexing.
Output:
(a) Table Design:

EmpDetails Table:

(b) Display all details from the Employee table:

select * from EmpDetails;

(c) Display all employees in sorting order based on salaries.


select * from EmpDetails order by "Salary";

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 3: Create a database for Student
Details & execute the queries

Create a database for Student Details & execute the queries.


Students(adm_no, stu_name, stu_cls, contact_no, city, marks)
a) Enter any five student details.
b) Display only stu_name & stu_cls from the table.
c) Display all the data of students whose marks is more than
45.
Procedure:

Ø Create a database object: Student


§ Double-click on the OpenOffice.org shortcut on the desktop.
§ Select the option Database to launch the base application.
§ A dialog box will be opened. Select ‘Create a new database’
§ Click Finish.
§ The Save As dialog box appears.
§ Specify a name „Student‟ for the database in the File name:
field and click Save.

Ø Create a Table: SDetails


Tables are the basic building blocks of a database. You store
the data in the database in the form of tables.

Steps:
7) Click on Create Table in Design View…option available
under tasks and a Table Design window appears.
8) Specify the field name and data type of the field to be created
by selecting the appropriate type available under Field type
dropdown list.
9) Set the Primary key for adm_no.
10) Save the table design.
11) Select the Table SDetails displayed in the Tables list.
12) Enter the required data.

Note: Write down all practical only in Practical File with proper indexing.
Output:

(a) Table Design:

SDetails Table:

(b) Display only stu_name & stu_cls from the table.

select stu_name,stu_cls from SDetails;

(c) Display all the data of students whose marks is more than 45.

select * from SDetails where marks>45;

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 4: Create a form for Employee Details
to enter the details in the Employee Table.

Procedure:
A form provides the user a systematic way of storing information into the
database.
Steps:
1. To create a form, click on Forms option located under Database
section.
2. Click Use Wizard to Create Form… option under Tasks
group. The Form Wizard dialog box appears.
3. You can select selective fields to be sent onto the form by
selecting the field name and clicking > button.
4. You can select individual fields in a database or all fields in a
database.
5. To use all the fields in the table in a form, click the >> button.
6. Notice the fields displayed under Fields in the forms section.
7. Click Next>. You see the Set up a sub form step dialog box of the
wizard.
8. You can select the option Add Sub form if you need to insert the
contents in the table in a separate form. Click Next>.
9. Once you have selected a style, click Next>.
10. A dialog box appears wherein you can select the data entry
model. Click Next >.
11. Click Next >. You see a dialog box where you can specify the
name of the form. Click Finish.
12. A form window appears. Notice that the records in the
table are displayed automatically within the form that you
just created.
13. Once you click the symbol, you will be displayed with a
window for creating records.
Output:

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 5: Creating DATABASE TABLE IN
DESIGN VIEW

Note: Write down all practical only in Practical File with proper indexing.
After creating database next step is to create table in the database
The steps in creating table using design view are as follows:
• After saving the Student database, following window appears on the
screen.

• Select Table tab on the left of the screen and then select Create Table
in Design View option to create the table. The following window
appears on the screen.

Note: Write down all practical only in Practical File with proper indexing.
• Enter the field name and data type of the fields that you want to have.
We have created Student table with the following field and data type.

STUDENT TABLE
ROLLNO NUMERICAL
NAME TEXT
MARKS DECIMAL
GRADE TEXT

• Primary Key: Right click the ROLLNO field. A pop up menu appears as
follows. Click the Primary Key option. Now ROLLNO becomes primary
key and a key appears on the left of ROLLNO field.

Note: Write down all practical only in Practical File with proper indexing.
• Click Save option on the toolbar to save the table. Save AS dialog box
appears on the screen. Enter the name of the table and click ok.
• Student table is created. close the window. You are back to the main
window of the database with the listing of the tables queries, forms and
reports.

Note: Write down all practical only in Practical File with proper indexing.
• Double click the Student table. Data view window appears as shown
below. Start entering the data.

• Entered data will appear as follows on the screen. Click Save to save
the data and close the window.

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 6: Creating DATABASE TABLE USING
WIZARD

The steps in creating table using wizard are as follows:


• Create a new database and name it as Employees.
• Select Table tab on the left of the screen and then select Use Wizard to
Create Table option to create the table.
The following window appears on the screen.

• Table Wizard window appears on the screen as shown below. Select


Business to create tables related to business and select Personal to
create tables related to Personal Life.
• Click Sample Table option and select Employees. Available field option
appear on the screen.
• Select the field that you want to have in the table and click > option to
move the field towards selected Fields. Click Next after selecting fields
for the table.
• Set field types and format window appear on the screen. Specify the
data type of all the fields as shown below and click Next

EMPLOYEE TABLE
EMPLOYEEID INTEGER
FIRSTNAME TEXT (VARCHAR)
LASTNAME TEXT (VARCHAR)
CITY TEXT (VARCHAR)
SALARY DECIMAL

• Set Primary key window appears on the screen. In the Employee Table
EmployeeID is the Primary Key because its unique and no two
employees can have same EmployeeID. Select Use an existing field as
primary key option and specify EmployeeID as primary key. Click
Next.
• Create Table Window appear on the screen. Give name to the table and
select Insert data immediately to add data to the Employee table.
• Entered data will appears as follows on the screen. Click save to save
the data and close the window.

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 7: Creating TABLE USING SQL
COMMANDS (DDL COMMANDS)

Write an SQL query to create a Table with the following details:

Field Datatype
Rollno Numeric(12) Primary key
Name Varchar(30)
Fee float
City Varchar(30)

1. Create a new database Student1. After creating database, next step


is to create table in the database. The steps in creating table are as
follows:
2. Click Tools-> SQL option.
3. Execute SQL statement window appears as shown below. Write
SQL query under command to execute section.
4. Write the following SQL statements

CREATE TABLE STUDENT1


( Rollno Numeric (12),
Name Varchar (30),
Fee float,
City Varchar (30));

5. Click Execute option. Command Successfully executed appears on


the screen as shown below and table is created. Close the Execute
SQL statement window.
6. Close the open office base and reopen it. Click at Tables option and
table Student1 appear as shown below

INSERTING DATA IN THE TABLE:


The steps to insert data into a table Student1 are as follows:
7. Open the database in Open office Base.
8. Double click the table name Student1. Table Data View window
appears on the screen as shown below.
9. Enter the data.
10. Click Save to save the data and close the window. Data is
inserted.

Note: Write down all practical only in Practical File with proper indexing.
Lab Work 8: SQL QUERIES

Table: Student
Rollno Class Name Phone_no
1 XII Sumit 1234565
2 X Amit 3564583
3 X Anuj 1236589
4 XI Mini 5869542

1. Display all the records of table Student.


2. Insert record of your choice
3. Display record of student whose roll number is 3
4. Display record of students who are in class 'X
5. Display the record of 'Anuj'

Ans:
1. Select * from student;
2. Insert into student values (5, 'XI', 'Suman' , 6953245)
3. Select * from student where Rollno = 3;
4. Select * from student where class = 'X'
5. Select * from student where name = 'Anuj';

1. (a) Write a Query to create a Table with the following structure:

Table: Product
Field Datatype
PID Char(4)
Pname Varchar(20)
Description Varchar(20)
Price Decimal

Ans:
CREATE TABLE PRODUCT
(PID Char(4),
Pname Varchar(20),
Description Varchar(20),
Price Decimal);

Note: Write down all practical only in Practical File with proper indexing.
(b) consider the following Vendor table and write the queries

Table: Vendor

VendorID VName Date of Location


Registration
V001 Mother 20-01-2009 Delhi
Dairy
V002 Havmor 01-04-2015 Gujarat
V003 Amul 12-05-2012 Kolkata
V004 Kwality 15-10-2013 Mumbai
walls

1. Write a Query to display all records.


2. Write a Query to add a new row with the following details:
3. Write a Query to modify the location of V003 from Kolkata to
Gujarat.
Ans:
1. Select * from “Vendor”;
2. Insert into “Vendor” values (“V005”, “Vadilal”, “2010-03-20”,
“Pune”);
3. Update “Vendor”
Set Location “Gujarat”
Where location =”Kolkata”.
2. Write command to create a table named ‘BOOK’ with following
fields:
BOOKID Char(4),
Bname Varchar(20),
Author Varchar(20),
Price Decimal
Ans:
CREATE TABLE ‘BOOK’
(BOOKID Char(4),
Bname Varchar(20),
Author Varchar(20),
Price Decimal);
3. Write the SQL commands to answer the queries based on Fabric
table
FabricID FName Type Disc
F001 Shirt Woollen 10
F002 Suit Cotton 20
F003 Tunic Cotton 10
F004 Jeans Denim 5
F006 Shorts Cotton 7

Note: Write down all practical only in Practical File with proper indexing.
(a) To Insert the following record
(“F005”, “Kurta”, “Woollen”, “5”);
(b) To display only those fabrics whose disc is more than 10.
(c) To display those record whose type is “Woollen”.
(d) To modify the fabric shirt by increasing discount by 10.
(e) To delete the record of fabric F003 from table.

Ans:
(a) INSERT INTO “Fabric” VALUES (“F005”, “Kurta”, “Woollen”, “5”);
(b) SELECT * FROM “Fabric” WHERE Disc>10
(c) SELECT * FROM “Fabric” WHERE Type= “Woollen”.
(d) UPDATE “Fabric”
Set Disc=Disc+10
Where FName=”Shirt”;
(e) DELETE FROM “Fabric” WHERE FabricID= “F003”;

4. Write SQL query to insert data into Student1 table

Field Datatype
Rollno Numeric(12) Primary key
Name Varchar(30)
Fee float
City Varchar(30)

Ans:

INSERT INTO “Student1” (“ROLLNO”, “NAME”, “FEE”, “CITY”)


VALUES (‘1206’, ‘AMAN’, ‘17500’, ‘PUNE’)

5. Write an SQL query to update name of AMAN to AMANDEEP in


Student1 table.
Ans:
UPDATE “Student1”
SET NAME= “AMANDEEP”
WHERE ROLLNO=”1206”;
6. Write an SQL query to delete record of AMANDEEP from Student1
table.
Ans:
DELETE FROM “Student1”
WHERE ROLLNO=”1206”;
7. Write an SQL query to sort data in Student1 table in descending
order of name.
Ans:
SELECT “ROLLNO”, “NAME”, “FEE”, “CITY”
FROM “STUDENT 1”
ORDER BY NAME DISC;

Note: Write down all practical only in Practical File with proper indexing.
8. Write an SQL query to generate list of students who pay more than
20000 fee.
Ans:
SELECT “ROLLNO”, “NAME”, “FEE”, “CITY”
FROM “STUDENT 1”
WHERE “FEE”>20000;

9. Write an SQL query to generate name and fee of students from


Student1 table.
Ans:
SELECT “NAME”, “FEE”
FROM “STUDENT 1”;

10. Create a SQL query to generate list of all students from Student1
table using wildcard character.
Ans:
SELECT * FROM “STUDENT 1”;

11. Write an SQL query to create a Table with the following details:

Field Datatype
Emp_no Char(4) Primary key
Name Varchar(25)
Salary float
Department Varchar(25)

Ans:
CREATE TABLE EMPLOYEE2
( Emp_no Char(4),
Name Varchar(25),
Salary float,
Department Varchar(25),
);

Note: Write down above practical only in


Practical File with proper indexing.

Note: Write down all practical only in Practical File with proper indexing.

You might also like