class xi assignment {informatics practices}

26
1 MCL SARASWATI BAL MANDIR SR. SEC. SCHOO, L-BLOCK, HARI NAGAR, N.D.- 64 SESSION 2018-19 Class XI Assignment {Informatics Practices} Chapter 15: IT Application Q-1 Define e-governance. How has society benefitted from e-governance? Answer : Q-2 Define e-business. How has society benefitted from e-business? Answer : Q-3 Define e-learning. How has society benefitted from e-learning? Answer :

Upload: others

Post on 11-Nov-2021

6 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Class XI Assignment {Informatics Practices}

1

MCL SARASWATI BAL MANDIR SR. SEC. SCHOO, L-BLOCK, HARI NAGAR, N.D.- 64

SESSION 2018-19

Class XI

Assignment {Informatics Practices}

Chapter 15: IT Application

Q-1 Define e-governance. How has society benefitted from e-governance?

Answer :

Q-2 Define e-business. How has society benefitted from e-business?

Answer :

Q-3 Define e-learning. How has society benefitted from e-learning?

Answer :

Page 2: Class XI Assignment {Informatics Practices}

2

Chapter 16: Table creation and Data Manipulation

Q-4 Create table job with following structure:

Name of column Type Job_id Number(4) Job_des Varchar(30) Alloc_on Date Due_on Date Emp_id Number(4) Ensure the following specifications in the table:

1. Job_id is the primary key.

Answer :

2. Job_des, Alloc_on, Due_on cannot be left blank.

Answer :

3. Emp_id is foreign key here that is related to id column of earlier created table employee.

Answer :

Page 3: Class XI Assignment {Informatics Practices}

3

Q- 5

Add the following data in the above table(Employee) as instructed.

1. Populate table with first record mentioning the column list in the insert clause.

Answer :

2. Populate table with next two records without mentioning the column list in the insert clause.

Answer :

3. Populate table with 4th record and enter only ID and First_Name.

Answer :

4. Populate the table with 5th recorded and enter ID, User_ID, and Last_name only.

Answer :

Q-6 Insert into empl table, the employee numbers, names, and salaries of all those employees of Temp table

that have completed 2 years. The structure of Temp table is as follows:

Enum NOT NULL Number(4)

Ename Varchar(10)

Sal Number(7,2)

Months Number(3)

ID First_Name Last_Name User_ID Salary

1 Dim Joseph Jdim 5000

2 Jagannath Mishra jnmishra 4000

3 Siddharth Mishra smishra 8000

4 Shankar Giri sgiri 7000

5 Gautam Buddha bgautam 2000

Page 4: Class XI Assignment {Informatics Practices}

4

Q-7 In the table EMPL (Chapter 14 ), add a column named THRIFTPLAN of datatype NUMBER with a

maximum of seven digits and two decimal places and a column named LOANCODE of datatype CHAR with a

size of one and an integrity constraint that checks that load code should be one of these characters : ‘E’, ‘C’,

‘H’, ‘P’.

Answer :

Q-9 In the table EMPL (chapter 14), add a column named SPECIAL PAY of datatype NUMBER with maximum

of seven digits with 2 digits after decimal and with a DEFAULT value of 2400.

Answer :

Q-10 In the table EMPL, increase the size of THRIFTPLAM column to nine digits.

Answer :

Q-11 In the table ACCOUNTS, modify the BAL column so that it has a default value of 0.

Answer :

Q-12 Add a PRIMARY KEY data constraint on the column supplier_no belonging to the table supplier_master.

Answer :

Q13. Drop the DNAME column of the DEPT table.

Answer :

Page 5: Class XI Assignment {Informatics Practices}

5

Q1. What is the following command doing?

ALTER TABLE PERSONS ADD CONSTRAINT chk_person CHECK (P_ID>0 AND City=’shimla’);

Answer :

Q2. Given a statement as follows.

CREATE TABLE Orders (O_Id int NOT NULL, OrderNo int NOT NULL, P_Id int, PRIMARY KEY(O_Id), FOREIGN KEY(P_Id)REFERENCES Persons(p_Id)); Identify the number and types of constraint in the table Orders.

Answer :

Q3. Write a SQL Statement to create a PRIMARY KEY constraint on the “P_Id” column of table persons. When the table is already created.

Answer :

Q4. What is the following query doing? ALTER TABLE Persons DROP PRIMARY KEY;

Answer :

Page 6: Class XI Assignment {Informatics Practices}

6

Q5. On your MYSQL server instance, there is a database MYdb that contains three tables namely class, marks., sports. TO delete all the tables and databases, following set of commands is issued, but it generates errors. What could be the problem.

