Food NutritionNatural Herbal BeautyFeng ShuiEnvironmentally FriendlySAPermitUnique Gift IdeasFrench LingerieGardenCamera Drop ShippingImprove Website TrafficNew Concept AdvertisingComputers Wholesale ListFetish WholesaleFashion HouseLove QuotesElectronics Wholesale ListHTTP Referer SpoofArcog Article DirectoryGames Drop ShippingOffice ProductsHealth and Beauty ShopAdult VideoShoes WholesaleWholesale ProductsSex PositionsPosted Post Wordpress InstallEmail Newsletter ServiceDrop Shipping BusinessUrl Shortening ServiceOne SexNature Journey with Peri

Simple Database Queries Examples

Simple Database Queries Examples

Posted by arlene

This provides several examples of queries based on the concepts that have been discussed. The hour begins with the simplest query you can issue, and builds upon the initial query progressively. You use the EMPLOYEE_TBL table.

Selecting all records from a table and displaying all columns:

SELECT * FROM EMPLOYEE_TBL;

Selecting all records from a table and displaying a specified column:

SELECT EMP ID

Living the Web 2.0

FROM EMPLOYEE_TBL;

Selecting all records from a table and displaying a specified column. You can enter code on one line or use a carriage return as desired:

SELECT EMP_ID FROM EMPLOYEE_TBL;

Selecting all records from a table and displaying multiple columns separated by commas:

SELECT EMP ID, LAST_NAME FROM EMPLOYEE_TBL;

Displaying data for a given condition:

SELECT EMP ID, LAST_NAME FROM EMPLOYEE_TBL

WHERE EMP_ID = ‘333333333′;

Displaying data for a given condition and sorting the output:

SELECT EMP ID, LAST_NAME FROM EMPLOS-TE_TBL

WHERE CITY = ‘INDIANAPOLISORDER BY EMP_ID;

Displaying data for a given condition and sorting the output on multiple columns, one column sorted in reverse order:

SELECT EMP ID, LAST_NAME

FROM EMPLOYEE_TBL

WHERE CITY = ‘INDIANAPOLISORDER BY EMP_ID, LAST_NAME DESC;

Displaying data for a given condition and sorting the output using an integer in the place of the spelled-out column name:

SELECT EMP ID, LAST_NAME FROM EMPLOYEE_TBLWHERE CITY = ‘INDIANAPOLISORDER BY 1;

Displaying data for a given condition and sorting the output by multiple columns using integers, the order of the columns in the sort is different than their corresponding order after the SELECT keyword:

SELECT EMP_ID, LAST_NAME

FROM EMPLOYEE_TBL

WHERE CITY = ‘ INDIANAPOLIS

ORDER BY 2, 1;

The ultimate solution to solve the headache of finding Databases Products Wholesale, Wi-Fi Audio Surveillance, Drop Ship Server Computers, HDD Media Player, SQL Fundamentals LiveLessons Special, MySQL - 4th Edition, Computer Science Textbooks Drop Shipping, LED Globes, Blogging & Internet Surfing Wholesale List, Sams Teach Yourself SQL in Accessories and Other Blogging and Internet Softwares Wholesale List trusty wholesaling supplies is get wholesaling drop shipper, no more headache of buying wholesale category.

Possibly related posts: (automatically generated)
Simple Database Queries Examples

3 Responses to “Simple Database Queries Examples”

  1. It is creating a new model for web services.” &quote; end interfaces and enterprise applications. … Web Interface Design

  2. Roche also offer a complete range of web hosting services from shared and reseller hosting plans all the way up to fully managed dedicated servers and clusters. … Web Hosting Plan

  3. The journal provides in-depth coverage of Microsoft SQL Server in all its flavours, from the scaled down to Embedded SQL Server and SQL Server for Windows CE to the desktop version of MSDE. … Database Design

Leave a Reply

Logo