Free Newsletters:
DatabaseDaily
 

SQLCourse
Interactive Online SQL Training

Search Database Journal:

HOME News MS SQL Oracle DB2 Access MySQL PHP SQL Etc Scripts Links Forums DBA Talk
SQL Courses
1What is SQL?
2Table basics
3Selecting data
4Creating tables
5Inserting into a table
6Updating records
7Deleting records
8Drop a table
9Advanced Queries
10Standalone SQL interpreter
11Advertise on SQLCourse.com
12Database Links
13Technology Jobs



Selecting Data Answers

  1. Display everyone's first name and their age for everyone that's in table.

    select first, 
           age 
      from empinfo;
  2. Display the first name, last name, and city for everyone that's not from Payson.

    select first, 
           last, 
           city 
      from empinfo
    where city <> 
      'Payson';
  3. Display all columns for everyone that is over 40 years old.

    select * from empinfo
           where age > 40;
  4. Display the first and last names for everyone whose last name ends in an "ay".

    select first, last from empinfo
           where last LIKE '%ay';
  5. Display all columns for everyone whose first name equals "Mary".

    select * from empinfo
           where first = 'Mary';
  6. Display all columns for everyone whose first name contains "Mary".

    select * from empinfo
           where first LIKE '%Mary%';

Back to Selecting Data

 

SQL Course Curriculum
<<previous 123456789 next>>