DROP DATABASE mydb; DROP DATABASE class; DROP DATABASE marks; DROP DATABASE sports;

Answer :

Q1. For record with ID = 4 update record with Last_Name.User_ID and Salary.

Answer :

Q2. Make the change permanent.

Answer :

Q3. Modify the Salary and increase it by 1000, for all who get salary less then 5000.

Answer :

Q4. Modify the Last_Name, of the employee 3, to Gautam.

Answer :

Q5. Delete the employee record having First_Name as Siddharth.

Answer :

Q6. Remove the entire contents of the table.

Answer :

Q7. Drop table employee 2.

Answer :

Q8. Add one column Email of data type VARCHAR and size 30 to the table Customer.

Answer :

Page 7: Class XI Assignment {Informatics Practices}

7

Q9. Change the data type of column Pincode to varchar(10) in the table Customer.

Answer :

Q10. Add a FOREIGN KEY reference on the Emoployee2 table that will ensure that employee records with

non-existent department are to be prohibited.

Ans

Answer :

Q11. ADD a PRIMARY KEY constraint to the table Employee2 using the EmpID column.

Answer :

Q12. Add a NOT NULL constraint to the table Employee2 on column EmpName.

Answer :

Q13. Using SWL Statement on MYSQL, create the tables identified below in the following order. Database

name : Univ. Create database if needed. (Underlined column depict primary keys.)

Campus (CampusID, CampusName, street, City, State, pin, Phone, CampusDiscount)

Position (PositionID, LastName, YearlyMembershipfee)

Member (MemberID, LastName, FirstName, CampusAddress, CampusPhone, CampusID,

PositionID, ContractDuration)

Foreign Keys CampusID Campus(CampusID)

PositionID Position(PositionID)

Table Structure Notes :

1. Use the proper naming convention for your constraint :

2. Set up the Primary key for each table with constraint listed.

3. Add your foreign key for each table with constraint listed.

4. Make the data type for all the primary key and their corresponding foreign keys as Varchar (5).

Page 8: Class XI Assignment {Informatics Practices}

8

5. Make the data type for the YearlyMembershipFee decimal 7 digits maximum with 2 digits to the right of

the decimal place .

6. Make the data type for ContractDuration INTEGER with 3 digits maximum for calculation purposes.

7. Make the data type for CampusDiscount decimal, 2 digits maximum with 2 digit to the right of the decimal

place.

Answer :

Answer :

Answer :

Page 9: Class XI Assignment {Informatics Practices}

9

Answer :

Answer :

Page 10: Class XI Assignment {Informatics Practices}

10

CH-14 (SIMPLE QUERIES IN SQL)

Let Us Explore

Consider the sample menagerie database and answer the following queries:

1.SELECT DISTINCT type FROM event WHERE remark IS NULL;

2.SELECT FROM pet WHERE owner LIKE “%e%”;

3.SELECT name,sex FROM pet WHERE pet >= ‘1995-01-01’;

ANSWERS

Page 11: Class XI Assignment {Informatics Practices}

11

Q2. Consider a table Empl as given below:

empno ename job mgr hiredate sal comm deptno

8369 SMITH CLERK 8902 1990-12-18 800.00 NULL 20

8499 ANYA SALESMAN 8698 1991-02-20 1600.00 300.00 30

8521 SETH SALESMAN 8698 1991-02-22 1250.00 500.00 30

8566 MAHADEVAN MANAGER 8839 1991-04-02 2985.00 NULL 20

8654 MOMIN SALESMAN 8698 1991-09-28 1250.00 1400.00 30

8698 BINA MANAGER 8839 1991-05-01 2850.00 NULL 30

8882 SHIAVNSH MANAGER 8839 1991-06-09 2450.00 NULL 10

888 SCOTT ANALYST 8566 1991-12-09 3000.00 NULL 20

8839 AMIR PRESIDENT NULL 1991-11-18 5000.00 NULL 10

8844 KULDEEP SALESMAN 8698 1991-09-08 1500.00 0.00 30

8886 ANOOP CLERK 8888 1993-01-12 1100.00 NULL 20

8900 JATIN CLERK 8698 1991-12-03 950.00 NULL 30

8902 FAKIR ANALYST 8566 1991-12-03 3000.00 NULL 20

8934 MITA CLERK 8882 1992-01-23 1300.00 NULL 10

Q1. Display all the records from table Empl.

Answer :

Q2. Display EmpNo and EName of all employees from table Empl.

Answer :

Q3. Display Ename , Sal and Sal added with Comm from table Empl.

Answer :

Page 12: Class XI Assignment {Informatics Practices}

12

Q4. Write a query to display employee name,salary and department number who are not getting

commission from table empl.

Answer :

