0% found this document useful (0 votes)
8 views3 pages

SQL Worksheet 6.sol

The document is a worksheet on SQL, containing multiple-choice questions (Q1-Q10) about SQL commands, legal expressions, and database concepts, along with subjective questions (Q11-Q15) on denormalization, database cursors, query types, constraints, and auto increment. It provides correct answers for each question, highlighting key SQL concepts and practices. The content is structured to assess knowledge of SQL and database management.

Uploaded by

faltukaamdone
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)
8 views3 pages

SQL Worksheet 6.sol

The document is a worksheet on SQL, containing multiple-choice questions (Q1-Q10) about SQL commands, legal expressions, and database concepts, along with subjective questions (Q11-Q15) on denormalization, database cursors, query types, constraints, and auto increment. It provides correct answers for each question, highlighting key SQL concepts and practices. The content is structured to assess knowledge of SQL and database management.

Uploaded by

faltukaamdone
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/ 3

ASSIGNMENT

WORKSHEET 6 SQL
Q1 and Q2 have one or more correct answer. Choose all the correct option to answer your question.
1. Which of the following are TCL commands?
A. Commit
B. Select
C. Rollback
D. Savepoint
Answer: A, C and D

2. Which of the following are DDL commands?


A. Create
B. Select
C. Drop
D. Alter
Answer: A, C and D

Q3 to Q10 have only one correct answer. Choose the correct option to answer your question.
3. Which of the following is a legal expression in SQL?
A. SELECT NULL FROM SALES;
B. SELECT NAME FROM SALES;
C. SELECT * FROM SALES WHEN PRICE = NULL;
D. SELECT # FROM SALES;
Answer: B. SELECT NAME FROM SALES; is a legal expression in SQL.

4. DCL provides commands to perform actions like-


A. Change the structure of Tables
B. Insert, Update or Delete Records and Values
C. Authorizing Access and other control over Database
D. None of the above
Answer: C. Authorizing Access and other control over Database.

5. Which of the following should be enclosed in double quotes?


A. Dates
B. Column Alias
C. String
D. All of the mentioned
Answer: B. Column Alias
6. Which of the following command makes the updates performed by the transaction permanent in the database?
A. ROLLBACK
B. COMMIT
C. TRUNCATE
D. DELETE
Answer: B. COMMIT
7. A subquery in an SQL Select statement is enclosed in:
A. Parenthesis - (...).
B. brackets - [...].
C. CAPITAL LETTERS.
D. braces - {...}.
Answer: A. Parenthesis - (...).
8. The result of a SQL SELECT statement is a :-
A. FILE
B. REPORT
C. TABLE
D. FORM

Answer: C.
TABLE
ASSIGNMENT

9. Which of the following do you need to consider when you make a table in a SQL?
A. Data types
B. Primary keys
C. Default values
D. All of the mentioned
Answer: D. All of the men oned

10. If you don’t specify ASC and DESC after a SQL ORDER BY clause, the following is used by___?
A. ASC
B. DESC
C. There is no default value
D. None of the mentioned
Answer: A) ASC

Q11 to Q15 are subjective answer type questions, Answer them briefly.

11. What is denormalization?


Answer: Denormaliza on is the process of relaxing the normaliza on rules in a rela onal database by
crea ng redundant copies of data, in order to speed up queries or improve data integrity. It is used to reduce
the complexity and improve the performance of a database by reducing the number of joins required to
retrieve data.
12. What is a database cursor?
Answer: A database cursor is a control structure that enables traversal over the records in a
database. A cursor allows you to iterate through the rows of a query result and perform
speci c ac ons for each row.
13. What are the different types of the queries?
Answer: The di erent types of queries are Select, Insert, Update, and Delete. Select is used to retrieve data
from a database, Insert is used to insert new data into a database, Update is used to update exis ng data in a
database, and Delete is used to delete data from a database.
14. Define constraint?
Answer: Constraints are used to specify rules for the data in a table. They are used to ensure
data integrity and consistency. Constraints can be applied to columns, tables, or the en re
database. Examples of constraints include primary keys, foreign keys, unique keys, and
check constraints.

15. What is auto increment?


Answer: Auto increment is a feature that allows a unique number to be generated
automatically when a new record is inserted into a table. The unique number is generated
based on a seed value and an increment value, and is typically used as the primary key for
a table.
ti
fi
ti
ff
ti
ti
ti
ti
ti
ti

You might also like