• Shuffle
    Toggle On
    Toggle Off
  • Alphabetize
    Toggle On
    Toggle Off
  • Front First
    Toggle On
    Toggle Off
  • Both Sides
    Toggle On
    Toggle Off
  • Read
    Toggle On
    Toggle Off
Reading...
Front

Card Range To Study

through

image

Play button

image

Play button

image

Progress

1/10

Click to flip

Use LEFT and RIGHT arrow keys to navigate between flashcards;

Use UP and DOWN arrow keys to flip the card;

H to show hint;

A reads text to speech;

10 Cards in this Set

  • Front
  • Back
Select all rows in a table 'customers' DB table

SELECT * FROM customers;

Select columns 'id', 'name', 'start time' from the 'customers' table

SELECT id, name, [start time] FROM customers;




or




SELECT id, name, 'start time' FROM customers;

Select top 150 records only showing columns 'id' and name from 'customers' table

SELECT TOP 150 id, name FROM customers;

SELECT TOP 150 id, name FROM customers;

Select distinct values in the 'city' column of the 'customers'

SELECT DISTINCT city FROM customers

Select 'id' from the customers able where 'name' is 'Bob Smith'

SELECT id FROM customers WHERE name = 'Bob Smith'

Name the operators that can be used in where SQL clause

=Equal


<> Not equal or != can be used.


> Greater than


< Less than


= Greater than or equal


<= Less than or equal


BETWEEN Between an inclusive range


LIKE Search for a pattern


IN To specify multiple possible values for a column


Select all rows from the 'customers' table where the 'country' is 'United Kingdom' and the 'city' is 'London' or 'Cardiff'

SELECT * FROM Customers WHERE Country='United Kingdom' AND (City='London' OR City='Cardiff');

Select all rows from the 'customers' table where the 'country' is 'United Kingdom' and order by the 'id' column small to larger




And also large ID to small

SELECT id, name FROM customers WHERE country = 'United Kingdom' ORDER BY id ASC




for the other way around




ORDER BY id DESC

SQl Union what is it

It concatinates to datasetse




select id from what


UNION


Select id from what1


Legend