Give a Short Definition for each of the following items:
Compound Condition: Two or more single condition joined by means of a logical operator (AND and OR).
SQL: Structured Query Language is programming language is designed to managing data in relational database management system (RDBMS).
CREATE TABLE: In Structure Query Language we use CREATE TABLE command to describe the layout of table.
Computed Field: A field whose values you derive from existing database table is called a computed field. Computed field functions involve addition, subtraction, multiplication and division.
Sub Query: Sub Query is query in a query. A Sub Query is usually added in the WHERE Clause of the SQL statement. Most of the time a sub query is when you know how to search for a value using SELECT statement, but do not know the exact value.
SQL built-in function: SQL server provides many built-in functions that you can use in queries to return data or ...view middle of the document...
3. What are data types and why are they important?
Each field in a table must specify the type of data that field can store. Selecting appropriate data types is one of the important considerations when designing a SQL database. Choices you make in the database design phase may have a significant impact on the efficiency, performance and storage requirements of your database down the road.
4. Provide an example of the GROUP by clause, when would you use this clause?
The GROUP by clause can be used in SELECT statement to collect data across multiple records and group the results by one or more columns.
For Example: We can use it to group student by department for example students from computer science department, business management department, nursing department.
SELECT department, studentname, IDnumber
GROUP BY department
5. What is an aggregate function (provide 4)? How are they used?
An aggregate function is used to provide summarization information for an SQL statement. Such as COUNT(), AVG(), FIRST(), LAST().
6. Provide example using the COUNT function.
The COUNT function is used to count rows or values of a column that do not contain a NULL value. Another option within COUNT function is use to COUNT with asterisk, COUNT when used with an asterisk “COUNT(*)”, it counts all the rows of a table including duplicates whether a NULL value is contained in a column or not.
SELECT COUNT(*) (STUDENT_ID)
FROM STUDENT_TUTION_ID Counts all students ID
SELECT COUNT (EMPLOYEE_SALARY)
FROM EMPLOYEE_PAY_TBL Counts all employee rows
7. How is a field name qualified? How is this used when using a JOIN command, why is it important?
A FIELD name is qualified by preceding name of the filed with the name by the table followed by a period. This is used when the JOIN command when there is potential doubt in listing field names. This is important to make sure that you are joining the correct fields.
8. What are the three update commands in SQL?
The three update commands in SQL are DELETE, INSERT, and UPDATE.
9. What method allows you to re-order the presentation data?
10. How are SQL built-in function used?