GoConqr has a new look! Let us know what you think.

Flashcards

Refining selections

dadou siplancin SQL vaze English 29 cards

Refining selections

Cards in this deck (29)

  1. 1How to have all rows where a property will only have different results ?In this case, also using the birth date and first name in conjunction will ensure that we don't miss different persons with the same last name.How to have all rows where a property will only have different results ?
  2. 2How to order rows by one characteristics ?By default, the order is ASC (= in alphabetical order), but you can put DESC.
    They would be selected by order they were inserted if there were no ORDER BY.
    How to order rows by one characteristics ?
  3. 3How to order rows by many characteristicsHere, the 2 corresponds to author_fname.
    We can put as many column names we want after ORDER BY.
    How to order rows by many characteristics
  4. 4How to only have 3 results from a search ?How to only have 3 results from a search ?
  5. 5How do we get all rows ordered by from the 95th one ?How do we get all rows ordered by from the 95th one ?
  6. 6How to look for all rows with "da" in them ?The % mean anything or nothing can be before or after "da".How to look for all rows with "da" in them ?
  7. 7How to find all rows with four characters ?How to find all rows with four characters ?
  8. 8How to know how many raws there is in the DB ?How to know how many raws there is in the DB ?
  9. 9How to get the smallest value of a column ?How to get the smallest value of a column ?
  10. 10What if I want the title of the longest book ? title, pages (books)What if I want the title of the longest book ? title, pages (books)
  11. 11Having the year of the first publication from each author. fname, lname, released-Y (books)Having the year of the first publication from each author. fname, lname, released-Y (books)
  12. 12Sum all pages in the entire DB pagesSum all pages in the entire DB pages
  13. 13Sum all pages each author has written fname, lname, pages (books)SELECT author_fname, author_lname, SUM(pages) FROM books
    GROUP BY author_fname, author_lname;
  14. 14Difference between CHAR & VARCHARCHAR has a fixed length, it’s faster for fixed length text. For exemple, if we put char(5) for the titles, they will be truncated if they’re longer than that. If it’s shorter, spaces are added to make it 5.
  15. 15Explain DecimalExplain Decimal
  16. 16Difference Float/Double and DecimalFLOAT & DOUBLE store larger numbers using less space at cost of precision.
  17. 17Explain DATE, TIME & DATETIMEExplain DATE, TIME & DATETIME
  18. 18Explain CURDATE, CURTIME & NOWExplain CURDATE, CURTIME & NOW
  19. 19Not Equal!=
  20. 20Not LikeNOT LIKE ''
  21. 21Greater Than Greater or equal to>
    >=
  22. 22What returns SELECT 99 > 11, l'équivalent de TRUE
  23. 23What returns 'A' > 'a'False
    But >= would be true
  24. 24Less than Less or equal to<
    <=
  25. 25AND OR&&
    ||
  26. 26We want the books released from 2004 to 2015We want the books released from 2004 to 2015
  27. 27When we want to make operations/comparaisons on different datatypes we :USE CAST() to explicitly convert the values of the desired data type (when you use strings and dates, different datatypes …)When we want to make operations/comparaisons on different datatypes we :
  28. 28How can we do the same, but shorter ?How can we do the same, but shorter ?How can we do the same, but shorter ?
  29. 29Instead of having a date when we ask for the release_date, how do we get "Modern" for after/in 2000 and Old for before 2000 ?Instead of having a date when we ask for the release_date, how do we get "Modern" for after/in 2000 and Old for before 2000 ?

Information

Description
vaze SQL Flashcards on Refining selections, created by dadou siplancin on 14/02/2022.
Created by
dadou siplancin
Views
0
Rating

Feedback

What is it about?

What do you think of the new look?

How do you like it?