Contenido del Curso
Introduction to SQL
Introduction to SQL
2. Filtering Data
The WHERE ClauseChallenge: Help a Reader Find Their Favorite GenreChallenge: Fetching Older BooksConditional Expressions: Comparison OperatorsChallenge: Avoid the Damaged BooksChallenge: Highlight New ArrivalsChallenge: Budget-Friendly BooksConditional Expressions: The AND OperatorChallenge: Find Specific Books for a ReaderChallenge: Defining RangesChallenge: Multiple ConditionsConditional Expressions: The OR OperatorChallenge: Matching Multiple OptionsChallenge: Excluding A RangeConditional Expressions: The NOT OperatorChallenge: Negating a Range
3. Sorting Data
Basic SortingChallenge: Sorting the Library CatalogueSorting by Multiple ColumnsChallenge: Further Sorting the CatalogueSorting after Filtering DataChallenge: Find the Cheapest BooksChallenge: Help a Customer Find a BookThe LIMIT KeywordChallenge: Select Books for the Collector's SectionChallenge: Affordable Books
4. Populating a Database
Creating a TableChallenge: Creating a new Books TableInserting Rows into a TableChallenge: Inserting DataChallenge: Inserting More DataInserting Multiple RowsChallenge: Inserting Bulk DataPrimary KeysThe SERIAL KeywordChallenge: Changing the Books StructureSpecifying Default ValuesChallenge: Further Improving the Books Table
5. Updating & Deleting Data
Duplicating Tables
We can create a duplicate of a table using the following query:
The above query creates a new table named table_name
and inserts the results of the SELECT STATEMENT
into it.
Creating an Exact Copy
This query creates a new table called students_duplicate
from the result of the query SELECT * FROM students;
.
Creating a Concise Table
We can also create a more concise table by selecting specific columns from the target table:
This query creates a new table named students_basic_info
containing only the first_name
and age
columns from the students
table.
Key Points
- The new table (
table_name
) is created with the structure and data of theSELECT
query's result; - This method is useful for creating backups, filtered copies, or summary tables.
Demonstration:
¿Todo estuvo claro?
¡Gracias por tus comentarios!
Sección 5. Capítulo 7