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

CT4 WS1

The document consists of a series of SQL case study questions and theoretical queries related to database management. It covers SQL commands for various operations on tables such as listing, inserting, and counting records, as well as theoretical questions on SQL concepts like primary keys, DDL, DML, and aggregate functions. Additionally, it includes practical SQL command corrections and explanations of SQL clauses and functions.

Uploaded by

rithika170720
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)
15 views4 pages

CT4 WS1

The document consists of a series of SQL case study questions and theoretical queries related to database management. It covers SQL commands for various operations on tables such as listing, inserting, and counting records, as well as theoretical questions on SQL concepts like primary keys, DDL, DML, and aggregate functions. Additionally, it includes practical SQL command corrections and explanations of SQL clauses and functions.

Uploaded by

rithika170720
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

CASE STUDY BASED QUESTIONS (5 MARKS EACH)

1. Write SQL commands for (a) to (e) on the basis of table GRADUATE

(a) List the names of those students who have obtained DIV 1 sorted by NAME.
(b) Display a report, listing NAME, STIPEND, SUBJECT and amount of stipend
received in a year assuming that the STIPEND is paid every month.
(c) To count the number of students who are either PHYSICS or COMPUTER SC
graduates.
(d) To insert a new row in the GRADUATE table:
11, “KAJOL”, 300, “COMPUTER SC”, 75, 1
(e) Display Name of the students whose average is more than 65.
2. Write SQL commands for (a) to (e) on the basis of table CLUB.

(a) To show all information about the swimming coaches in the club.
(b) To list names of all coaches with their date of appointment (DATOFAPP) in
descending order.
(c) To display a report, showing coachname, pay, age and bonus (15% of pay) for all
the coaches.
(d) To insert in a new row in the CLUB table with the following data: 11,
“PRAKASH”, 37,
“SQUASH”, {25/02/98}, 2500, “M”
(e ) Display Coachname ,Sports,Pay from the table .
3. Write SQL commands for (a) to (e) on the basis of table INTERIORS and
NEWONES

(a) To show all information about the sofas from the INTERIORS table.
(b) To list the ITEMNAME which are priced at more than 10,000 from the
INTERIORS table.
( c) To list ITEMNAME and TYPE of those items, in which DATEOFSTOCK is
before 22/01/02
from the INTERIERS table in the descending order of ITEMNAME.
(d ) To display ITEMNAME and DATEOFSTOCK of those items, in which the
discount
percentage is more than 15 from INTERIORS table.
( e )To count the number of items, whose type is “Double Bed” from INTERIOR table
Q1. What is the difference between cardinality and degree?.
Q.2 Differentiate between WHERE and HAVING clause.
Q.3 Define Primary Key of a relation in SQL. Give an Example using a dummy table
Q4. Differentiate between DDL and DML with one Example each.
Q.5 What do you mean by domain of an attribute in DBMS? Explain with an example.
descending order.
Q2. Give example of any two DML commands.
Q3. What is the purpose of SQL?
Q4. What is primary key?
Q5. Which command is used to display a list of already existing tables?
Q6. Which command is used to change the structure of table?
Q7. Which command is used to change the data of the table?
Q8. Which command is used to delete data of the table?
Q9. Which command delete the structure of table?
Q10. Identify the DDL and DML commands from the following:
Create, Delete
Q11. Which clause is used with aggregate functions? (Group by/ Where)
Q12. What do you mean by candidate key?
Q13. Correct the error in the following query.
Select * from RECORD where Rname = %math%;
Q14. What is max () function in SQL?
Q15. What do you mean by degree and cardinality of table?
Q16. Expand DDL and DML
Q17. Which command is used to increase the salary of workers in table salary?
(Update / Alter)
Q18. Name the command used to see the structure of table.
Q19. Which aggregate function is used to find sum of column in a table?
Q20. What is the difference between having and where clause?
Q21. Name an aggregate function in SQL which return the average of numeric values.
Q22. What is the use of “like” in SQL?
Q23. Correct the following statement: Delete table data;
Q24. What do you mean by aggregate function?
Q25. Write two wild card characters which are used with like operator?
Q26. Duplication of record is called ____________
Q27. What is the difference between char and varchar?
1. Which command is used to add new column in existing table?
2. Which clause is used to search for NULL values in any column?
3. Which command is used to see information like name of columns, data type, size
4. Which clause is used for pattern matching? What are the 2 main characters used
for matching the pattern?
5. Which clause is used to see the output of query in ascending or descending order?
6. Which clause is used to eliminate the duplicate rows from output?
7. Which command is used to remove the table from database?
8. Which option of ORDER BY clause is used to arrange the output in descending
order?
9. Meetali is a database programmer, She has to write the query from EMPLOYEE
table to search for the employee who are getting any commission, for this she
has written the query as:
SELECT * FROM EMPLOYEE WHERE commission=null;
But the query is not producing the correct output, help Raj and correct the query
so that he gets the desired output.
10. Raj is a database programmer, He has to write the query from EMPLOYEE table
to search for the employee who are not getting any commission, for this he has
written the query as: SELECT * FROM EMPLOYEE WHERE commission=null;
But the query is not producing the correct output, help Raj and correct the query
so that he gets the desired output.
1. The SQL keyword_________ is used to specify the table(s) that contains the data to
be
retrieved.
2. The _______command of SQL lets you make queries to fetch data from tables.
3. To remove duplicate rows from the result of a query, specify the SQL
qualifier_______ in
select list.
4. To obtain all columns, use a(n) __________instead of listing all the column names
in the select list.
5. The SQL ________clause contains the condition that specifies which rows are to be
selected.
6. The SQL keyword ________is used in SQL expressions to select records based on
patterns.
7. The____________ operator is used for making range checks in SELECT queries.
8. The null values in a column can be searched for in a table using ___________,
_________in the WHERE clause of SELECT query.
9. To sort the rows of the result table, the __________clause is specified.
10. Columns can be sorted in descending sequence by using the SQL keyword .
11. By default, ORDER BY clause lists the records__________ in order.
12. A database can be opened with___________ <database> command.
13. ___________command is used to create new relations in a database
14. A__________ is a condition or check applicable on a field or set of fields.
15. The____________ constraint creates a foreign key.
16. To define a column as a primary key__________,_________ constraint is used in
CREATE TABLE.
17.____________ is used to insert data in an existing table.
18. Rows of a table can be deleted using______________ command.
19. To increase the size of a column in an existing table, use commond __________ .
20.____________ command removes a table from a database permanently.
21. ____________command is used to alter the definition of already created table.
22. To remove table data as well table structure, use command _________
23.__________ Use command to add new columns in an existing table.
24. A column added via ALTER TABLE command initially contains__________
value for all rows.
25. Issue_________ command to make changes to table permanent.
26. The clause___________ is used to divide result of SELECT query in groups.
27. To specify condition with a GROUP BY clause,_______ _ clause is used.
28. Only __________functions are used with GROUP BY clause.
29. Nested grouping can be done by providing__________ in the GROUP BY
expression.
30. The _________clause is used in SELECT queries to specify filtering condition for
groups.
31. Aggregate Functions cannot be used in _________clause of the Select query.
32. The SQL built-in function__________ total values in numeric columns.
33. The SQL built-in function________ computes the average of values in numeric
columns.
34. The SQL built-in function__________ obtains the largest value in a in numeric
columns.
35. The SQL built-in function__________ obtains the smallest value in a in numeric
columns.

You might also like