0% found this document useful (0 votes)
78 views31 pages

RSV Hr. Sec. School1692960046548 PDF

This document contains a student's project file submission for an Information Technology class. It includes a certificate signed by the teacher, Mrs. Sandhya Parasar, acknowledging completion of the project. It also includes an acknowledgements section thanking Mrs. Parasar and the student's parents for their support. The file contains various sections on SQL topics like datatypes, commands, queries and an introduction to Java.

Uploaded by

dnaislive
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
78 views31 pages

RSV Hr. Sec. School1692960046548 PDF

This document contains a student's project file submission for an Information Technology class. It includes a certificate signed by the teacher, Mrs. Sandhya Parasar, acknowledging completion of the project. It also includes an acknowledgements section thanking Mrs. Parasar and the student's parents for their support. The file contains various sections on SQL topics like datatypes, commands, queries and an introduction to Java.

Uploaded by

dnaislive
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 31

INFORMATION TECHNOLOGY

PROJECT FILE

CLASS- 12 G

SUBMITTED TO SUBMITTED BY
MRS.SANDHYA PARASAR STUDENT NAME
MR.MANEET KAPILLA MOHIT
CERTIFICATE

This is to certify that your


MOH name
I T of class 12
Arts/Commerce has successfully completed
his/her Information Technology Project file
under the guidance of Mrs.
M RSandhya
.MANEE Parasar.
T KAPILA

MR.MANEET KAPILLA
Mrs.Sandhya Parasar
ACKNOWLEDGEMENT

I would like to express my special thanks of gratitude to


my teacher MMrs.R . M Sandhya
ANEET KAParasar
P I L L A who gave me the
golden opportunity to do this wonderful project file of
“Information Technology” , Who also helped me in
completing my project file. I came know about so many
new things I am real ly thankful to them.
Secondly, I would also like to thank my parents and
friends who helped me a lot in finalizing this project within
the limited time frame.

MOHIT
Your name
Class 12 GC
INDEX
SNO TITLE PAGE SIGNATURE
NO
1. IMPORTANT TERMS
IN SQL

2. DATATYPESUSED
IN SQL

3. COMMANDS USED
IN SQL

4. SQL QUERIES
5. INTRODUCTION TO
JAVA
6. JAVA PROGRAMS
IMPORTANT TERMS IN SQL
1. Database: A database is an organised collection of data. Software used to manage
databases is called Data Base Management System (DBMS).

2. Relational Database: A database in which the data is stored in the form of


relations (also called tables) is called a Relational Database. In other words a
Relational Database is a collection of one or more tables.

3. RDBMS: A DBMS used to manage Relational Databases is called an RDBMS


(Relational Data Base Management System). Some popular RDBMS software
available are: Oracle, MySQL, Sybase, Ingress

4. Benefits of using a DBMS are:


a. Redundancy can be controlled
b. Inconsistence can be avoided
c. Data can be shared
d. Security restrictions can be applied.
5. MySQL: It is an Open Source RDBMS Software. It is available free of cost.

6. Relation/Table: A table refers to a two dimensional representation of data arranged


in columns (also called fields or attributes) and rows (also called records or tuples).
The tables in a database are generally related to each other to facilitate efficient
management of the database. Interrelated tables also reduce the chances of errors
in thedatabase.

7. Key: A column or a combination of columns which can be used to identify one or


more rows (tuples) in a table is called a key of the table.

8. Primary Key: The group of one or more columns used to uniquely identify each row
of a relation is called its Primary Key.

9. Candidate Key: A column or a group of columns which can be used as the primary
key of a relation is called a candidate key because it is one of the candidates
available to be the primary key of the relation

10. Alternate Key: A candidate key of a table which is not made its primary key is called its
Alternate Key.

11. SQL (Structured Query Language): It is the language used to manipulate and
manage databases and tables within them using an RDBMS.

12. A row is called a Tuple.


13. A column is called an Attribute.

14. A table is called as a Relation.

15. The data type of values in each column is called the Domain.

16. The number of attributes in a relation is called the Degree of a relation.

17. The number of rows in a relation is called the Cardinality of a relation.

18. DDL (Data Definition Language): This is a category of SQL commands. All the
commands which are used to create, destroy, or restructure databases and tables
come under this category. Examples of DDL commands are - CREATE, DROP,ALTER.

19. DML (Data Manipulation Language): This is a category of SQL commands. All the
commands which are used to manipulate data within tables come under this
category. Examples of DML commands are - INSERT, UPDATE, DELETE.

20. DCL (Data Control Language): This is a category of SQL commands. All the
commands which are used to control the access to databases and tables fall under
this category. Examples of DCL commands are - GRANT, REVOKE.

21. Relation Schema R is denoted by R (A1, A2, A3,…, An) where R is the relation name
and A1, A2, A3,….An is the list of attributes.

