Tuesday 23 November 2021

Set Theory Assignment -1

 

1.      {x: x is an integer neither positive nor negative} is ________

A).   Empty set

B).   Non-empty set

C).   Finite set

D).   Non- empty and Finite set

 

2.      {x: x is a real number between 1 and 2} is an ________

A).   Infinite set

B).   Finite set

C).   Empty set

D).   None of the mentioned

 

3.      Write set {1, 5, 15, 25,…} in set-builder form.

A).   {x: either x=1 or x=5n, where n is a real number}

B).   {x: either x=1 or x=5n, where n is a integer}

C).   {x: either x=1 or x=5n, where n is an odd natural number}

D).   {x: x=5n, where n is a natural number}

 

4.      Number of power set of {a, b}, where a and b are distinct elements.

A).   3

B).   4

C).   2

D).   5

 

5.      Which of the following is subset of set {1, 2, 3, 4}?

A).   {1, 2}

B).   {1, 2, 3}

C).   {1}

D).   All of the mentioned

 

6.      A = {,{},2,{2,},3}, which of the following is true?

A).   {{,{}} A

B).   {2} A

C).   A

D).   3 A

 

7.      Subset of the set A= { } is?

A).   A

B).   {}

C).  

D).   All of the mentioned

 

8.      {x: x belong to N and x is prime} then it is ________

A).   Infinite set

B).   Finite set

C).   Empty set

D).   Not a set

 

9.      Convert set {x: x is a positive prime number which divides 72} in roster form.

A).   {2, 3, 5}

B).   {2, 3, 6}

C).   {2, 3}

D).   {}

 

10.   A __________ is an ordered collection of objects.

A).   Relation

B).   Function

C).   Set

D).   Proposition

 

11.   The set O of odd positive integers less than 10 can be expressed by _____________

A).   {1, 2, 3}

B).   {1, 3, 5, 7, 9}

C).   {1, 2, 5, 9}

D).   {1, 5, 7, 9, 11}

 

12.   Power set of empty set has exactly _________ subset.

A).   One

B).   Two

C).   Zero

D).   Three

 

13.   What is the cardinality of the set of odd positive integers less than 10?

A).   10

B).   5

C).   3

D).   20

 

14.   Which of the following two sets are equal?

A).   A = {1, 2} and B = {1}

B).   A = {1, 2} and B = {1, 2, 3}

C).   A = {1, 2, 3} and B = {2, 1, 3}

D).   A = {1, 2, 4} and B = {1, 2, 3}

 

15.   The set of positive integers is _____________

A).   Infinite

B).   Finite

C).   Subset

D).   Empty

 

16.   What is the Cardinality of the Power set of the set {0, 1, 2}?

A).   8

B).   6

C).   7

D).   9

 

17.   The members of the set S = {x | x is the square of an integer and x < 100} is ________________

A).   {0, 2, 4, 5, 9, 58, 49, 56, 99, 12}

B).   {0, 1, 4, 9, 16, 25, 36, 49, 64, 81}

C).   {1, 4, 9, 16, 25, 36, 64, 81, 85, 99}

D).   {0, 1, 4, 9, 16, 25, 36, 49, 64, 121}

 

Saturday 20 November 2021

General Computer Quiz - 1

 1. What is the full form of ISCII?

a. Indian Standard Code for Information Interchange

b. Indian Script Code for Information Interchange

c. Indian Standard Code of Information Interchange

d. Indian Script Code of Information Interchange


2. Which is the correct order of Memory Units in ascending order?

a. Bit, Byte, Nibble, KB, MB,GB

b. Bit, Nibble, Byte, KB, MB, GB

c. Byte, KB, MB, GB, PB, TB, XB

d. Bit, Byte, KB, MB, TB, GB, XB


3. Which is the fastest Memory from the following?

a. RAM

b. Cache

c. SSD

d. HDD


4. The “block” in blockchain technology refers to the _____________ stored in a __________referred to as the “chain”.

a. Public Database, Digital Information

b. Digital Information, Public Database

c. Frame, RAM

d. Page, Hard Disk


5. The speed of the printer in measured in 

a. Character Per Minute

b. Page Per Minute

c. Line Per Minute

d. Dot Per Inch


6. Convert (1101.0110) from Binary to Octal

a. 15.30

b. 13.30

c. 15.06

d. 13.06


7. Which of the following is not a mobile operating System?

a. Safari OS

b. Blackberry OS

c. Windows OS

d. Samsung BADA


8. Which of the following is a Universal Gate?

a. NAND

b. NOT

c. AND

d. XOR


9. Base of a number is also known as -----------

a. Radix

b. Mantissa

c. Range

d. Last Digit


10. Which of the following represent De Morgan’s Law?

a. (A + B)’ = A’B’

b. (A.B)’ = A’ + B’

c. (A+A’B) = A + B

d. Both a and b


Friday 19 November 2021

HTET - PGT Computer Science

 All About HTET - PGT Computer Science

