0% found this document useful (0 votes)
6 views4 pages

MySQL Revision Worksheet 1

Uploaded by

abel.b.linson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
6 views4 pages

MySQL Revision Worksheet 1

Uploaded by

abel.b.linson
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 4

The Emirates National School – Sharjah

INFORMATICS PRACTICES
Grade 12 (2025-’26)
Chapter 3 – Review of Database Concepts and SQL
Worksheet 1
1. What does SQL stand for? What is MySQL?
2. Write two examples of DBMS software.
3. What is the relationship between SQL and MySQL ?
4. Write the command to create a new database “School”.
5. If a database "Employee" exists, which MySQL command helps you to start working in that
database?
6. Write MySQL command will be used to open an already existing database "LIBRARY".
7. Suggest Archana suitable command for the following purpose:
(i) To display the list of the database already existing in MySQL.
(ii) To use the database named City.
(iii) To remove the pre-existing database named Clients.
8. Write the command to display the name of the active database.
9. Write an SQL query to create the table 'Menu' with the following structure:

10. In a Student table, out of Roll Number, Name, Address which column can be set as Primary
key and why?
11. Ms. Mirana wants to remove the entire content of a table "BACKUP" along with its structure
to release the storage space. What MySQL statement should she use?
12. Write one similarity and one difference between CHAR and VARCHAR data types.
13. Saumya had previously created a table named ‘Product’ in a database using MySQL. Later
on she forgot the table structure. Suggest her suitable MySQL command through which she
can check the structure of the already created table.
14. Roli wants to list the names of all the tables in her database named ‘Gadgets’. Which
command (s) she should use to get the desired result.
15. Name the SQL commands used to :
(i) Physically delete a table from the database.
(ii) Display the structure of a table.

Page 1 of 4
16. An attribute A of datatype varchar(20) has the value “Amit” . The attribute B of datatype
char(20) has value ”Karanita” . How many characters are occupied in attribute A ? How many
characters are occupied in attribute B?
17. Write one similarity and one difference between UNIQUE and PRIMARY KEY constraints.
18. Mrs. Sharma is the class teacher of Class ‘XII’. She wants to create a table ‘Student’ to store
details of her class.
(i) Which of the following can be the attributes of Student table?
(a) RollNo (b) “Amit” (c) Name (d) 25
(ii) Name the Primary key of the table ‘Student’. State reason for choosing it.
19. Write SQL query to create a table ‘Player’ with the following structure:

20. Anita has created the following table with the name ‘Orders’.

One of the rows inserted is as follows:

(i) What is the data type of columns OrderId and OrderDate in the table Orders?
(ii) Anita is now trying to insert the following row:

Will she be able to successfully insert it? Give reason.


21. While creating a table named “Employee”, Mr. Rishi got confused as which data type he
should chose for the column “EName” out of char and varchar. Help him in choosing the right
data type to store employee name. Give valid justification for the same.
22. Soham created a table in MySQL. Later on he found that there should have been another
column in the table. Which command should he use to add another column to the table?
23. While creating a table 'Customer' Smitha forgot to set the primary key for the table. Give the
statement which she should write now to set the column 'CustID' as the primary key of the
table?
Page 2 of 4
24. Write SQL command to remove column named ‘Hobbies’ from a table named ‘Student’.
25. Sruthi is not able to change a value in a column to NULL. What constraint did she specify
when she created the table?
26. How is NULL value different from 0 (Zero) value?
27. Rewrite the following SQL statement after correcting error(s). Underline the corrections
made.
INSERT IN STUDENT(RNO,MARKS) VALUE (5,78.5);
28. In today’s digitized world with a need to store data electronically, it is very important to store
the data in the databases. SQL is used to interact with the Database Management System.
Classify the following commands according to their type: (DDL/DML)
(i) INSERT INTO (ii) ALTER TABLE
29. In Marks column of ‘Student’ table, for Rollnumber 2, the Class Teacher entered the marks
as 45. However there was a totaling error and the student has got her marks increased by
5. Which MySQL command should she use to change the marks in ‘Student’ table.
30. Chhavi has created a table named Orders, she has been asked to increase the value of a
column named salesamount by 20. She has written the following query for the same.
Alter table Orders Add salesamount =salesamount+20;
Is it the correct query? Justify.
31. Which command is used to add a new record in a table ?
32. Answer the following questions based on the table Salesman given below:

(i) How many tuples does the given table have?


(ii) Suggest the primary key for the given table with valid reason.
(iii) Write the MySQL query to display all the records in descending order of commission.
(iv) What is the degree and cardinality of the above relation?

33. With respect to a databases, a column in a relation is also known as a/an _________.
(i) attribute (ii) record (iii) domain (iv) tuple
34. _____ command is used to modify records in the MySQL table.
(i) ALTER (ii) UPDATE (iii) MODIFY (iv) SELECT
Page 3 of 4
35. Which of the following is not a valid MySQL data type?
(i) Int (ii) Boolean (iii) Char (iv) Date
36. The purpose of distinct clause in a SQL statement is to:
(i) show all the rows in a column of table (ii) show all duplicate values in a column
(iii) remove all duplicate values in a column (iv) sort all the results based on a column
37. Write an SQL query to fetch all records from a table named employees.
38. Which operator is used to compare a value with a specified list of values?
(i) BETWEEN (ii) IN (iii) LIKE (iv) OR
39. To remove duplicate rows from the results of an SQL SELECT statement, the ________
included.
40. An Alternate key can be defined as:
(i) An attribute which is a primary key (ii) An attribute which is not a primary key
(iii) A candidate key (iv) An attribute which is a foreign key
41. For which attribute fixed length string is suitable?
(i) Salary (ii) City (iii) Gender (iv) Age
42. The ___________ clause is used to arrange records of a table in a sorted manner.
43. A table can have a maximum of _____________ primary key(s).
44. A key that links multiple tables is called a ______________.
45. The full form of DDL is ____________ and DML is _____________.
46. The ___________ clause is used to filter records based on a condition
47. Consider the STOCK table:

Find the output of the following SQL query:


SELECT PRICE*QTY FROM STOCK WHERE QTY < 40;
48. Raj a database programmer, has to write the query from EMPLOYEE table to search for the
employee who are working in Sales or IT department for this he has written the query as:
SELECT * FROM EMPLOYEE WHERE DEPARTMENT = 'SALES' or 'IT';
But the query is not producing the correct output. Help Raj to correct the query so that he gets
the desired output.
49. A table “Electronics” has 12 attributes and 10 tuples, what will be the degree of table
‘Electronics’ and cardinality of it?
50. The data type that does not required a size to be specified is:
(i) float (ii) varchar (iii) char (iv) date

Page 4 of 4

You might also like