22. Relation State is the set of tuples in the relation at a point in time. A relation state
r of relation schema R (A1, A2, ..., An), denoted r(R) is a set of n-tuples r = {t1, t2,....,
tm}, where each n-tuple is an ordered list of values t = <v1, v2, ...,vn>, where vi is in
domain of Ai or is NULL. Here n is the degree of the relation and m is the
cardinality of the relation.
DATATYPES USED IN SQL

Data type Meaning Example

CHAR (n) Fixed length character


string. CHAR(5):“Ashok”
'n' is the number of “Vijay”
characters.
VARCHAR(n) Variable length
character string. 'n' is VARCHAR(15):
the maximum number “Vijay Kumar”
of characters in the “Ashok Sen”
string.
DATE Date in the form of DATE: '2014-03-20'
YYYY-MM-DD
INTEGER Integer number 23 56789

DECIMAL (m, d) Fixed point number m DECIMAL(5,2) : 999.99


represents the number of -567.78
significant digits that are DECIMAL (5) : 23456
stored for values and d 99999
represents the number of
digits that can be stored
following the decimal
point. If d is zero or not
specified then the value
does not contains any
decimal part.

TOUR
COMMANDS USED IN SQL
SNO Command, Syntax, and Purpose Category
1. Command: CREATE DATABASE DDL
Syntax: CREATE DATABASE <databasename>;
Purpose: Creates a database with the specified name.
2. Command: CREATE TABLE DDL
Syntax: CREATE TABLE <tablename>
(<column name1> <data type1>
[,<column name2> <data type2>,
.
.
<column nameN> <data typeN>]
);
Purpose: Creates a table with the specified name.

3. Command: ALTER TABLE DDL

Syntax: ALTER TABLE <tablename>

ADD <columnname> <datatype>; ALTER TABLE


<tablename>
DROP <columnname>; ALTER TABLE <tablename>
MODIFY <column> <new_definition>;

Purpose: Modifies the structure of a table


4. Command: USE DML

Syntax: USE <databasename>;

Purpose: Opens the specified database for use.

5. Command: SELECT DATABASE() DML

Syntax: SELECT DATABASE();

Purpose: Shows the name of the current database

6. Command: SHOW TABLES DML

Syntax: SHOW TABLES;


Purpose: Shows a list of tables present in the current
database.

7. Command: INSERT DML

Syntax: INSERT INTO <tablename>

[<column1>, <column2>, ..., <columnn>] VALUES


(<value1>, <value2>, ... <value n>);
Purpose: Inserts data into a table
8. Command: SELECT DML

Syntax: SELECT <* / column name / expression> ,

[<column name/Expression list>]

FROM <table name>

[WHERE <condition>]

[ORDER BY <column name / expression>


[ASC/DESC]];

There are multiple ways to use SELECT.


These will be explained with the help of
examples in this lesson.

Purpose: Retrieves data from a table

9. Command: DESCRIBE DML

Syntax: DESC[RIBE] <tablename>;

Purpose: Shows the structure of a table.

10. Command: UPDATE DML

Syntax: UPDATE <tablename>

SET <column name> = <value>


[,<column name> = <value>, …]

[WHERE <condn>];

Purpose: Updates/Modifies data in a table

11. Command: DELETE DML

Syntax: DELETE FROM < tablename>


[ Where < condition>];

Purpose: Deletes data from a table


Following are the clauses which can be used
with SELECT command:

a. DISTINCT Used to display distinct values from a column of a table.

b. WHERE Used to specify the condition based on which rows of a table are
displayed.

c. BETWEEN Used to define the range of values within which the column
values must fall to make a condition true. Range includes both
the upper and the lower values.

d. IN Used to select values that match any value in a list of Specified


values.

e. LIKE Used for pattern matching of string data using wildcard


characters % and _ .

f. IS NULL / Used to select rows in which the specified column is NULL (or is
NOT NULL NOT NULL)

g. ORDER BY Used to display the selected rows in ascending or in descending


order of the specified column/expression.
SQL QUERIES:

Q.1 Pranay, who is an Indian, created a table named “Friends” to store his friend’s
detail. Table “Friends” is show below. Write commands in SQL and output also.

S_No Name Age City Country Email_Id


1 Alice 14 Washington USA alice@gmail.com
2 Charles 12 Copenhagen Denmark Charles@yahoo.in
3 Angle 16 Chicago USA angle@gmail.com
4. Jasmine 15 Sydney Australia Jasmine@yahoo.com
5. Raj 14 New Delhi India raj@gmail.com
6. Jette 13 Nykobing Denmark jette@gmail.com
7. Alexander 15 Melbourne Australia Null
8. Shashank 16 Bangalore India Null

i) Query for table creation


ANS

create table friends(sno integer primary key,Name varchar(30),Age integer,City


Varchar(30), Country varchar(30),Email_id varchar(30));

ii) To display list of all foreigner friends.


ANS

select name,city from friends where COUNTRY <> "INDIA";


iii) To list name, city and country in descending order of age.
ANS

select name,age,city,country from friends order by(age)desc;

iv) To count how many friends have email id on gmail.


ANS

select name,count(email_id) from friends;


v) To list name and city of those friends who don’t have an email id.
ANS
select name,city,email_id from friends where email_id is NULL;