On -Line Application Start from 15 Nov 2021

Last Date - 25 Nov 2021


Examination Fee 1000, 500 for (SC/PH of Haryana)


Eligibility for HTET- PGT Computer Science

(i) M.Sc. Computer Science (Regular Two Year Course)/MCA (Regular Three Year Course)/B.E./B.Tech. CS/Computer Engg./IT (Regular Course) with 55% aggregate marks from recognized unicersity.


(ii) Matric with Hindi/Sanskrit or 10+2/B.A./M.A. with Hindi as one of the subject.


(iii) Consistent good academic record.



There shall be only one MCQ Paper. No negative Marking


No. of Questions: 150

Time: 2.5 hrs


(i) Child Development and Pedagogy - 30 Qus


(ii) Language (Hindi - 15 Qus, English - 15 Qus) - 30 Qus


(iii) General Studis (Quantitative Aptitude - 10 Qus, Resoning - 10 Qus, Haryana G.K. - 10 Qus) - 30Qus


(iv) Subject Specific (Computer Science) - 60 Qus


Total - 150 Qus



Qualifying Marks : 90 % 


For SC/ST/PH of Haryana - 55%


Exam Date : 18 and 19 Dec 2021


Language of Exam - Hindi and English



Mode of Exam - Pen -Paper Based


Admit Card - 08-12-2021


Saturday 23 October 2021

What is STT in intraday share?

Intraday Brokerage - Securities Transaction Tax (STT):

The government of India levies Securities Transaction Tax on the trade of equities, according to the Security Contracts (Regulation) Act, 1956. Currently, a tax of 0.025% of the transaction value is applicable on the sell side of an equity intraday transaction.

Let your sale value is 450763 of a day
Then STT will be

450763*0.025%= 112. 69 = 113

Sunday 10 October 2021

मंजिल उन्हीं को मिलती है, जिनके सपनों में जान होती है



भारत की वो 'अफसर बिटिया' जिसने अपनी मेहनत के दम पर पूरी दुनिया में भारत का नाम किया है रोशन, जानिए IFS अधिकारी ‘स्नेहा दुबे’ के जीवन की प्रेरक कहानी
“मंजिल उन्हीं को मिलती है, जिनके सपनों में जान होती है, पंख से कुछ नहीं होता, हौसलों से उड़ान होती है।“
 
इस बात को पूरी तरह से प्रमाणित करने का काम किया है इस बार की संयुक्त राष्ट्र महासभा में पाकिस्तान को आइना दिखाने वाली IFS ऑफिसर स्नेहा दुबे ने। जिन्होंने अपनी हाजिरजवाबी और बुलंद हौसलों के दम पर कश्मीर का राग अलाप रही पाकिस्तान की सरकार को करारा जवाब देकर उनकी बोलती बंद कर दी थी। भारत की प्रथम सचिव स्नेहा दुबे ने अपने वक्तव्य से हर भारतीय का दिल जीत लिया था। 2012 बैच की महिला आईएफएस अधिकारी स्नेहा दुबे के लिए अंतर्राष्ट्रीय स्तर पर भारत का प्रतिनिधित्व करने का सफर तय करना इतना आसान नहीं था। इसके लिए उन्हें काफी मेहनत करनी पड़ी। आइए जानते हैं अपने पहले ही प्रयास में यूपीएससी (UPSC) की परीक्षा को उत्तीर्ण करने वाली स्नेहा दुबे का प्रेरणादायी सफर।

बचपन से ही बनना चाहती थीं ऑफिसर




झारखंड के जमशेदपुर के एक सामान्य परिवार में जन्मी स्नेहा दुबे के पिता एक केबल कंपनी में इंजीनियर थे। उनका परिवार केबल टाउन में ही रहता था। लेकिन साल 2000 में कंपनी के अचानक से बंद हो जाने के बाद उनका पूरा परिवार गोवा चला गया। गोवा में उनके पिता को फिनोलेक्स केबल कंपनी में जॉब मिल गई। उनकी मां शिक्षिका थीं। स्नेहा ने अपनी शुरूआती शिक्षा गांव से ही पूरी की। जिसके बाद उन्होंने पुणे के फर्ग्युसन कॉलेज से ग्रेजुएशन की पढ़ाई की। स्नेहा जब 12 साल की थीं तभी से वो भारतीय प्रशासनिक सेवा में जाना चाहती थी। अपने इसी सपने को पूरा करने के लिए उन्होंने दिल्ली के जवाहरलाल नेहरू यूनिवर्सिटी (JNU) से एमए और एमफिल किया। जिसके बाद वो यूपीएससी की तैयारी में जुट गईं।

पहले ही प्रयास में क्लियर कर ली UPSC की परीक्षा

