Question: I created different tables for each authors because each author table has different column names.

Table Author 

```
Author_ID   FirstName     LastName 
   1             Rock         Smith       
   2             Edward       Thomas

```

Table Author Books

```
 Author_ID   BookName
   1         Book1
   1         Book2
   1         Book3
   1         Book4
   1         Book5

```

I want result like this
Result Table

```
FirstName   LastName  BookName
 Rock        Smith    Book1
 Rock        Smith    Book2
 Rock        Smith    Book3
 Rock        Smith    Book4
 Rock        Smith    Book4

```

Table New\_Authors 

```
Author_ID    Author_Table
   1          Rock_Smith
   2          Edward_Thomas

```

Talbe Rock\_Smith

```
FirstName   LastName  BookName
 Rock        Smith    Book1
 Rock        Smith    Book2
 Rock        Smith    Book3
 Rock        Smith    Book4
 Rock        Smith    Book4

Is it possible to get all the Rock_Smith table info on querying New_Authors table?

```

Answer: 
Such things have appered in ConstraintLayout. You can read more about it [here](https://developer.android.com/training/constraint-layout/index.html) and [here](https://developer.android.com/reference/android/support/constraint/ConstraintLayout.html).

Without using this library i can only suggestion you using `LinearLayout` like this:

```
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:orientation="horizontal">

    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1" />

    <ImageView
        android:layout_width="0dp"
        android:layout_height="match_parent" 
        android:layout_weight="2" />

    <FrameLayout
        android:layout_width="0dp"
        android:layout_height="match_parent"
        android:layout_weight="1" />
</LinearLayout>

```

As you can see. I use `android:weight` attribute of `LinearLayout` to make ImageView take 50% of screen width if linearlayout takes the whole screen.

There is no need to define `weight_sum` in LinearLayout, just simply use `layout_weight` in child layout and assign the value. And be sure to set the `height` or `width` to 0, if you want to make the partitions vertically or horizontally respectively.

PS. `layout_weight` works with LinearLayouts only.
By using percent relative layout, we can achieve this easily. Herewith I will explain how to implement the `percentRelativeLayout`.

**Dependency:**

```
compile 'com.android.support:percent:23.3.0'

```

In your layout file,

```
<android.support.percent.PercentRelativeLayout
  xmlns:android="http://schemas.android.com/apk/res/android"
  xmlns:app="http://schemas.android.com/apk/res-auto"
  xmlns:tools="http://schemas.android.com/tools"
  android:layout_width="match_parent"
  android:layout_height="match_parent"
  android:paddingBottom="@dimen/activity_vertical_margin"
  android:paddingLeft="@dimen/activity_horizontal_margin"
  android:paddingRight="@dimen/activity_horizontal_margin"
  android:paddingTop="@dimen/activity_vertical_margin"
  tools:context=".MainActivity">

  <ImageView
         app:layout_widthPercent="match_parent"
         app:layout_heightPercent="50%"/>

</android.support.percent.PercentRelativeLayout>

```

Hope this is helpful:)