RSV Hr. Sec. School1692960046548 PDF
RSV Hr. Sec. School1692960046548 PDF
PROJECT FILE
CLASS- 12 G
SUBMITTED TO SUBMITTED BY
MRS.SANDHYA PARASAR STUDENT NAME
MR.MANEET KAPILLA MOHIT
CERTIFICATE
MR.MANEET KAPILLA
Mrs.Sandhya Parasar
ACKNOWLEDGEMENT
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).
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.
15. The data type of values in each column is called the Domain.
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
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.
[WHERE <condition>]
[WHERE <condn>];
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.
f. IS NULL / Used to select rows in which the specified column is NULL (or is
NOT NULL NOT NULL)
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.
vi) Select name, country from friends where age>12 and name like ‘A%’;
ANS
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
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
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";
Characteristics of JAVA
Object Oriented Language
JAVA Program can be run on any type of H/W and OS platforms i.e. Java
programs are platform independent.
Security
JAVA uses both Compiler and Interpreter (JVM) to produce portable and
platform-independent object code.
4. Array Sorting
4. Array Sorting