Q5. Write a query to display employee number , name , sal and sal*12 as Annual Salary whose

commission is not NULL from table empl.

Answer :

Q6. List all department numbers in table empl.

Answer :

Q7. List all unique department numbers in table empl.

Answer :

Q8. List details of all clerks who have not been assigned departments as yet.

Answer :

Q9. Lis t the details of those employees who have four lettered name.

Answer :

Q10. List the details of those employees whose annual salary is between 25000-40000.

Answer :

Q11. How many job types are offered to employees.

Page 13: Class XI Assignment {Informatics Practices}

13

Answer :

Q12. List the details of employees who earn more commission then their salaries.

Answer :

Q13. Write a query to display the name,job title and salary of employee who do not have manager.

Answer :

Q14. Write a query to display , the name of employee whose name contain ‘A’ as third alphabet.

Answer :

Q15. Write a query to display the name of employee whose name contains ‘T’ as the last alphabet.

Answer :

Q16. Write a query to display the name of employee who is having ‘ L ’ as any alphabet of the name.

Answer :

Page 14: Class XI Assignment {Informatics Practices}

14

Chapter 14: MySQl Functions

Qus1 :- Display names ‘mr.obama’ and ‘ms.gandhi’ into lowercase.

Answer:

Qus2 :- Display first three characters extracted from 5th right character onwards from string “ABCDEFG”

Answer:

Qus:- convert and display string ‘large’ into uppercase.

Answer:

Qus:- write a query to remove leading spaces of string ‘ RDBMS MySQL’.

Answer:

Qus:-write query to remove lending spaces of string ‘RDBMS MySQL ‘

Answer:

Qus:- Display the position of string ‘LE ‘ in field job of table Empl

Answer:

Qus:-How many characters are there in string ‘CANDIDE’.

Answer:

Ques:-Write a query to extract institute code from a string ‘USS/23/67/09’.The first three charcters tell the

institute code.

Answer:

Ques:-Write a query to extract 2 digit year from a string ‘USS/23/67/09’.the last two characters tell the year.

Answer:

Ques:-Write a query to extract a sub string from string ‘Quadratically’ which should be 6 characters long and

start from 5th character of the string.

Answer:

Page 15: Class XI Assignment {Informatics Practices}

15

Ques:-Find out the remainder of 11 divided by 4.

Answer:

Ques:-Display the result of 32

Answer:

Ques:-Round off value 15.193 to narest ten’s.

Answer:

Ques:- Find the sign of value 15.

Answer:

Ques:-Find the square root of 26.

Answer:

Ques:-Truncate value 15.79 to 1 decimal place.

Answer:

Ques:-Write a query to display the current date on your system.

Answer:

Ques:- Write a query to extract date from a given datetime value ‘2008-12-31 01:02:03’.

Answer:

Ques:- Write a query to display current date and time.

Answer:

Ques:-Write a query to illustrate the difference between now( ) and sysdate( )

Answer:

Page 16: Class XI Assignment {Informatics Practices}

16

MCL SARASWATI BAL MANDIR SR. SEC. SCHOO, L-BLOCK, HARI NAGAR, N.D.- 64

Class XI

Assignment {Informatics Practices} – 2018 - 19

CH-3 (GETTING STARTED WITH PROGRAMMING USING IDE)

1. What do you understand by JVM?

Answer:

2. What is Write Once Run Anywhere characteristics of Java?

Answer:

3. Name two types of Java program?

Answer:

4. What do you understand by visual programming?

Answer:

5. What is the relationship of properties, methods and events?

Answer:

Page 17: Class XI Assignment {Informatics Practices}

17

6. What is the similarity and difference between option buttons and check boxes?

Answer:

7. What is bytecode?

Answer:

8. Why is Java often termed as a platform?

Answer:

9. What are RAD tools?

Answer:

10. What happens to container control and its child control if you deleted

(i) the container control (ii) a child control, (iii) all child controls.

Page 18: Class XI Assignment {Informatics Practices}

18

Chapter-4 Programming Fundamentals

Q-1 Distinguish between a unary, a binary and a ternary operator. Give examples of Java operators for each

one of them.

Q-2 We have two variables X and Y. Write Java statements to calculate the result of division of Y and X and

calculate the remainder of the division.

Q-3 Will the value of Y be the same for the two cases given below.

(i) Y = ++X; (ii) Y = X++ (Given the value of X is 42)

A-2:

Q-4 Consider the following code snippet.

A-4:

Q-5 Name the character set supported by Java.

A-5:

Q-6 What is meant by Token? Name the tokens available in Java.

A-1:

A-2:

Page 19: Class XI Assignment {Informatics Practices}

19

A-6:

