Write sql queries, PL-SQL Programming

Assignment Help:

Write SQL queries to solve the following specifications. Include the query AND THE OUTPUT.  A screen dump of the output is acceptable. Show as many rows as you can. A screen dump is usually done via the ALT/PRNTSCRN command sequence.

1.  Display full details for all cars

2.  Display the model name and car group name for all models. Order by car group name in alphabetical order.

3.  Display full details for all bookings where the amount due has not yet been entered.

4.  Display the customer number for all customers who have ever rented a car. Do not display duplicates.

5.  Display the total number of miles travelled for each booking and sort the output by the number of miles travelled in descending order. Label the output: MILES TRAVELLED

INTERESTING EXERCISE: Is it possible to sort using an alias?

6.  Display full details for all bookings where the miles out was greater than 300 and the booking has been paid.

7.  Display full details for any customer  who

1)  Has an address where the second character is a 2 and whose customer number has 3 as the second character  OR

2)  Has a customer number greater than or equal to 400 and lives in a county whose name begins with an H

8.  Display the rate per mile for all cargroups where the cargroup name is A1 or A2 and the rate per day is either 25 or 33. Find a way of optimising your code so that the complete SQL statement has only logical operator (AND, OR, NOT).

9.  Display the customer number and the  booking number for all bookings. Order by booking number within customer number (both ascending).  Your query must not contain the word WHERE.

10. Using a traditional join (WHERE CLAUSE) display the customer number and the  booking number for all bookings. Order by booking number within customer number (both ascending).  Your query must use the alias A for I_BOOKING and the alias B for I_CUSTOMER.


Related Discussions:- Write sql queries

Commit statement in pl sql, COMMIT Statement The COMMIT statement expli...

COMMIT Statement The COMMIT statement explicitly makes everlasting changes to the database during the present transaction. The Changes made to the database are not considered e

First step at defining type sid in sql, First Step at defining type SID in ...

First Step at defining type SID in SQL CREATE TYPE SID AS ( C VARCHAR(5) ) ; Explanation: TYPE SID announces that a type named SID is being defined to the syst

Set operators - sql operators, Set Operators The Set operators combine...

Set Operators The Set operators combine the results of the two queries into one result. The INTERSECT returns all the distinct rows selected by both queries. The MINUS returns

Introduction to oracle, Introduction Oracle 9i - it was made publ...

Introduction Oracle 9i - it was made public in the year 2001 with over 400 features, and graphics, it has merged the traditional business with modern internet application

Package standard in pl/sql, Package STANDARD package named STANDARD d...

Package STANDARD package named STANDARD defines the PL/SQL atmosphere. The package specification globally declares the exceptions, types, and subprograms that are available a

Calculating a Shopper''s Total Spending, Many of the reports generated from...

Many of the reports generated from the system calculate the total dollars in a shopper''s purchases. Follow these steps to create a function named TOT_PURCH_SF that accepts a shopp

Sequential control - pl/sql, Sequential Control Dissimilar to the IF and ...

Sequential Control Dissimilar to the IF and LOOP statements, the GOTO and NULL statements are not important to the PL/SQL programming. The configuration of PL/SQL is such that th

Data types in sql - timestamp, Data Types in SQL - Timestamp TIMESTAMP...

Data Types in SQL - Timestamp TIMESTAMP for values representing points in time on a specified uniform scale. DATE is used for timestamps on a scale of one day, such as DATE '2

Max and min operator in sql, MAX and MIN operator in SQL Example: ...

MAX and MIN operator in SQL Example: (SELECT MAX (Mark) FROM EXAM_MARK WHERE StudentId = 'S1') (SELECT MIN (Mark) FROM EXAM_MARK WHERE StudentId = 'S1') Example

Use external routines - improve performance of application, Use External Ro...

Use External Routines The PL/SQL is particular for the SQL transaction processing. Therefore, several tasks are more quickly completed in a lower-level language like C that is

Write Your Message!

Captcha
Free Assignment Quote

Assured A++ Grade

Get guaranteed satisfaction & time on delivery in every assignment order you paid with us! We ensure premium quality solution document along with free turntin report!

All rights reserved! Copyrights ©2019-2020 ExpertsMind IT Educational Pvt Ltd