There are three relations used for this example - RENTAL_CUSTOMER, CAR, RENTAL. Below are the SQL statements used to create the relations. Data have been inserted to the relations: RENTAL_CUSTOMER CAR RENTAL List all cars rented by Smith since 1st of August 2017 List each make of the cars and the total number of cars … Continue reading [DATABASE]SQL query examples
I have two relations namely PROPERTY and LEASE, see the PROPERTYNO attributes returned from PROPERTY and LEASE respectively: In intersect, tuples which exists in both relations will be displayed removing duplicates. In union, all tuples from property and all tuples from lease will be displayed removing duplicates:
Creating the tables Data from T1 Data from T2 Left outer join In the below example left table is T1 and right table is T2. Left outer join will cause tuples of the left table (T1) to be preserved, the right table (T2) will display values that match the TID of the left, if there … Continue reading [DATABASE]Difference between inner join, right and left outer join
This is a try out for using cx_Oracle module maintained by Oracle. The version I am trying is version 12.2 Here's the same code: The above is a test out code, to test on how to connect to the oracle database. Now i am expanding the code a little by doing two things: To list … Continue reading [python]Using cx_Oracle module
All the examples will use this simple table for explanation. Attribute is column, and tuple is row. In this table the attributes are from A to F. Functional dependency A is determinant, B is dependant. B is functional dependent on A. A and B are composite key which functionally determines C. The determinant must only … Continue reading Database – Normalisation
This is to count the number of rows in a table. Cyrus is the owner and customer is the table.
This is an oracle 12c query to find out all tables that are owned by "cyrus". select owner,table_name from all_tables where owner='CYRUS'; the contents in the row is case sensitive, in this example the content in row "owner" is CYRUS not Cyrus or cyrus. another way if you do not know the case of the … Continue reading Database: Check all tables from a known owner