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

Declaring objects in pl/sql, Declaring Objects: You can use the object ...

Declaring Objects: You can use the object types wherever built-in types like CHAR or NUMBER can be used. In the block below, you can declare object r of type Rational. Then, yo

Join query, Using a join on 3 tables, select 5 columns and 10 rows from the...

Using a join on 3 tables, select 5 columns and 10 rows from the 3 tables without the use of a Cartesian product Query: SELECT E.LAST_NAME, E.FIRST_NAME, S.BUILDING, S.BRAN

Using raise_application_error - user-defined exceptions, Using raise_applic...

Using raise_application_error The Package DBMS_STANDARD that is supplied with Oracle gives language facilities that help your application to interact with Oracle. For illustra

Package dbms pipe in pl/sql, DBMS_PIPE: The Package DBMS_PIPE allows va...

DBMS_PIPE: The Package DBMS_PIPE allows various sessions to communicate over the named pipes. (A pipe is a region of memory used by one of the process to pass information to

EXCEPTION handling, set serveroutput on declare a number(5); b numb...

set serveroutput on declare a number(5); b number(5); c number(5); begin a:=&a; b:=&b; c:=a/b; dbms_output.put_line(c); exception when zero_divide then d

Authorize and fetch data from instagram, Authorize and fetch data from Inst...

Authorize and fetch data from Instagram Project Description: Incorporate Instagram feed on mobile site platform: c#, ms sql, jquerymobile, jquery Web admin Author

Write an anonymous block that contains a pl/sql function, a. Write an anon...

a. Write an anonymous block that contains a PL/SQL function. Given an order number orderNo, the function will calculate the total number of the parts in the order. Then the anonym

Parameter modes, Parameter Modes   To define the behavior of formal pa...

Parameter Modes   To define the behavior of formal parameters you use the parameter modes. The 3 parameter modes, IN, OUT, & IN OUT, can be used with any subprogram. Though, a

Data types in sql - character, Data Types in SQL - Character CHARACTER...

Data Types in SQL - Character CHARACTER or, synonymously, CHAR, for character strings. When this type is to be the declared type of something (e.g., a column), the permissible

Committing and rolling back - autonomous transaction, Committing and Rollin...

Committing and Rolling Back The COMMIT and ROLLBACK end the active autonomous transaction but do not exit the autonomous routine. As the figure shows, if one transaction ends,

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