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

Cause of indeterminacy in sql, Cause of Indeterminacy in SQL One root ...

Cause of Indeterminacy in SQL One root cause of indeterminacy in SQL lies in its implementation of comparison for equality. For certain system-defined types it is possible for

Using %rowtype-declarations in sql, Using %ROWTYPE The %ROWTYPE attribut...

Using %ROWTYPE The %ROWTYPE attribute gives a record type which represents a row in a table (or view). The record can store the whole row of data selected from the table or fetc

Some varray examples-manipulating collections, Some Varray Examples In S...

Some Varray Examples In SQL Plus, assume that you define an object type Project, as described below: SQL> CREATE TYPE Project AS OBJECT ( 2 project_no NUMBER(2), 3 title VARCHA

Delete command - sql, DELETE Command - SQL Loosely speaking, DELETE re...

DELETE Command - SQL Loosely speaking, DELETE removes some existing rows from its target table. Suppose the university decides that course C3 is to be withdrawn. Example shows

Running the pl/sql wrapper, Running the PL/SQL Wrapper To run the PL/SQ...

Running the PL/SQL Wrapper To run the PL/SQL Wrapper, go through the wrap command at your operating system prompt by using the syntax as shown: wrap iname=input_file [oname=

Functions in pl/sql, Functions   The function is a subprogram that cal...

Functions   The function is a subprogram that calculates a value. The Functions and procedures are structured similar, except that the functions have a RETURN clause. You can

Varrays versus nested tables, Varrays versus Nested Tables The Nested ta...

Varrays versus Nested Tables The Nested tables are differing from varrays in the following ways: 1)  Varrays have a maximum size, while nested tables do not. 2)  Varrays are

Is null operator-comparison operators, IS NULL Operator The IS NULL oper...

IS NULL Operator The IS NULL operator returns the Boolean value TRUE whenever its operand is null or FALSE if it is not null. The comparisons including the nulls always yield NU

Using subqueries, Using Subqueries A subquery is a query (typically ...

Using Subqueries A subquery is a query (typically enclosed by parentheses) that appears within another SQL data manipulation statement. If evaluated, the subquery gives a va

Implicit cursor attributes, Implicit Cursor Attributes The Implicit cur...

Implicit Cursor Attributes The Implicit cursor attributes returns the information about the execution of an INSERT, DELETE, UPDATE, or SELECT INTO statement. The cursor attribu

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