SQL

This was my first project in which I began to work with SQL and relational

databases. I began practicing introductory data definition and data

manipulation language, making subqueries, and using functions.

Usage 🐬

from as a MySQL command line argument.


$ cat 3-list_tables.sql | mysql -h localhost -u root -p mysql

Tasks 📃

  • 0. List databases

  • 1. Create a database

    hbtn_0c_0.

  • 2. Delete a database

    hbtn_0c_0.

  • 3. List tables

  • 4. First table

    • 4-first_table.sql: MySQL script that creates a table first_table.

    • Description:

      • id: INT

      • name: VARCHAR(256)

  • 5. Full description

    table first_table.

  • 6. List all in table

    first_table.

  • 7. First add

    first_table.

    • Description:

      • id = 89

      • name = Holberton School

  • 8. Count 89

    • 8-count_89.sql: MySQL script that displays the number records with `id =

    89in the tablefirst_table`.

  • 9. Full creation

    second_table.

    • Description:

      • id: INT

      • name: VARCHAR(256)

      • score: INT

    • Records:

      • id = 1, name = "John", score = 10

      • id = 2, name = "Alex", score = 3

      • id = 3, name = "Bob", score = 14

      • id = 4, name = "George", score = 8

  • 10. List by best

    records of the table second_table in order of descending score.

  • 11. Select the best

    records with a score >= 10 in the table second_table in order of descending score.

  • 12. Cheating is bad

    the table second_table.

  • 13. Score too low

    score <= 5 in the table second_table.

  • 14. Average

    records in the table second_table.

  • 15. Number by score

    • 15-groups.sql: MySQL script that lists the score and number of records

    with the same score in the table second_table in order of descending count.

  • 16. Say my name

    records in the table second_table in order of descending score.

    • Does not display rows without a name value.
  • 17. Go to UTF8

    database to UTF8.

  • 18. Temperatures #0

    temperature (Fahrenheit) by city in descending order.

  • 19. Temperatures #1

    highest average temperature from July to August in descending order.

  • 20. Temperature #2

    state in order of state name.

RESOURCES

More Useful Resource

My Recommendation