स्नेहा दुबे शुरू से ही अपने लक्ष्य को लेकर एकदम क्लियर थीं। उन्होंने जेएनयू में एमए और एमफिल की पढ़ाई करते हुए UPSC की परीक्षा की भी तैयारी की। वो लगातार कई- कई घंटों तक पढ़ाई करती रहती थी। जिसका फल यह निकला कि उन्होंने साल 2012 में अपने पहले ही प्रयास में यूपीएससी क्लियर कर IFS का पद प्राप्त कर लिया। आईएफएस बनने के बाद उनकी नियुक्ति विदेश मंत्रालय में हुई। इसके बाद साल वर्ष 2014 में भारतीय दूतावास मैड्रिड में उनकी नियुक्ति हुई। फिर कुछ साल बाद उन्हें संयुक्त राष्ट्र महासभा में भारत की प्रथम सचिव के रूप में नियुक्त किया गया।

इस उद्देश्य से हासिल किया लक्ष्य

दुनिया के सामने भारत के विरोधियों के झूठ को सच का आइना दिखाने वाली स्नेहा दुबे ने 12 वर्ष की उम्र में ही यह निर्णय ले लिया था कि उनको सिविल सर्विसेज में जाना है। स्नेहा का ऐसा मानना है कि उन्हें IFS बनकर बड़े मंच पर देश का प्रतिनिधित्व करने का स्वर्णिम अवसर मिला है, ऐसा वह हमेशा से ही करना चाहती थी। उनका कहना है कि उनके लिए कोई प्लान 'बी' का विकल्प नहीं रहता। सिविल परीक्षा उत्तीर्ण करना शुरू से ही उनका ध्येय रहा है। अन्य विकल्प रखकर वह अपने ध्येय से विचलित नहीं होना चाहती थी। अलग-अलग जगह पर घूमने, नई संस्कृतियों के बारे में जानने और इतने बड़े मंच पर देश का प्रतिनिधित्व करने तक वह अपना हर सपना सच करना चाहती थी। इसी कारण उन्होंने भारतीय प्रशासनिक सेवा को चुना।

UNGA में विरोधियों को दिखाया आइना

संयुक्त राष्ट्र महासभा की बैठक में पड़ोसी देश के प्रधानमंत्री के बयान के बाद स्नेहा दुबे ने भारत की ओर से प्रतिनिधित्व करते हुए कहा कि पड़ोसी देश ने भारत के आन्तरिक मामलों को पूरी दुनिया के सामने लाने और झूठ से प्रतिष्ठित मंच की छवि को ख़राब करने का प्रयास किया है। स्नेहा दुबे जी ने पड़ोसी देश को ऐसा जवाब दिया था, जिससे वहां के प्रधानमंत्री पूरी तरह से चुप पड़ गए थे और एक शब्द भी ना कह पाए थे।
स्नेहा दुबे अपने परिवार से ऐसी पहली व्यक्ति भी हैं जिन्होंने सरकारी सेवाओं में अपना स्थान बनाया है। स्नेहा दुबे ने जिस कड़ाई से विरोधियों को UNGA में आईना दिखाया है, उनकी खूब सराहना की जा रही है।
अंतर्राष्ट्रीय स्तर पर भारत का नाम रोशन करने वाली स्नेहा दुबे जी आज सही मायने में लाखों लोगों के लिए प्रेरणास्त्रोत (Inspiration) हैं। स्नेहा दुबे ने अपनी मेहनत और लगन के दम पर सफलता की नई कहानी (Success Story) लिखी है।


Sunday 3 October 2021

UPPSC Technical Education Polytechnic Syllabus Exam Pattern etc.

 

UPPSC Polytechnic Lecturer Exam Pattern

For Lecturer
SubjectNo. of QuestionsMarksTime
Paper-1 Exam Pattern
General Hindi2575 2.5 hours
Subject/Stream100 300 
Total125375
Paper-2 Exam Pattern
General Studies2575 2.5 hours
Subject/Stream100 300 
 Total125375

+ 100 Marks For Interview




UPPSC Lecturer Selection Process 2021


The selection for the post of Technical Lecturer, Workshop Superintendent, Principal, Librarian will be done on the basis of total marks obtained by the candidates in written examination and interview. Only the candidates qualifying in the written test will be called for the interview round.


UPPSC Technical Education Teaching Exam Pattern consists of two papers with 125 questions in each paper, all questions are multiple select type questions. Check out the detailed exam pattern for UPPSC technical education teaching service exam 2021 below.

  • Total duration for each exam is 2.5 hours
  • Total number of questions in each exam are 125
  • According to the marking scheme of the examination, +3 marks for every right answer and -1 for every wrong answer.
 

UPPSC Polytechnical Lecturer Syllabus for General Hindi (Common to all)


  • हिंदी भाषा का मूलभूत ज्ञान (स्वर, व्यंजन, रस)
  • प्रत्यय
  • समास
  • मुहावरे और लोकोक्तियाँ
  • अनेक शब्दों के लिए एक शब्द
  • उचित शब्द से दिए गए रिक्त स्थान की पूर्ती
  • पर्यायवाची शब्द, विलोम शब्द, शब्द युग्म, लिंग परिवर्तन, वचन परिवर्तन आदी
  • वर्ण, वर्तनी और उच्चारण
  • वाक्य-क्रम व्यवस्थापन
  • उपसर्ग और प्रत्यय
  • विपरीतार्थक शब्द
  • संधि तथा संधि-विच्छेद
  • अनेकार्थक शब्द

UPPSC Technical Lecturer Syllabus











Monday 20 September 2021

TCL Commands in MySQL, Back and Restore database

 Enter password: ****

Welcome to the MySQL monitor.  Commands end with ; or \g.

Your MySQL connection id is 11

Server version: 8.0.22 MySQL Community Server - GPL


Copyright (c) 2000, 2020, Oracle and/or its affiliates. All rights reserved.


Oracle is a registered trademark of Oracle Corporation and/or its

affiliates. Other names may be trademarks of their respective

owners.


Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.


mysql> use kvs;

Database changed

mysql> show tables;

+---------------+

| Tables_in_kvs |

+---------------+

| dept          |

| emp           |

| emp1          |

| emp2          |

| emp3          |

| emp4          |

| emp5          |

| emp6          |

| emp7          |

| r1            |

| r2            |

| r3            |

| r4            |

| r5            |

| r6            |

| student       |

| t1            |

| t2            |

| t3            |

| t4            |

| t5            |

| t6            |

| t7            |

| voters        |

| voters1       |

| voters2       |

| voters3       |

+---------------+

27 rows in set (1.00 sec)


mysql> select * from emp;

+------+---------+------------+------+----------+---------+

| id   | name    | DOJ        | age  | salary   | subject |

+------+---------+------------+------+----------+---------+

|  102 | Sita    | 2018-12-05 |   32 | 75000.00 | Hindi   |

|  103 | Sam     | 2010-10-10 |   38 | 95000.00 | Hindi   |

|  104 | Priya   | 2019-12-05 |   28 | 72000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  106 | Amit    | 2020-12-05 |   28 | 72000.00 | Hindi   |

|  107 | Pooja   | 2021-12-10 |   28 | 65000.00 | Hindi   |

|  108 | Riya    | 2019-03-05 |   31 | 73000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  110 | Aman    | 2019-02-05 |   31 | 72000.00 | CS      |

|  109 | Rohan   | NULL       |   32 |     NULL | Hindi   |

|  111 | Shubham | 2021-10-10 |   25 | 65000.00 | Maths   |

|  112 | Ajay    | 2021-10-10 |   25 | 65000.00 | Maths   |

+------+---------+------------+------+----------+---------+

12 rows in set (0.26 sec)


mysql> update emp set salary = 70000 where id=112;

