Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 11

Computer Science - Informatics Practices Class XI/XII MySQL Test Series Part 11

Q1. What is the degree and cardinalty of table who has 6 columns and 10 rows?

Q2. Identify the errors in the following query

a. Select * from Student where Name = NULL;

b. Select max(salary) from employee group by designation where DOJ > "2020-02-02";

c. Select * from student where name is = "Amit";

d. Select * from employee where salary between 1000, 2000;

e. Select * from employee where name = "A%";

f. Select Name , Subject from student where average >20 and < 30;

g. Select * from Student where Name = "Amit" and Name ="Sumit";

h. Select highest(Salary) from employee;

i. Select all from student;

j. Update table student set Name = "Sunita" where admno = 1234;


SOLUTIONS

Q1. What is the degree and cardinalty of table who has 6 columns and 10 rows?

Ans. Degree - 6 and Cardinality - 10

Q2. Identify the errors in the following query

a. Select * from Student where Name = NULL;

Ans. Select * from Student where Name is NULL;

b. Select max(salary) from employee group by designation where DOJ > "2020-02-02";

Ans. Select max(salary) from employee group by designation having DOJ > "2020-02-02";

c. Select * from student where name is = "Amit";

Ans. Select * from student where name  = "Amit";

d. Select * from employee where salary between 1000, 2000;

Ans. Select * from employee where salary between 1000 and 2000;

e. Select * from employee where name = "A%";

Ans. Select * from employee where name  like "A%";

f. Select Name , Subject from student where average >20 and < 30;

Ans. Select Name , Subject from student where average >20 and average < 30;

g. Select * from Student where Name = "Amit" and Name ="Sumit";

Ans. Select * from Student where Name = "Amit" or Name = "Sumit";

h. Select highest(Salary) from employee;

Ans. Select max(Salary) from employee;

i. Select all from student;

Ans. Select * from Student;

j. Update table student set Name = "Sunita" where admno = 1234;

Ans. Update student set Name = "Sunita" where admno = 1234;


No comments:

Post a Comment

Most Recently Published

File Handling Test 6

 File Handling Test 6 Q1 . Do we need to use the close() function when we use 'with' statement to open a file? Q2. Which mode you wi...

CS - IP Assignment/Worksheet