(Each Answer should be at least 1 or 2 paragraphs in length) 1. Describe the 3 m
ID: 3716526 • Letter: #
Question
(Each Answer should be at least 1 or 2 paragraphs in length)
1. Describe the 3 major types of SQL statements and describe the 4 primary Data Manipulation statements.
2. Describe all of the different options you have for the “Where” clause.(i.e. ‘Like’, ‘In’, etc)
3. Describe the difference between “Order By” and “Group By”.
4. Describe how the use of an INDEX will make queries using “Order By” much faster.
5. Explain just what Data Integrity is and how the use of Constraints may result in better Data Integrity.
6. Explain exactly how a “Join” works. What is a Cartesian Product?
7. Briefly describe the difference and similarities between a “Join” and a ‘Correlated Sub-Query”. Discuss the advantages and disadvantages of each.
8. Describe a Transaction. What is a transaction and what keywords are used to create transactions?
9. What is the “Transaction Log”? Describe how it works and what it is used for.
10. What are Triggers and Stored Procedures and how can they be used to make a database better?
Explanation / Answer
1.
3 major types of SQL statements:
DML (Data Manipulation Language): Commands used in Data Manipulation are
2.
Different options in Where clause:
The SQL WHERE clause is used to specify a condition while fetching the data from a single table or by joining with multiple tables. If the given condition is satisfied, then only it returns a specific value from the table.
“Like” is used while searching for a string
“In”
The IN operator allows you to specify multiple values in a WHERE clause.
The IN operator is a shorthand for multiple OR conditions.
3.
The ORDER BY clause’s purpose is to sort the query result by specific columns. Like sorting in ascending or descending order
The GROUP BY clause’s purpose is summarize unique combinations of columns values., which is used to group like column values into a single row.
4.
Use of Index to fasten Order By:
MySQL can use an index to satisfy an ORDER BY clause without doing extra sorting.
The index can also be used even if the ORDER BY does not match the index exactly, as long as all unused portions of the index and all extra ORDER BY columns are constants in theWHERE clause.
Related Questions
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.