Q-7 What are keywords? Can Keywords be used as identifiers?

A-7:

Q-8 What is identifier? What is the identifier forming rule of Java?

A-8:

Q-9 Is Java case sensitive? What is meant by the term ‘case sensitive’?

A-9:

Q-10 Which of the following are valid identifiers and why/why not?

Data_rec, _data, 1 data, data 1, my.file, asm, switch, goto, break

Page 20: Class XI Assignment {Informatics Practices}

20

A-10:

Q-11 What is literals? How many types of integer literals are available in Java?

A-11:

Q-12 What will be the result of a= 5/3 if a is (i) float (ii) int?

Q-13 The expression 8%3 evaluates to ___________.

Q-14 What will be the value of j = - - K + 2 * K + (l = K, l + +) if K is 20 initally?

Q-15 What will be the value of P = P * + + J is 22 and P = 3 initially?

A-15:

Q-16 What will be the result of following expression if (i) age = 25 (ii) age = 65 (iii) age = 85?

Age > 65 ? 350 : 100.

A-12:

Page 21: Class XI Assignment {Informatics Practices}

21

A-16:

Chapter 5: Flow Of Control

Q-1 Write a code to translate to its equivalent of the day week using switch case

(e.g., 1 to Sunday, 2 to Monday.......,7 to Saturday).

Answer:

Q-2: Write code to print first n natural number and their sum.

Answer:

Page 22: Class XI Assignment {Informatics Practices}

22

Q-3: Loop to print factorial of given number.

Answer:

Q-4: Loop to print odd numbers between 50 to 100.

Answer:

Q-5: Loop to display 10 stars in a line.

Answer:

Q-6: Loop to display the following series upto 10 term:10 13.5 17 20.5.....

Answer:

Q-7: Show the output of the following code.

Page 23: Class XI Assignment {Informatics Practices}

23

int a =5, b=10;

if(a>5)

if (b>5) {

System . out . println (“b is” +b); }

Else

System . out . println (“a is” +a);

Answer:

Q-8: State the output of the following code:

int a =10, b=5;

if(a>b) {

if (b>5)

System . out . println (“b is” +b); }

Else

System . out . println (“a is” +a);

Answer: Q-9: what will the output of the following code fragment if the value of ch is

(i) a (ii) c (iii) d (iv) h (v) b ?

switch (ch) { case ‘a’: system.out .println(“It is a.”);

case ‘b’: system.out .println(“It is b.”);

case ‘c’: system.out .println(“It is c.”);

break;

case ‘d’: system.out .println(“It is d.”);

break;

default : System.out.println (“not a b c d .”) }

Page 24: Class XI Assignment {Informatics Practices}

24

Answer:

Q-10: What does break statement do ?

Answer:

CH-11 {PROGRAMMING GUIDELINES}

Q1. What do you mean by Syntax errors and Semantics errors?

Answer 1:

Q2. What is echo printing?

Answer 2:

Q3. What is bug?

Answer 3:

Q4. Which of the following fall into category of meaningful identifiers?

Taxrate , x , t , interest , amount , y , a.

Answer 4:

Q5. What are the characteristics of good program?

Answer 5:

Page 25: Class XI Assignment {Informatics Practices}

25

Q6. What is the process of translation of the algorithm , into a program , called?

Answer 6:

Q7. Name the three categories of errors.

Answer 7:

Chapter-12 (dbms concept).

Define the followings..

1. Alternate key._________________________________________________________________________

2. Attribute key._________________________________________________________________________

3. Candidate key._______________________________________________________________________

4. Cardinality__________________________________________________________________________

5. Data redundancy.____________________________________________________________________

6. Degree.____________________________________________________________________________

7. Primary key.________________________________________________________________________

8. Relation ___________________________________________________________________________

9. Tuple._____________________________________________________________________________

10. View.______________________________________________________________________________

Page 26: Class XI Assignment {Informatics Practices}

26

Chapter -13 (introduction to mysql.)

1. What is the purpose of using

mysql.?______________________________________________________________________________

_____________________________________________________________________________________

____________________________________________________________________________________

____________________________________________________________________________________

2. What is SQL ? What are the different commands available in SQL.?

_____________________________________________________________________________________

_____________________________________________________________________________________

_____________________________________________________________________________________

_____________________________________________________________________________________

3. Differentiate between DDL And DML

commands.?__________________________________________________________________________

_____________________________________________________________________________________

_____________________________________________________________________________________

_____________________________________________________________________________________

_____________________________________________________________________________________

_____________________________________________________________________________________

_____________________________________________________________________________________

__________________________________________________________________________

4. Name some table maintenance

commands.?__________________________________________________________________________

______________________________________________________