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

DATABASE

➢ TABLE EMPLOYEE:-
Employee_ID Employee_Name Job_Title Salary Bonus Age Manager_ID
1201 Divya President 50000 NULL 29 NULL
1205 Amyra Manager 30000 2500 26 1201
1211 Rahul Analyst 20000 1500 23 1205
1213 Manish Salesman 15000 NULL 22 1205
1216 Megha Analyst 22000 1300 25 1201
1217 Mohit Salesman 16000 NULL 22 1205
Primary key- Employee_ID
Foreign key- Manager_ID
SQL COMMANDS:-
1. Create above the table:
CREATE TABLE EMPLOYEE
(Employee_ID Integer Primary Key,
Employee Name Varchar(15),
Job Title Varchar(12),
Salary Decimal(10,2),
Bonus Integer,
Age Integer,
Manager_ID Integer Foreign Key );

2. Insert values as shown above:


INSERT INTO Employee
Values( 1201,” Divya”, “President”, 50000, 9);
INSERT INTO Employee
Values(1205,”Amyra”, “Manager”,30000,2500,26,1201);
INSERT INTO Employee
Values(1211“Rahul”, ”Analyst”, 20000, 1500, 23, 1205);
INSERT INTO Employee
Values(1213,”Manish”,”Salesman”,15000,22, 1205);
INSERT INTO Employee
Values(1216, “Megha”, “Analyst”,12000, 1300, 25,1201);
INSERT INTO Employee
Values(1217, “Mohit”, “Salesman”, 16000, 22, 1205);

3. Delete Employee having Employee_ID 1217:


DELETE FROM Employee
WHERE Employee_ID= 1217

4. Update the salary of “Amyra’’ to 25000:


UPDATE Employee
SET Salary= 25000
WHERE Employee Name= ”Amyra”

5. Alter the table Employee so that NULL values are not allowed for
age column:
ALTER TABLE Employee
ADD CONSTRAINT Age
NOT NULL;

6. Query to display names and salaries of those employees whose


salary are greater than 20000:
SELECT Employee Name, Salary
FROM Employee
WHERE Salary> 20000

7. Query to display details of employees who are not getting any


bonus:
SELECT Employee_ID, Employee Name, Job Title, Salary,
Age,Manager_ID
FROM Employee
WHERE Bonus= NULL
OR
SELECT *
FROM Employee
WHERE Bonus= NULL

8. Query to display names of employees whose name contains


“a”as the last alphabet:
SELECT Employee Name
FROM Employee
WHERE Employee Name LIKE “%a”

9. Query to display Employee Name and Job Title of those


employees whose Manager_ID is 1201:
SELECT Employee Name, Job Title
FROM Employee
WHERE Manager_ID= 1201

10. Query to display Employee Name and Job Title of the employees
whose manager is “Amyra”:
SELECT EmployeeName, Job Title
FROM Employee
WHERE Manager=”Amyra”

11. Query to display the Employee Name and Job Title of employees
aged between 26years and 30years (both inclusive):
SELECT Employee Name, Job Title
FROM Employee
WHERE 26<=Age>=30
➢ RAILWAY COMPANY DETAILS:-

TABLE NAME: Machine TABLE NAME: SALES

Field Data Type Field Data Type


Machine_ID CHAR(3) Machine_ID CHAR(3)
Station CHAR(30) Date DATE
Tickets_Sold INTEGER
Income DECIMAL(8,2)

Primary key of the table Machine is Machine_ID


Primary key of the table Sales is Machine_ID and Date.

SQL Commands:-

1. Create table Machine and Sales:-


CREATE Machine
(Machine_ID CHAR(3) Primary key,
Station CHAR(30));

CREATE Sales
(Machine_ID CHAR(3)
Date DATE
Tickets_Sold INTEGER
Income DECIMAL(8,2)
Primary key (Machine_ID , Dates));

2. Query to find number of tickets machines in each


station:-
SELECT DISTINCT
COUNT (Machine_ID)
FROM Machine

3. Query to find total ticket income of the station “New


Delhi” each day:-
SELECT SUM (Income)
FROM Sales,Machine
WHERE Station=”New Delhi”

4. Query to find total number of tickets sold by the machine


(Machine_ID=122) till date:-
SELECT SUM (Tickets_Sold)
FROM Sales,Machine
WHERE Machine_ID=122 and Date<= GETDATE()
OPERATING WEB
➢Analyze scenario of the following and explain
the steps of project development cycle:-
ONLINE TUTORING:
• Online courses and tutorials help the user in learning like
using software, video game.
• In online tutoring, the students and the teachers are at
physically different locations, which provides freedom to
the learner to learn at their convenient location,
convenient time and at their own pace of learning.
• There is no discrimination of age, caste, gender,
background, or the qualification of Tutorials may be
enriched with audio and video information, which makes
learning more enjoyable and attractive.
• Tutorials and tests are available for almost all topics,
sometimes in regional languages also.
• The tutorials may require different kinds of interaction
with the user, for example, Video/slide tutorials where the
video or slides of lectures are available. The learner can
visit the site and watch the tutorials.
• Interactive tutorials require the user to follow the
instructions, perform the desired action and get a
feedback.
• Webinars are real time lectures, where users participate in
the lecture, may ask questions.
❖ SOME ONLINE EDUCATIONAL SITES:

1. KHAN ACADEMY : Khan Academy is an educational


website created in 2006 .
2. w3schools.com: Offers free tutorials in all web
development technologies like HTML.

3. http://www.ncert.nic.in/index.html - NCERT portal that


