0% found this document useful (0 votes)
23 views

Work Sheet On DBMS and SQL

This document contains a work sheet on database management systems (DBMS) and SQL with 10 multiple choice and short answer questions. The questions cover SQL commands like UPDATE and COUNT(), aggregate functions like AVG() and SUM(), the differences between primary and foreign keys, examples of DDL and DML commands, and SQL queries involving joins, aggregation, and filtering. The last question asks how to open an existing database called 'Stock'. In summary, this work sheet tests fundamental SQL and relational database concepts.

Uploaded by

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

Work Sheet On DBMS and SQL

This document contains a work sheet on database management systems (DBMS) and SQL with 10 multiple choice and short answer questions. The questions cover SQL commands like UPDATE and COUNT(), aggregate functions like AVG() and SUM(), the differences between primary and foreign keys, examples of DDL and DML commands, and SQL queries involving joins, aggregation, and filtering. The last question asks how to open an existing database called 'Stock'. In summary, this work sheet tests fundamental SQL and relational database concepts.

Uploaded by

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

Work sheet on DBMS and SQL

1. Which of the following commands will change row(s) of the table from MySQL database? (1)
(a) REPLACE TABLE (b) CHANGE TABLE (c) UPDATE (d) ALTER TABLE

2. Fill in the blank: (1)


HAVING clause is used in combination with ____________ clause.
(a) GROUP BY (b) Where (c) IN (d) Order By

3. Which of the following function can work with NULL values in a database? (1)
(a) avg() (b) sum() (c) count(*) (d) total(*)

4. Which command is used for counting the number of rows in a database? (1)
(a) row (b) rowcount (c) count() (d) row_count

5. What is the difference between ‘Primary Key’ and ‘Foreign Key’? Can a table have multiple Primary
keys or Foreign keys?

6. Write any two aggregate functions in SQL with an appropriate example.

7. Write two commands each of DDL and DML commands in SQL.

8.
(i) SELECT Dcode, MAX(UnitPrice) FROM STOCK GROUP BY Dcode;
(ii) SELECT COUNT(DISTINCT Dcode) FROM STOCK;
(iii) SELECT Qty*UnitPrice FROM STOCK WHERE ItemNo=5006;
(iv) SELECT MIN(StockDate) FROM STOCK;

9.

(i) SELECT M_Company, M_Name, M_Price,M_Qty FROM MOBILEMASTER MM,


MOBILESTOCK MS, WHERE MM.M_ID= MS.M_ID;
(ii) SELECT MAX(M_Price) FROM MOBILEMASTER WHERE M_Name LIKE "S%";
(iii) SELECT M_Supplier, M_Qty FROM MOBILESTOCK WHERE M_Id ="MB003";
(iv) SELECT M_Company FROM MOBILEMASTER WHERE M_Price BETWEEN 3000 AND
5000;

10. Write a command to open an existing database ‘Stock

You might also like