About This Chapter
Populating & Retrieving Data in Databases - Chapter Summary
It's easy to review information about populating and retrieving data in databases using this helpful chapter. Here you'll study basic SQL query syntax, advanced SQL query syntax, INSERT statements and limiting the results of a SELECT SQL query. We've made these subjects easy to understand so your study experience is sure to be enjoyable and fruitful. If you're getting ready for an exam, the lesson quizzes and chapter test will be especially helpful in your preparations. We've made these resources accessible to you on any smartphone, tablet or computer so you can study at your convenience any time of day. After working through this chapter, you should be ready to:
- Detail the ISNULL function of SQL
- Manipulate databases using SQL
- Sort the results of an SQL query
- Discuss the use for SQL functions
- Outline the NVL function and CASE statement in SQL
- Define GROUP BY clause
- Identify the advanced use of the GROUP BY clause in SQL
- Retrieve data in databases
1. Basic SQL Query Syntax
In this lesson, we will describe SQL queries and how these queries are used to access data stored in a relational database. We will also discuss SQL statements and the SQL clauses used to construct these statements.
2. Advanced SQL Query Syntax
This lesson will explore the use of the SQL SELECT command in more complex situations where the output results need further manipulation and processing before being displayed. We will learn how to use wildcards in queries, how to sort the data using ORDER BY, how to aggregate the data using GROUP BY, and other advanced functions in SQL.
3. SQL: INSERT Statement
The SQL INSERT statement, which is used to add new records in a database table, is one of the most basic commands in the language. In this lesson, we'll learn the syntax of this command and examine examples of the statement.
4. How to Limit the Results of a SELECT SQL Query
In this lesson, you will learn how to use the WHERE clause to limit the number of rows to be returned from a SELECT Standard Query Language (SQL) statement run on a database. You will also learn how to use the WHERE clause with a number of operators, which will return results for exact or partial search value matches. For example, you can search in a books database for books titled 'Great', books whose titles start with the letter 'G', or books written between the years 2000 and 2015.
5. SQL: ISNULL Function
Not every field in a database has a value: Sometimes we want to show something other than NULL or empty. The ISNULL function in SQL is perfect for these situations. This lesson will cover the syntax and provide examples of the function.
6. Structured Query Language: Manipulating Databases Using SQL
Describe how to manipulate a database using the logic of Structured Query Language. Learn the basic syntax to write database queries in SQL using the SELECT statement.
7. How to Sort the Results of an SQL Query
This lesson will help you understand the ORDER BY clause in SQL statements used in database programming. You will also understand the use of ASC and DESC clauses that are used to modify the behavior of the ORDER BY clause.
8. What are SQL Functions? - Use & Examples
SQL functions are simply sub-programs which are commonly used and re-used throughout SQL database applications for processing or manipulating data. All major SQL database implementations like Microsoft SQL, Oracle and mySQL provide a complete suite of built-in functions as well as the facility for users to create their own functions. The contents of this lesson are applicable to all SQL systems.
9. SQL: NVL Function
We're off to NVL-land: an option available only in Oracle databases, it is a useful function that can replace a blank value with some other value. This lesson will cover the syntax of the function and provide examples.
10. SQL: CASE Statement
The SQL CASE statement acts like a switchboard: based on a value, a specific line of processing will be followed. This lesson covers the syntax of the statement as well as some examples.
11. SQL: GROUP BY Clause
When we go online shopping, we might have a favorite color for clothing, and perhaps we'd like to arrange them by color. The group by statement performs this function in SQL. In this lesson, we'll learn what the statement is and how it is used.
12. Advanced Use of the GROUP BY Clause in SQL
In this lesson, we will learn uses of the GROUP BY clause in SQL. GROUP BY is often used together with SQL aggregate functions like COUNT, SUM, AVG, MAX and MIN that act on numeric data. Together with these functions, the GROUP BY clause enhances the power of SQL and facilitates the creation of reports with summary data.
13. Practical Application for Database Programming: Retrieving Data in Databases
This lesson will give you the opportunity to practice your skills in using the SQL SELECT statement. You will be given a number of questions in this lesson, ranging from the simple SELECT statements to more complex ones requiring the use of operators/clauses such as GROUP BY, HAVING, IN, and BETWEEN.
Earning College Credit
Did you know… We have over 160 college courses that prepare you to earn credit by exam that is accepted by over 1,500 colleges and universities. You can test out of the first two years of college and save thousands off your degree. Anyone can earn credit-by-exam regardless of age or education level.
To learn more, visit our Earning Credit Page
Transferring credit to the school of your choice
Not sure what college you want to attend yet? Study.com has thousands of articles about every imaginable degree, area of study and career path that can help you find the school that's right for you.
Other chapters within the Computer Science 204: Database Programming course
- Intro to Relational Database Management Systems
- Creating & Managing Database Tables
- Manipulating Data in Databases
- Data Queries in Multiple Tables Using Joins
- Data Queries in Multiple Tables Using Subqueries
- Views & Indexes in Databases
- Modifying Tables in Databases
- Manipulating Large Data Sets in Databases
- Developing & Using Regular Expressions in Databases
- Database Security