provides online learning resources in the form of e-books,
journals ,etc.
• In addition to learning, there are several sites where
students can test themselves. For example:
http://www.britishstudy.com/quizzes/gramm
ar-test.php
ONLINE MATRIMONIAL BUREAU:
• Matrimonial websites, or marriage websites, are a variation of the
standard dating websites.
• Matrimonial sites are popular in India and among Indians settled
overseas, as an alternative to the traditional marriage broker.
According to the Associated Chambers of Commerce and Industry
in India, the online matrimony business is expected to be a $250
Million business by 2017. According to The New York Times, there
are over 1500 matrimony websites in India.
• Matrimonial sites register users, after which they are able to
upload their profile onto a searchable database maintained by the
website. Those users looking to find suitors search the database
with customized searches that typically include nationality, age,
gender, availability of photograph and often religion, geographic
location and caste(mainly for websites based in India).
• There have been reports of abuse of information obtained from
matrimonial websites.
• Some examples of Matrimonial sites are www.Jeevansathi.com ,
www.Shaadi.com , www.Simplemarry.com ,etc.
ONLINE TICKET BOOKING
• Online booking of tickets provides an easy method to book tickets
without doing any movement using different portals such as the
Indian Railway Catering and Tourism Corporation (IRCTC) online
portal.
• To use this portal you need to check you have a web browser and
an Internet connection on your computer.
• Open the browser and type the website address of IRCTC i.e.
https://www.irctc.co. in/ in the address bar. Press ENTER.


• Web page opens.
• For booking a ticket, you need to have an account on the IRCTC
website. If you already have an account in IRCTC, then type your
username and password and login.
• If you are not an existing user, you need to create your account.
You need to sign up on the IRCTC website, to perform any
transaction.
• Once your account has been created, now you can perform
transactions.
• Now to book the ticket:-
• On the “Plan My Travel” box on the left side of the page, enter the
details, i.e. the start station, end station, date on which you want
to travel, ticket type (e-ticket) and your quota. Next, click on <Find
Trains>.
• A list of available trains with information about availability of
tickets will be displayed.
• Now fill all the entries as per your requirements.
• After you have checked the fares and you are ready to book a
ticket, click on <book>.
• Enter the detail of the persons for whom you are booking the
tickets, like, name, age, sex, birth/seat preference (lower, middle,
upper), and check the box, if you are a senior citizen.
• Once you have filled in the details press <enter>, the page
showing your booking details will be displayed.
• Once your payment is done using any mode of payment such as
debit card, credit card, etc, you can view your ticket.
• An electronic copy of your paid ticket is shown on the screen.
Also, your ticket will be e-mailed to you at the email address you
have specified in the registration form.
ONLINE SHOPPING
Online shopping is an e-commerce application where the customer
can purchase goods over the Internet.
➢ Explore the following sites for online shopping:-

AMAZON.COM
Amazon is a multinational American company which focuses on e-
commerce which allow us to shop a vast varieties of goods in some
discounted rates and different payment options.
HOMESHOP 18.COM

HomeShop18 is an Indian online and on-air shopping


channels for household materials, gadgets and all other
stuffs of every field.
Ebay.in
eBay is an American multinational e-commerce corporation,
that facilitates consumer-to-consumer and business-to-
consumer sales through its website.
JAVA PROGRAMING
Java is a class-based, high level, object-oriented programming language
that is designed to have as few implementations dependencies as
possible, which require code writing for once and can be viewed
anywhere on any platform.

➢ Program writing in Java:-

1. Program to implement the formula


Area= length*breadth*height :-

public class Area of rectangle


{
public static void main(String[] args)
{int num1=length , num2=breadth , num3= height;
Area= num1*num2*num3;
System.out.println(“area of rectangle=”+area);
}
}

Output-: area of rectangle =num1*num2*num3


2. Program to find the result of following
expressions:-
(Assume a=20 and b=30)
I. a%b
public class Modulus of a and b
{
public static void main( String[]args)
{int a=20, b=30, modulus;
modulus= a%b;
System.out.println(“a %b=” );
}}

Output: a%b= 10

II. a/=b
public class Divide and Assignment
{
public static void main(String[]args)
{int a=20, b=30,a;
a= a/=b;
System.out.println(“ a/=b is”);
}}

Output:- a=a/=b = 0
III. (a+b*100)/10
public class Operator
{
public static void main(String[]args)
{int a=20, b=30, Num;
Num= (a+b*100)/10;
System.out.println(“Num=(20+30*100)/10”);
}}

Output: Num(20+30*100)/10= 302

IV. a&&b
public class Nested if
{
public static void main(String[]args)
{int a=20, b=30, a&&b;
If (a<b) and (a=a+b>b)
System.out.println(“true”);
else
system.out.println(“false”);
}}

Output:- true
V. a++
public class Increment
{
public static void main(String[]args)
{int a=20,num;
Num=a++
System.out.println(“Num=”);
}}

Output: - 21

➢Program to print square of every alternate


number in an array: -

Public class Square of every alternate number


{
public static void main(String[]args)
{int arr[] = {5,25,3,25,4,2,25};
For(int i=0 ; arr.length; i= i+2)
s= arr[i]*arr[i]
Sstem.out.println(s)
}

Output:- s=
➢Program to enable user to handle divide by
zero exception:-
public class Handle by Zero Exception
{
public static void main(String[]args){
try
{int a!=0, b=0,Num;
Num= a/b}
catch( Arithmetic exception e)
{ System.out.println(“e”);
}
{System.out.println(“rest of the code”);
}
}

You might also like