Bca 3 Sem File
Bca 3 Sem File
Bca 3 Sem File
A III Semester
Software
Laboratory III
Session 2014-15
SUPERVISION
Dr. Neeraj Dubey
(Professor and Head, Dept. of Physics)
GUIDED BY
MISS JAYA SONI
MR. PRAMOD SEN
Submitted By
Name :MAHENDRA KUMAR PATEL
Enroll No: J/87401
Roll No. : 2162157
DEPARTMENT OF BCA
Contents:o Introduction to DBMS
o
Characteristics
Modern DBMS has the following characteristics:
Entity-Relationship Model
Entity-Relationship model is based on the notion of real world entities
and relationship among them. While formulating real-world scenario
into database model, ER Model creates entity set, relationship set,
general attributes and constraints.
ER Model is best used for the conceptual design of database.
ER Model is based on:
[Image: ER Model]
Entity
An entity in ER Model is real world entity, which has some properties
called attributes. Every attribute is defined by its set of values, called
domain.
For example, in a school database, a student is considered as an entity.
Student has various attributes like name, age and class etc.
Relationship
one to one
one to many
many to one
many to many
Relational Model
The most popular data model in DBMS is Relational Model. It is more
scientific model then others. This model is based on first-order
predicate logic and defines table as an n-ary relation.
Normalization
If a database design is not perfect it may contain anomalies, which are
like a bad dream for database itself. Managing a database with
anomalies is next to impossible.
Non-prime attribute: an attribute, which is not a part of primekey, is said to be a non-prime attribute.
X is a superkey or,
A is prime attribute.
(SQL)
STURCTURE QUERY
LANGUAGE
SQL(Structure Query
language)
Table of Contents
1. Introduction To SQL
4.INSERT INTO
5.UPDATE
1.Introduction To SQL
SQL (Structured Query Language) is a database
computer language designed
For managing data in relation database management
system (RDMS).
SQL, is a standardized computer language that
was originally developed by IBM for querying,
altering and defining relational databases, using
declarative Statements.
SQL
SQL
SQL
SQL
SQL
can
can
can
can
can
1.1
Data Definition
Language
statement.
CREATE an object (a table, for example) in the
database.
DROP deletes an object in database.
ALTER modifies the structure an existing from
various ways-for adding a columns to an existing
table.
SQL
Description
CREATE
INSERT INTO
READ
SELECT
UPDATE
UPDATE
DELETE
DELETE
2.3 Queries
1.CREATE TABLE
Before you start implementing your tables In the
database, you should always spend sometime design
your tables properly using a design tool like, e.g.,
Erwin, Toad Data Modeler Power Desiger, Visio, etc.
This is called Database Modeling.
FOREIGN KEY
CHECK
DEFAULT
IDENTITY
In the sections below we will explain some of these in
detail.
)
GO
SCHOOL:
CLASS:
CREATE TABLE CLASS
(
ClassId int IDENTITY(1,1) PRIMARY KEY,
SchoolId int NOT NULL FOREIGN KEY
REFERENCES SCHOOL (SchoolId),
ClassName varchar(50) NOT NULL UNIQUE,
Description varchar(1000) NULL,
)
GO
4.INSERT INTO
The INSERT INTO statement is used to insert a new
row in a table. It is possible to write the INSERT INTO
statement in two forms. The first form doesn't specify
Example:
This form is recommended!
INSERT INTO CUSTOMER (CustomerNumber,LastName, FirstName, AreaCode,
Address, Phone)
VALUES ('1000', 'Smith', 'John', 12, 'California', '11111111')
Example :
5.UPDATE
PRACTICAL NO. 1
Create Table for Student Information Like Name, age add, Place
Class etc. Using Create Table Command.
Syntax :- Create table name (column name data type size).
Sql > create table student.
(
Name char (10),
Age Numeric (3),
Add. Archer (30),
Phone no. (10),
ADDRESS
Snah nagar
Civil line
Gopalganj
PHONE
98564554565
98654795665
98657512365
CLASS
B.C.A
B.C.A
B.C.A.
DOB
14-11-1996
07-05-1995
11-06-1996
AGE
ADDRESS
Rizban
19
Snah nagar
TYPE
Syntax :-
PHONE
98567895665
CLASS
DOB
B.C.A.
12/02/1994
AGE
Rizban
19
PRACTICAL NO. 3
AGE
ADDRESS
PHONE
CLASS
DOB
Rizban
Praveen
Ram
19
20
19
Snehanagar
Civil line
Gopalguanj
9858655856
9745656335
9826564231
B.C.A
B.C.A.
B.C.A.
10/02/1994
11/05/1995
12/06/1993
82
86
84
ADDRESS
PHONE
CLASS
DOB
Rizban
Praveen
Ram
Snehanagar
Civil line
Gopalguanj
9858655856
9745656335
9826564231
B.C.A
B.C.A.
B.C.A.
10/02/1994
11/05/1995
12/06/1993
82
86
84
AGE
Rizban
Praveen
Ram
19
20
19
ADDRESS
PHONE
Snehanagar 9858655856
Civil line
9745656335
Gopalguanj 9826564231
CLASS
DOB
B.C.A
B.C.A.
B.C.A.
10/02/1994
11/05/1995
12/06/1993
82
86
84
PRECTICAL NO.4
AGE
19
20
19
19
ADDRESS
Snehanagar
Civil line
Gopalguanj
Manorama
PHONE
8103659856
9657854566
9175956575
9987484566
CLASS
B.Com
B.Com
B.Com
B.Com
DOB
14/02/1994
06/05/1995
21/06/1993
12/05/1998
Bablu
22
sadar
9748796789
B.Com
10/12/1994
Bunty
19
Manorama
9587484569
B.Com
16/05/1998
2. LIKE:We can use of this command see the same any value.
Syntax :-sql>*from student where name like s%
STUDENT
NAME
ram
Bunty
AGE
19
19
ADDRESS
Gopalganj
Manorama
PHONE
8475956596
9587484569
CLASS
B.Com
B.Com
DOB
25/06/1993
16/05/1998
5 BETWEEN:-we can use of this command see the data of its specify
range.
Syntax:- sql>select * from student where age between 17+19
STUDENT:NAME
Rizban
AGE
19
ADDRESS
Snehanagar
PHONE
9856475849
CLASS
B.Com
DOB
12/02/1994
ram
19
Gopalganj
8475956596
B.Com
25/06/1993
Bunty
19
Manorama
9587484569
B.Com
16/05/1998
PRACTICAL NO. 5
AGE
19
ADDRESS
Snehanagar
PHONE
9856475849
CLASS
B.Com
DOB
12/02/1994
PRACTICAL NO. 6
Run commands like, drop table, rollback, delete and commit, commands.
AGE
19
20
ADDRESS
Snehanagar
Makroniya
PHONE
9856475849
9652124596
CLASS
B.Com
B.Com
DOB
12/02/1994
15/05/1995
DATA STRUCTURE
USING C
History Of C Language
C seems a strange name for a programming. But this strange sounding
language is one of the most popular computer languages today because it is a
structured, high-level, machine independent language. It allow software
develop program without worrying about the hardware platforms where they
will be implemented.
The root of all modern language is ALGOL, introduced in the early
1960s. ALGOL was the first computer language to use a block structure.
Although it never becomes popular in USA, it was widely used in Europe.
ALGOL gave the concept of structured programming to the computer science
community.
In 1967, Martin Richards developed a language called BCPL (Basic combined
programming language) primarily for waiting system software. In 1970, Ken
Thompson created a language using many feature of BCPL and called it
simply B.B was used to create early version of UNIX operating system at bell
Laboratories Both BCPL and B were typeless system programming
languages.
For many years, C was used mainly in academic environments, but eventually
with the release the of many C compilers for commercial use and the
increasing popularity of UNIX, it began to gain widespread support among
computer professionals. Today C is running under a variety of operating
system and hardware platform.
During 1970s, C had evolved into what is now as traditional C. the language
become more popular after publication of the book The c programming
language by brain kerning ham and Dennis Ritchie in 1978. the book was so
popular that the language came to be know as k&R C among the
programming community. The rapid that development of different version of
the language that were similar but often incompatible. This posted a serious
problem for system developers.
All popular computer language are dynamic in nature. The continue to
improve their power and scope by incorporation new feature and C is no
exception.
Introduction Of C Language
A programming language us designed to help certain kinds of data consisting
of a numbers, character and string and to provide useful output know as
information. The task of processing of data is accomplished by executing a
sequence of precise instruction called a program. These introductions are
formed using certain symbol and word according to some rigid rules knows as
system rules (or grammar). Every program introduction must confirm
precisely to the syntax rules of the language.
Character Set
The character that can be used to from words, numbers and expression depend
upon computer on which the program is run. However, a subset of character is
available that can be used on must personal, micro, mini and mainframe
computer. The character in C is grouped into the following categories.
1.
2.
3.
4.
Letters
Digit
special character
white space
TABLE NO.1.1
Symbol
Meaning
Symbol
Meaning
Comma
Period
Semicolon
Colon
Question Mark
Exclamation marks
Left Parenthesis
Right parenthesis
Left bracket
Right bracket
Left brace
Right brace
<
>
Slash(forward)
Backslash
Vertical bar
Tilde
Plus sign
Minus sign
Pound sign
Percent sign
Underscore
Caret
&
Ampersand
Asterisk
Equal sign
<>
Fig:-1.1
Fig:-1.2
Documentation section
Link section
Definition section
Global declaration section
Main function
{
Declaration part
Execution part
}
Subprogram section
Function 1
Function 2
Function n
In regards to: User define function
Simple Program
Consider a very simple program given in fig 1.3
main
{
/*printing begins...*/
printf (welcome to C);
/*printing ends..*/
}
S
Fig 1.3
}
void push(struct stack * ps, int x)
{
if(isful(ps))
{
printf(stack over flow);
return;
}
ps - > top =ps-> top+1;
ps - > item [ps->top]=x;
}
int pop(struck stack * ps)
{
int x;
if(isempty(ps))
{
printf(stack is under flow);
return(-9999)
}
x=ps->item[ps->top];
ps->top = ps->top-1;
return;
}
void display(struct stack * ps)
{
int I;
if(isempty(ps))
{
printf(\n stack is empty);
return;
}
for (i=0;i<=ps->top;i++)
printf(\t%d,ps->item[i]);
}
int isempty (struct stack * ps)
{
if(ps->top = = -1)
return (1);
else
return(0);
}
int isful(struct stack * ps)
{
if(ps->tip = = maxtask-1)
return(1);
else
return(0);}
front= temp;
elese
rear->nest=temp;
reat= temp;
}
int delete1()
{
int num;
struct queue *temp;
if(front = = NULL)
{
printf(\Nhey!!!!!!!!QUEUE IS ENPTY);
return(-9999)
}
else
{
temp = front ;
num=temp->data ;
front=temp->next;
fRee(temp);
if(front = = NULL)
rear=NULK;
return(num);
}
}
void display ()
{
struct queue * temp;
temp = front;
if(front = = NULL&&rear = = NULL)
{
printf(OHOOOOOO QUEUE IS EMPTY);
}
while(tem! = NULL)
{
printf(%d\t, temp-> data);
temp = temp-next;
}
}
top=temp;
}
int pop()
{
struct link *temp;
int ele;
if
(top = = NULL)
{
printf(STACK IS EMPITY);
return(-9999)
}
else
temp=top;
ele=temp->data;
top=top->next;
free(temp);
return(ele);
}
{
struct link *temp;
if(top==NULL)
{
printf(\n STACK IS EMPITY);
return;
}
else
temp=top;
while(temp!=NULL)
{
printf(%d, temp=>data);
temp=temp->next;
}
}
PROGRAMMING
IN COBOL
7
Indicator (I)
Serial no.
(4-6)
*
/
(both for
nonexecutable
statement)
(For
continuation)
8-11
Area A
Or (A)
Margins A
Division/
section/
paragraph
12-72
Area B
Or (B)
Margins B
All
executable
statement
73-80
Identification
(I)
Remarks
Positive
1-6
7
8-11
12-7
72-80
Field
Sequence
Indicator
Area A/Margin A
Area B/Margin B
Identification
IDENTIFICATION DIVISION.
PROGRAM ID. HELLO.
ENVIROMENT DIVISION.
DATA DIVISION.
PROCEDURE DIVISION.
MAIN()
DISPLAY HELLO!
DISPLAY WELCOME TO THE WORLD OF COBOL:
STOP RUN.
Output:HELLO
WELCOM TO THE WORLD OF COBOL.
Output:Enter A=6
Enter B=3
MUL=A*B
A*B=C
Answer is C=18
IDENTIFICATION DIVISION.
PROGRAM-ID.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77
A
PIC 99
77
B
PIC 99
77
C
PIC 99
77
D
PIC 99
PROCEDURE DIVISION.
MAIN()
DISPLAY Enter A .
ACCEPT A.
DISPLAY Enter B .
ACCEPT B.
DIVIDE A BY B GIVING C REMAINDER D.
DISPLAY Answer is C.
DISPLAY Remainder is D.
STOP RUN.
IDENTIFICATION DIVISION.
PROGRAM-ID.
ENVIRONMENT DIVISION.
DATA DIVISION.
WORKING-STORAGE SECTION.
77
A
PIC 999
77
B
PIC 999
PROCEDURE DIVISION.
MAIN()
DISPLAY Enter A .
ACCEPT A.
DISPLAY Enter B .
ACCEPT B.
IF A>B.
DISPLAY Greater number is A.
ELSE.
DISPLAY Greater number is B.
STOP RUN.
Output:Enter A
3
Enter B
4
Greater Number is
4
Output:ENTER P:
5000
ENTER T:
5
ENTER R:
3
PROCESSING ..
SINPLE INTEREST
0075.00
Output:5*1=5
5*2=10
5*3=15
5*4=20
5*5=25
5*6=30
5*7=35
5*8=40
5*9=45
5*10=50