Monday, 11 January 2021

10 Jan 2021 MySQL Test Result

 

10 Jan 2021 MySQL Test Result



S.No.

Name

Marks

1

Himanshu

42

2

Akash Yadav

41

3

Imran Khan

38

4

Kanchan

36

5

Meerayadav

34

6

Divya

32

7

Gaurav Chaudhary

32

8

Salvi Vatsa

32

9

Sumit Tiwari

32

10

Vansh Tyagi

32

11

Priyanka Arora

31

12

Aksh Gupta

30

13

Ankur Bhardwaj

29

14

Sonika Beniwal

29

15

Priyanka Soni

27

16

Priyanka Yadav

27

17

Dilip Gupta

26

18

Kirti

26

19

Ankit

25

20

Priya Chaurasia

25

21

Amrik Goswamy

24

22

Kundan Kumar Rana

24

23

Ritesh

24

24

Tushar Chandila

23

25

Vibhakar

23

26

Anil Yadav

22

27

Amar Jeet Kumar

21

28

Gaurav

21

29

Jagjeet Singh

21

30

Ritik Bansal

21

31

Annu

20

32

Nisha

20

33

Sachin

20

34

Anurag

19

35

Divya

18

36

Hemant Kumar Singh

16

37

Kalyani

16

38

Amit Sharma

15

39

Annu

14

40

Shehbaz

14

41

Reetu

13

42

Jitender

10

43

Abhay Pratap Dubey

9

44

Poonam

5

45

Sonu

4

46

Kal

2

48

Priyanka

1

49

Akash Verma

0


MYSQL Qus

 MYSQL Qus


1. 

Consider a relation book (title, price) which contains the titles and prices of different books. Assuming that no two books have the same price, what does the following SQL query list ?

Select title

from book as B

where (select count ( * )

from book as T

where T.price > B.price) < 7


  • Titles of the six most expensive books.
  • Title of the sixth most expensive books.
  • Titles of the seven most expensive books.
  • Title of the seventh most expensive books.

2. 

Consider the following schema:

Emp (Empcode, Name, Sex, Salary, Deptt)
A simple SQL query is executed as follows:
SELECT Deptt FROM Emp
WHERE sex = 'M'
GROUP by Dept
Having avg (Salary) > (select avg (Salary) from Emp)
  • Average salary of male employee is the average salary of the organization
  • Average salary of male employee is less than the average salary of the organization
  • Average salary of male employee is equal to the average salary of the organization
  • Average salary of male employee is more than the average salary of the organization


3. 

The output will be

The STUDENT information in a university stored in the relation STUDENT (Name, SEX, Marks, DEPT_Name) 

Consider the following SQL Query SELECT DEPT_Name from STUDENT where SEX = 'M' group by DEPT_Name having avg (Marks)>SELECT avg (Marks) from STUDENT. 

It Returns the Name of the Department for which:


  • The Average marks of Male students is more than the average marks of students in the same Department
  • The average marks of male students is more than the average marks of students in the University
  • The average marks of male students is more than the average marks of male students in the University
  • The average marks of students is more than the average marks of male students in the University


4. 

Which of the following is/are true with reference to ‘view’ in DBMS ? 
(a) A ‘view’ is a special stored procedure executed when certain event occurs. 

(b) A ‘view’ is a virtual table, which occurs after executing a pre-compiled query. code:

  • Only (a) is true
  • Only (b) is true
  • Both (a) and (b) are true
  • Neither (a) nor (b) are true

5. 

Given two relations R1(A, B) and R2(C, D), the result of following query

Select distinct A, B from R1, R2

is guaranteed to be same as R1 provided one of the following condition is satisfied.


  • R1 has no duplicates and R2 is empty.
  • R1 has no duplicates and R2 is non - empty.
  • Both R1 and R2 have no duplicates.
  • R2 has no duplicates and R1 is non - empty.

6. 

Consider the relations r1(P, Q, R) and r2(R, S, T) with primary keys P and R respectively. The relation r1 contains 2000 tuples and r2 contains 2500 tuples. The maximum size of the natural join

  • 2000
  • 2500
  • 4500
  • 5000

7.
Which of the following is/are correct?

  • An SQL query automatically eliminates the duplicates
  • An SQL query will not work if there are no indexes on the relations
  • SQL permits attribute names to be repeated in the same relation
  • None of the above

Saturday, 9 January 2021

बहुमत व एकजुट

एक होस्टल कैंटीन वाले के रोज़-रोज़ 
    नाश्ते में खिचड़ी दे देने से परेशान 
      80 छात्रों ने होस्टल वार्डन से 
          शिकायत करी, और 
   बदल-बदल के नाश्ता देने को कहा.

    100 में से सिर्फ 20 छात्र ऐसे थे,
      जिनको खिचड़ी बहुत पसंद थी,
       और वो छात्र चाहते थे, कि 
          खिचड़ी तो रोज़ ही बने.
            बाकी के 80 छात्र
            परिवर्तन चाहते थे.

         *वार्डन ने वोट करके*
    *नाश्ता तय करने को कहा.*

        उन 20 छात्रों ने, जिनको ...
           खिचड़ी बहुत पसंद थी,
           खिचड़ी के लिए वोट किया.

            बाकी बचे 80 लोगों ने 
   आपस में कोई सामंजस्य नहीं रखा,
   और कोई वार्तालाप भी नहीं किया,
    और अपनी बुद्धि एवम् विवेक से 
    अपनी रूचि अनुसार वोट दिया.

  *18 ने डोसा चुना,*
  *16 ने परांठा,*
  *14 ने रोटी,*
  *12 ने ब्रेड बटर,*
  *10 ने नूडल्स , और*
  *10 ने पूरी सब्जी को वोट दिया.*

       🤔  *अब सोचो*  🤔
         *क्या हुआ होगा ?*

       *उस कैंटीन में आज भी*
 *वो 80 छात्र, रोज़ खिचड़ी ही खाते हैं.*
*क्यों - क्योंकि वो 20छात्र बहुमत में व एकजुट रहे*

*शिक्षा*👉🏻   *जब तक हिस्सों में 80 बंटे रहोगे,*
*तब तक 20% वालों का वर्चस्व रहेगा.*
*समाज के लिये संदेश*
 संदेश क्या होना चाहिए लिखिए।
*नही तो खिचड़ी ही खानी पड़ेगी*
 🙏🙏

Monday, 4 January 2021

How to Create MySQL database backup and restore it

 



Process to Create MySQL database backup and restore.



1. Open Command Prompt using admin.


2. Move to 


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


3. For Backup


mysqldump -uroot -proot databasename > backupfilename.sql


4. Open MySql


5. Drop database and create again


6. For Restore Database from backup file


In Command Prompt write


mysql -uroot -proot databasename < backupfilename.sql


7. Check in MySql all tables will restore