Query OK, 1 row affected (0.58 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> select * from emp;

+------+---------+------------+------+----------+---------+

| id   | name    | DOJ        | age  | salary   | subject |

+------+---------+------------+------+----------+---------+

|  102 | Sita    | 2018-12-05 |   32 | 75000.00 | Hindi   |

|  103 | Sam     | 2010-10-10 |   38 | 95000.00 | Hindi   |

|  104 | Priya   | 2019-12-05 |   28 | 72000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  106 | Amit    | 2020-12-05 |   28 | 72000.00 | Hindi   |

|  107 | Pooja   | 2021-12-10 |   28 | 65000.00 | Hindi   |

|  108 | Riya    | 2019-03-05 |   31 | 73000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  110 | Aman    | 2019-02-05 |   31 | 72000.00 | CS      |

|  109 | Rohan   | NULL       |   32 |     NULL | Hindi   |

|  111 | Shubham | 2021-10-10 |   25 | 65000.00 | Maths   |

|  112 | Ajay    | 2021-10-10 |   25 | 70000.00 | Maths   |

+------+---------+------------+------+----------+---------+

12 rows in set (0.00 sec)


mysql> rollback;

Query OK, 0 rows affected (0.02 sec)


mysql> select * from emp;

+------+---------+------------+------+----------+---------+

| id   | name    | DOJ        | age  | salary   | subject |

+------+---------+------------+------+----------+---------+

|  102 | Sita    | 2018-12-05 |   32 | 75000.00 | Hindi   |

|  103 | Sam     | 2010-10-10 |   38 | 95000.00 | Hindi   |

|  104 | Priya   | 2019-12-05 |   28 | 72000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  106 | Amit    | 2020-12-05 |   28 | 72000.00 | Hindi   |

|  107 | Pooja   | 2021-12-10 |   28 | 65000.00 | Hindi   |

|  108 | Riya    | 2019-03-05 |   31 | 73000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  110 | Aman    | 2019-02-05 |   31 | 72000.00 | CS      |

|  109 | Rohan   | NULL       |   32 |     NULL | Hindi   |

|  111 | Shubham | 2021-10-10 |   25 | 65000.00 | Maths   |

|  112 | Ajay    | 2021-10-10 |   25 | 70000.00 | Maths   |

+------+---------+------------+------+----------+---------+

12 rows in set (0.00 sec)


mysql> start transaction;

Query OK, 0 rows affected (0.00 sec)


mysql> create table account(ac_no int,balance decimal);

Query OK, 0 rows affected (2.80 sec)


mysql> desc account;

+---------+---------------+------+-----+---------+-------+

| Field   | Type          | Null | Key | Default | Extra |

+---------+---------------+------+-----+---------+-------+

| ac_no   | int           | YES  |     | NULL    |       |

| balance | decimal(10,0) | YES  |     | NULL    |       |

+---------+---------------+------+-----+---------+-------+

2 rows in set (0.11 sec)


mysql> rollback;

Query OK, 0 rows affected (0.00 sec)


mysql> desc account;

+---------+---------------+------+-----+---------+-------+

| Field   | Type          | Null | Key | Default | Extra |

+---------+---------------+------+-----+---------+-------+

| ac_no   | int           | YES  |     | NULL    |       |

| balance | decimal(10,0) | YES  |     | NULL    |       |

+---------+---------------+------+-----+---------+-------+

2 rows in set (0.01 sec)


mysql> show tables;

+---------------+

| Tables_in_kvs |

+---------------+

| account       |

| dept          |

| emp           |

| emp1          |

| emp2          |

| emp3          |

| emp4          |

| emp5          |

| emp6          |

| emp7          |

| r1            |

| r2            |

| r3            |

| r4            |

| r5            |

| r6            |

| student       |

| t1            |

| t2            |

| t3            |

| t4            |

| t5            |

| t6            |

| t7            |

| voters        |

| voters1       |

| voters2       |

| voters3       |

+---------------+

28 rows in set (0.01 sec)


mysql> insert into account values(100,20000),(200,10000);

Query OK, 2 rows affected (0.15 sec)

Records: 2  Duplicates: 0  Warnings: 0


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   20000 |

|   200 |   10000 |

+-------+---------+

2 rows in set (0.04 sec)


mysql> rollback;

Query OK, 0 rows affected (0.00 sec)


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   20000 |

|   200 |   10000 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> update account set balance=balance-100 where ac_no=100;

Query OK, 1 row affected (0.18 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> update account set balance=balance+100 where ac_no=200;

Query OK, 1 row affected (0.14 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> rollback;

Query OK, 0 rows affected (0.00 sec)


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   19900 |

|   200 |   10100 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> rollback;

Query OK, 0 rows affected (0.00 sec)


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   19900 |

|   200 |   10100 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> truncate account;

Query OK, 0 rows affected (1.56 sec)


mysql> commit;

Query OK, 0 rows affected (0.00 sec)


mysql> select * from account;

Empty set (0.20 sec)


mysql> set transaction;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near '' at line 1

mysql> start transaction;

Query OK, 0 rows affected (0.00 sec)


mysql> insert into account values(100,20000),(200,10000);

Query OK, 2 rows affected (0.01 sec)

Records: 2  Duplicates: 0  Warnings: 0


mysql> update account set balance=balance-100 where ac_no=100;

Query OK, 1 row affected (0.03 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> update account set balance=balance+100 where ac_no=200;

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> rollback;

Query OK, 0 rows affected (0.09 sec)


mysql> select * from account;

Empty set (0.00 sec)


mysql> insert into account values(100,20000),(200,10000);

Query OK, 2 rows affected (0.16 sec)

Records: 2  Duplicates: 0  Warnings: 0


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   20000 |

|   200 |   10000 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> rollback;

Query OK, 0 rows affected (0.00 sec)


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   20000 |

|   200 |   10000 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> update account set balance=balance-100 where ac_no=100;

Query OK, 1 row affected (0.08 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> update account set balance=balance+100 where ac_no=200;

Query OK, 1 row affected (0.15 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   19900 |

|   200 |   10100 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> rollback;

Query OK, 0 rows affected (0.00 sec)


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   19900 |

|   200 |   10100 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> trancate account;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'trancate account' at line 1

mysql> truncate account;

Query OK, 0 rows affected (1.27 sec)


mysql> select * from account;

Empty set (0.24 sec)


mysql> start transaction;

Query OK, 0 rows affected (0.00 sec)


mysql> insert into account values(100,20000),(200,10000);

Query OK, 2 rows affected (0.03 sec)

Records: 2  Duplicates: 0  Warnings: 0


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   20000 |

|   200 |   10000 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> rollback;

Query OK, 0 rows affected (0.06 sec)


mysql> select * from account;

Empty set (0.00 sec)


mysql> start transaction;

Query OK, 0 rows affected (0.00 sec)


mysql> insert into account values(100,20000),(200,10000);

Query OK, 2 rows affected (0.01 sec)

Records: 2  Duplicates: 0  Warnings: 0


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   20000 |

|   200 |   10000 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> update account set balance=balance-100 where ac_no=100;

Query OK, 1 row affected (0.04 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> update account set balance=balance+100 where ac_no=200;

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   19900 |

|   200 |   10100 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> rollback;

Query OK, 0 rows affected (0.03 sec)


mysql> select * from account;

Empty set (0.01 sec)


mysql> start transaction;

Query OK, 0 rows affected (0.00 sec)


mysql> insert into account values(100,20000),(200,10000);

Query OK, 2 rows affected (0.01 sec)

Records: 2  Duplicates: 0  Warnings: 0


mysql> update account set balance=balance-100 where ac_no=100;

Query OK, 1 row affected (0.03 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> update account set balance=balance+100 where ac_no=200;

Query OK, 1 row affected (0.00 sec)

Rows matched: 1  Changed: 1  Warnings: 0


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   19900 |

|   200 |   10100 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> commit;

Query OK, 0 rows affected (0.13 sec)


mysql> rollback;

Query OK, 0 rows affected (0.00 sec)


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   19900 |

|   200 |   10100 |

+-------+---------+

2 rows in set (0.00 sec)


mysql> truncate account;

Query OK, 0 rows affected (1.14 sec)


mysql> start transaction;

Query OK, 0 rows affected (0.00 sec)


mysql> insert into account values(100,20000),(200,10000);

Query OK, 2 rows affected (0.14 sec)

Records: 2  Duplicates: 0  Warnings: 0


mysql> insert into account values(300,25000);

Query OK, 1 row affected (0.00 sec)


mysql> savepoint A;

Query OK, 0 rows affected (0.00 sec)


mysql> insert into account values(400,30000);

Query OK, 1 row affected (0.00 sec)


mysql> savepoint B;

Query OK, 0 rows affected (0.00 sec)


mysql> insert into account values(500,40000);

Query OK, 1 row affected (0.00 sec)


mysql> savepoint C;

Query OK, 0 rows affected (0.00 sec)


mysql> insert into account values(600,50000);

Query OK, 1 row affected (0.00 sec)


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   20000 |

|   200 |   10000 |

|   300 |   25000 |

|   400 |   30000 |

|   500 |   40000 |

|   600 |   50000 |

+-------+---------+

6 rows in set (0.00 sec)


mysql> rollback to C;

Query OK, 0 rows affected (0.00 sec)


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   20000 |

|   200 |   10000 |

|   300 |   25000 |

|   400 |   30000 |

|   500 |   40000 |

+-------+---------+

5 rows in set (0.03 sec)


mysql> rollback to B;

Query OK, 0 rows affected (0.03 sec)


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   20000 |

|   200 |   10000 |

|   300 |   25000 |

|   400 |   30000 |

+-------+---------+

4 rows in set (0.00 sec)


mysql> rollback to A;

Query OK, 0 rows affected (0.00 sec)


mysql> select * from account;

+-------+---------+

| ac_no | balance |

+-------+---------+

|   100 |   20000 |

|   200 |   10000 |

|   300 |   25000 |

+-------+---------+

3 rows in set (0.00 sec)


mysql> rollback;

Query OK, 0 rows affected (0.06 sec)


mysql> select * from account;

Empty set (0.00 sec)


mysql> show tables;

+---------------+

| Tables_in_kvs |

+---------------+

| account       |

| dept          |

| emp           |

| emp1          |

| emp2          |

| emp3          |

| emp4          |

| emp5          |

| emp6          |

| emp7          |

| r1            |

| r2            |

| r3            |

| r4            |

| r5            |

| r6            |

| student       |

| t1            |

| t2            |

| t3            |

| t4            |

| t5            |

| t6            |

| t7            |

| voters        |

| voters1       |

| voters2       |

| voters3       |

+---------------+

28 rows in set (0.00 sec)


mysql> drop kvs;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'kvs' at line 1

mysql> drop database kvs;

Query OK, 28 rows affected (7.90 sec)


mysql> show tables;

ERROR 1046 (3D000): No database selected

mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| 12cs               |

| abc                |

| delhi              |

| information_schema |

| leet               |

| mysql              |

| performance_schema |

| pysales_inventory  |

| sakila             |

| spsc               |

| spsharmaclasses    |

| spsharmag          |

| sys                |

| world              |

+--------------------+

14 rows in set (0.06 sec)


mysql> create databases kvs;

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'databases kvs' at line 1

mysql> create database kvs;

Query OK, 1 row affected (0.09 sec)


mysql> show databases;

+--------------------+

| Database           |

+--------------------+

| 12cs               |

| abc                |

| delhi              |

| information_schema |

| kvs                |

| leet               |

| mysql              |

| performance_schema |

| pysales_inventory  |

| sakila             |

| spsc               |

| spsharmaclasses    |

| spsharmag          |

| sys                |

| world              |

+--------------------+

15 rows in set (0.00 sec)


mysql> use kvs;

Database changed

mysql> show tables;

Empty set (0.02 sec)


mysql> show tables;

+---------------+

| Tables_in_kvs |

+---------------+

| account       |

| dept          |

| emp           |

| emp1          |

| emp2          |

| emp3          |

| emp4          |

| emp5          |

| emp6          |

| emp7          |

| r1            |

| r2            |

| r3            |

| r4            |

| r5            |

| r6            |

| student       |

| t1            |

| t2            |

| t3            |

| t4            |

| t5            |

| t6            |

| t7            |

| voters        |

| voters1       |

| voters2       |

| voters3       |

+---------------+

28 rows in set (0.09 sec)


mysql> select * from emp;

+------+---------+------------+------+----------+---------+

| id   | name    | DOJ        | age  | salary   | subject |

+------+---------+------------+------+----------+---------+

|  102 | Sita    | 2018-12-05 |   32 | 75000.00 | Hindi   |

|  103 | Sam     | 2010-10-10 |   38 | 95000.00 | Hindi   |

|  104 | Priya   | 2019-12-05 |   28 | 72000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  106 | Amit    | 2020-12-05 |   28 | 72000.00 | Hindi   |

|  107 | Pooja   | 2021-12-10 |   28 | 65000.00 | Hindi   |

|  108 | Riya    | 2019-03-05 |   31 | 73000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  110 | Aman    | 2019-02-05 |   31 | 72000.00 | CS      |

|  109 | Rohan   | NULL       |   32 |     NULL | Hindi   |

|  111 | Shubham | 2021-10-10 |   25 | 65000.00 | Maths   |

|  112 | Ajay    | 2021-10-10 |   25 | 70000.00 | Maths   |

+------+---------+------------+------+----------+---------+

12 rows in set (0.09 sec)


mysql> create table rohit as select * from emp;

Query OK, 12 rows affected, 1 warning (0.69 sec)

Records: 12  Duplicates: 0  Warnings: 1


mysql> select * from rohit;

+------+---------+------------+------+----------+---------+

| id   | name    | DOJ        | age  | salary   | subject |

+------+---------+------------+------+----------+---------+

|  102 | Sita    | 2018-12-05 |   32 | 75000.00 | Hindi   |

|  103 | Sam     | 2010-10-10 |   38 | 95000.00 | Hindi   |

|  104 | Priya   | 2019-12-05 |   28 | 72000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  106 | Amit    | 2020-12-05 |   28 | 72000.00 | Hindi   |

|  107 | Pooja   | 2021-12-10 |   28 | 65000.00 | Hindi   |

|  108 | Riya    | 2019-03-05 |   31 | 73000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  110 | Aman    | 2019-02-05 |   31 | 72000.00 | CS      |

|  109 | Rohan   | NULL       |   32 |     NULL | Hindi   |

|  111 | Shubham | 2021-10-10 |   25 | 65000.00 | Maths   |

|  112 | Ajay    | 2021-10-10 |   25 | 70000.00 | Maths   |

+------+---------+------------+------+----------+---------+

12 rows in set (0.00 sec)


mysql> create table rohit1 as select * from emp where id<110;

Query OK, 9 rows affected, 1 warning (0.81 sec)

Records: 9  Duplicates: 0  Warnings: 1


mysql> select * from rohit1;

+------+-------+------------+------+----------+---------+

| id   | name  | DOJ        | age  | salary   | subject |

+------+-------+------------+------+----------+---------+

|  102 | Sita  | 2018-12-05 |   32 | 75000.00 | Hindi   |

|  103 | Sam   | 2010-10-10 |   38 | 95000.00 | Hindi   |

|  104 | Priya | 2019-12-05 |   28 | 72000.00 | CS      |

|  105 | Raj   | 2018-01-23 |   33 | 80000.00 | CS      |

|  106 | Amit  | 2020-12-05 |   28 | 72000.00 | Hindi   |

|  107 | Pooja | 2021-12-10 |   28 | 65000.00 | Hindi   |

|  108 | Riya  | 2019-03-05 |   31 | 73000.00 | CS      |

|  105 | Raj   | 2018-01-23 |   33 | 80000.00 | CS      |

|  109 | Rohan | NULL       |   32 |     NULL | Hindi   |

+------+-------+------------+------+----------+---------+

9 rows in set (0.00 sec)


mysql> create table rohit2 as select id,name,salary from emp where id<110;

Query OK, 9 rows affected, 1 warning (0.50 sec)

Records: 9  Duplicates: 0  Warnings: 1


mysql> select * from rohit2;

+------+-------+----------+

| id   | name  | salary   |

+------+-------+----------+

|  102 | Sita  | 75000.00 |

|  103 | Sam   | 95000.00 |

|  104 | Priya | 72000.00 |

|  105 | Raj   | 80000.00 |

|  106 | Amit  | 72000.00 |

|  107 | Pooja | 65000.00 |

|  108 | Riya  | 73000.00 |

|  105 | Raj   | 80000.00 |

|  109 | Rohan |     NULL |

+------+-------+----------+

9 rows in set (0.00 sec)


mysql> create table rohit2(id int,age int);

ERROR 1050 (42S01): Table 'rohit2' already exists

mysql> create table if not exists rohit2(id int,age int);

Query OK, 0 rows affected, 1 warning (0.07 sec)


mysql> select * from rohit2;

+------+-------+----------+

| id   | name  | salary   |

+------+-------+----------+

|  102 | Sita  | 75000.00 |

|  103 | Sam   | 95000.00 |

|  104 | Priya | 72000.00 |

|  105 | Raj   | 80000.00 |

|  106 | Amit  | 72000.00 |

|  107 | Pooja | 65000.00 |

|  108 | Riya  | 73000.00 |

|  105 | Raj   | 80000.00 |

|  109 | Rohan |     NULL |

+------+-------+----------+

9 rows in set (0.00 sec)


mysql> select * from emp;

+------+---------+------------+------+----------+---------+

| id   | name    | DOJ        | age  | salary   | subject |

+------+---------+------------+------+----------+---------+

|  102 | Sita    | 2018-12-05 |   32 | 75000.00 | Hindi   |

|  103 | Sam     | 2010-10-10 |   38 | 95000.00 | Hindi   |

|  104 | Priya   | 2019-12-05 |   28 | 72000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  106 | Amit    | 2020-12-05 |   28 | 72000.00 | Hindi   |

|  107 | Pooja   | 2021-12-10 |   28 | 65000.00 | Hindi   |

|  108 | Riya    | 2019-03-05 |   31 | 73000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  110 | Aman    | 2019-02-05 |   31 | 72000.00 | CS      |

|  109 | Rohan   | NULL       |   32 |     NULL | Hindi   |

|  111 | Shubham | 2021-10-10 |   25 | 65000.00 | Maths   |

|  112 | Ajay    | 2021-10-10 |   25 | 70000.00 | Maths   |

+------+---------+------------+------+----------+---------+

12 rows in set (0.03 sec)


mysql> select * from emp where exists (select salary where id=109);

+------+-------+------+------+--------+---------+

| id   | name  | DOJ  | age  | salary | subject |

+------+-------+------+------+--------+---------+

|  109 | Rohan | NULL |   32 |   NULL | Hindi   |

+------+-------+------+------+--------+---------+

1 row in set (0.04 sec)


mysql> select * from emp where exists (select salary where id=115);

Empty set (0.00 sec)


mysql> select * from emp where True;

+------+---------+------------+------+----------+---------+

| id   | name    | DOJ        | age  | salary   | subject |

+------+---------+------------+------+----------+---------+

|  102 | Sita    | 2018-12-05 |   32 | 75000.00 | Hindi   |

|  103 | Sam     | 2010-10-10 |   38 | 95000.00 | Hindi   |

|  104 | Priya   | 2019-12-05 |   28 | 72000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  106 | Amit    | 2020-12-05 |   28 | 72000.00 | Hindi   |

|  107 | Pooja   | 2021-12-10 |   28 | 65000.00 | Hindi   |

|  108 | Riya    | 2019-03-05 |   31 | 73000.00 | CS      |

|  105 | Raj     | 2018-01-23 |   33 | 80000.00 | CS      |

|  110 | Aman    | 2019-02-05 |   31 | 72000.00 | CS      |

|  109 | Rohan   | NULL       |   32 |     NULL | Hindi   |

|  111 | Shubham | 2021-10-10 |   25 | 65000.00 | Maths   |

|  112 | Ajay    | 2021-10-10 |   25 | 70000.00 | Maths   |

+------+---------+------------+------+----------+---------+

12 rows in set (0.00 sec)


mysql> select * from emp where False;

Empty set (0.00 sec)


mysql> select * from emp where id=120;

Empty set (0.00 sec)


mysql> select * from emp where id=102;

+------+------+------------+------+----------+---------+

| id   | name | DOJ        | age  | salary   | subject |

+------+------+------------+------+----------+---------+

|  102 | Sita | 2018-12-05 |   32 | 75000.00 | Hindi   |

+------+------+------------+------+----------+---------+

1 row in set (0.00 sec)


mysql>





Microsoft Windows [Version 10.0.19042.1237]

(c) Microsoft Corporation. All rights reserved.


C:\WINDOWS\system32>cd C:\Program Files\MySQL\MySQL Server 8.0\bin


C:\Program Files\MySQL\MySQL Server 8.0\bin>mysqldump -uroot -proot kvs>kvsback.sql

mysqldump: [Warning] Using a password on the command line interface can be insecure.


C:\Program Files\MySQL\MySQL Server 8.0\bin>mysql -uroot -proot kvs<kvsback.sql

mysql: [Warning] Using a password on the command line interface can be insecure.


C:\Program Files\MySQL\MySQL Server 8.0\bin>