vi) Select name, country from friends where age>12 and name like ‘A%’;
ANS

SELECT NAME, COUNTRY FROM FRIENDS WHERE AGE>12 AND NAME


LIKE "a%";

vii) Select ucase(concat(name,’*’,city)) from friends where country like ‘Denmark’.

ANS
Select ucase(concat(name,’*’,city)) from friends where country like "Denmark";

Q.2 Consider the following table ‘Activity’. Write commands in SQL and output
also.

Table: Activity
PID PARTICIPANT GRADE EVENT POINTS EVENTDATE HOUSE
101 Amit Dubey A Running 200 2018-12-19 Gandhi
102 Shivraj Singh Hopping 300 2019-01-12 Bose
bag
103 Raj Arora B Skipping 200 2018-12-19 Gandhi
104 Kapil Raj A Bean 250 2018-12-19 Bhagat
bag
105 Deepshikha Sen A Obstacle 350 2018-03-31 Bose
106 Solani Raj Egg & 200 2018–12-20 Bose
Spoon

i) Query for table creation


ANS

create table activity(PID integer primary key,Participant varchar(30),Grade


char(1),Event varchar(30),Points integer,Eventdate date,House varchar(30));
ii) To displayed names of Participants and points in descending order of points.
ANS

select participant,points from activity order by(points) desc;

iii) To displayed names and points of participants who have scored points in the range
200 and 300 (both values included).
ANS

select participant,points from activity where points between 200 and 300;
iv) To display the names and EVENTDATE of participants who took part in the event
anytime in the month of December of 2018.
ANS

select participant,eventdate from activity where eventdate>"2018-12-01";

v) To display all details of participants whose names ends with ‘raj’ as well as event
ends with ‘bag’ in descending order of their participant name.
ANS

Select participant,event from activity where participant like "%Raj" or event like
"bag" order by (participant) desc;
vi) To change the name of Event “Egg & Spoon” to “Lemon & Spoon” everywhere in
the table ‘Activity’.
ANS

update activity set event="Lemon & Spoon" where event="Egg & Spoon";

vii) Select PID, Grade, House from Activity where Instr(Event,’in’) = 5;


ANS

Select PID, Grade, House from Activity where Instr(Event,"in") = 5;


viii) Select avg(points) from Activity where Grad is not null;
ANS

select avg(points) from activity where grade is not null;


JAVA INTRODUCTION
 JAVA is an Object Oriented programming language as well a
platform.

 By using JAVA, we can write Platform independent application


programs, which can run on any type of OS and Hardware.

 JAVA is designed to build Interactive, Dynamic and Secure applications


on network computer system.

 Java facilitates development of Multilingual applications because JAVA


uses 2-Byte UNICODE character set, which supports almost all
characters in almost all languages like English, Chinese, Arbic etc.

Characteristics of JAVA
 Object Oriented Language

Java is Object Oriented Language (a real-world programming style)

 Open Source Product

It is Open Source i.e. freely available to all with no cost.

 Write Once Run Anywhere (WORA)

JAVA Program can be run on any type of H/W and OS platforms i.e. Java
programs are platform independent.

 Light Weight Code

Big applications can be developed with small code.

 Security

JAVA Programs are safe and secure on Network.

 Interpreter & Compiler based Language

JAVA uses both Compiler and Interpreter (JVM) to produce portable and
platform-independent object code.

 Built-in Graphics & Supports Multimedia


JAVA is equipped with Graphics feature. It is best for integration of Audio,
Video and graphics & animation.

Why JAVA is Platform Independent?


A program written in HLL must be converted into its equivalent
Machine code, so that computer can understand and execute. This
conversion is known as Compilation. Generally, the converted
machine code depends on the structure of H/w and OS platform. So
that a Windows program will not work on UNIX, or LINUX or Mac
platform etc. Since they are Platform dependent.
A program written in JAVA is platform-independent i.e. they are not
affected with changing of OS. This magic is done by using Byte code.
Byte code is independent of the computer system it has to run upon.
Java compiler produces Byte code instead of native executable code
which is interpreted by Java Virtual Machine (JVM) at the time of
execution.
JAVA PROGRAMS

1. Simple array program


2. Simple array program using for loop on integer values

3. Simple array program using for loop on String values

3. Simple array program using for loop on String values

4. Array Sorting
4. Array Sorting

5. Simple array program using for loop on integer values

5. Simple array program using for loop on integer values


6. String Manipulation

7. User Defined Methods

7. User Defined Methods


8. BOOK class with output

9. Getter and Setter Methods-example 1

9. Getter and Setter Methods-example 1


10. Getter and Setter Methods-example 2
11. Using binarySearch() method in arrays

11. Taking input data from user

12. Taking input data from user


13.Exception program

12. EXCEPTION PROGRAM AFTER HANDLING EXCEPTION

14. EXCEPTION PROGRAM AFTER HANDLING EXCEPTION


15 . Constructor with parameters—example
16. Constructor without parameters—example

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy