Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Write in SQL Composite Conditions: AND, OR, NOT GENERAL FORMAT You can combine basic conditions in your queries using the following keywords AND (both conditions

image text in transcribedWrite in SQL

Composite Conditions: AND, OR, NOT GENERAL FORMAT You can combine basic conditions in your queries using the following keywords AND (both conditions must hold) OR (one of the conditions must hold) NOT (the condition must not hold) EXAMPLES The following query returns all people in Maryland (MA) with the surname 'Lang': SELECT FROM CUSTOMER WHERE FAMILYNAME = 'LANG' AND STATE = 'MD'; The following query returns all people who either live in Maryland (MA) or have the surname 'Lang: SELECT FROM CUSTOMER WHERE FAMILYNAME- ' LANG' OR STATE = 'MD'; DO IT YOURSELF (DIY) Write a query to return all customers who's middle initial is before in the alphabet. or after T SAVE THIS QUERY IN THE DATABASE AS "11_CUSTOMERS_WITH_MIDDLE INITIAL BEFORE G_OR_AFTER_T" ORDER BY clause GENERAL FORMAT The general format of an ORDER BY clause is: SELECT FROM WHERE ORDER BY [ASC/DESC] EXAMPLES The following query returns all male customers in alphabetic order of surname SELECT FROM CUSTOMER WHERE GENDER = 'M' ORDER BY FAMILYNAME ; The following query returns all male customers in reverse alphabetic order of surname SELECT FROM CUSTOMER WHERE GENDER 'M' ORDER BY FAMILYNAME DESC; DO IT YOURSELF (DIY) Write a query to return the cities of all customers (with no repeating rows), in reverse alphabetic order. SAVE THIS QUERY IN THE DATABASE AS "12 ALL_UNIQUE_CITIES_REVERSE_ALPHABETIC

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Database Machine Performance Modeling Methodologies And Evaluation Strategies Lncs 257

Authors: Francesca Cesarini ,Silvio Salza

1st Edition

3540179429, 978-3540179429

More Books

Students also viewed these Databases questions

Question

6. Identify seven types of hidden histories.

Answered: 1 week ago

Question

What is human nature?

Answered: 1 week ago